diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 36766577..6fd133e8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ # See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file # * @equinix/governor-devrel-engineering - -*fabricv* @equinix/governor-digin-fabric \ No newline at end of file +*fabricv* @equinix/governor-digin-fabric +*metalv* @equinix/governor-metal-client-interfaces diff --git a/.github/workflows/ansible-tests-pr.yml b/.github/workflows/ansible-tests-pr.yml new file mode 100644 index 00000000..83fcad75 --- /dev/null +++ b/.github/workflows/ansible-tests-pr.yml @@ -0,0 +1,70 @@ +on: + pull_request_target: + paths: + - 'config/**' + - 'equinix_metal/**' + - 'templates/**' + - metal_openapi.fixed.yaml + - 'oas3.stitched/**' + - 'oas3.fetched/**' + workflow_dispatch: + +permissions: + pull-requests: read + contents: read + +jobs: + authorize: + environment: + ${{ github.event_name == 'pull_request_target' && + github.event.pull_request.head.repo.full_name != github.repository && + 'external' || 'internal' }} + runs-on: ubuntu-latest + steps: + - run: true + + integration-test-pr: + needs: authorize + runs-on: ubuntu-latest + steps: + - name: update packages + run: sudo apt-get update -y + + - name: install make + run: sudo apt-get install -y build-essential + + - name: setup python 3 + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: checkout Python SDK, this PR + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + + - name: checkout Ansible collection + uses: actions/checkout@v4 + with: + repository: equinix-labs/ansible-collection-equinix + path: .ansible/collections/ansible_collections/equinix/cloud + ref: main + + - name: install dependencies of ansible collection + run: pip3 install -r requirements-dev.txt -r requirements.txt + working-directory: .ansible/collections/ansible_collections/equinix/cloud + + - name: install cloned Python SDK + run: python3 -m pip install ./equinix_metal + + + - name: replace existing keys + run: rm -rf ~/.ansible/test && mkdir -p ~/.ansible/test && ssh-keygen -m PEM -q -t rsa -N '' -f ~/.ansible/test/id_rsa + working-directory: .ansible/collections/ansible_collections/equinix/cloud + + - name: run tests in ansible collection directory + run: make testall + working-directory: .ansible/collections/ansible_collections/equinix/cloud + env: + METAL_API_TOKEN: ${{ secrets.METAL_API_TOKEN }} + diff --git a/.github/workflows/sync-metalv1.yaml b/.github/workflows/sync-metalv1.yaml new file mode 100644 index 00000000..f5aeb062 --- /dev/null +++ b/.github/workflows/sync-metalv1.yaml @@ -0,0 +1,79 @@ +name: Sync metalv1 API spec + +on: + workflow_dispatch: + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + - name: Get current date + id: date + run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" + - name: Checkout code + uses: actions/checkout@v4 + - name: GitHub user + run: | + # https://api.github.com/users/github-actions[bot] + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + - name: Fetch latest spec + id: fetch + run: | + make -f Makefile.metalv1 fetch + git add spec/services/metalv1 + echo `git commit -m 'sync: fetch ${{ steps.date.outputs.date }} spec and apply patches'` + - name: Apply spec patches + id: patch + if: ${{ always() && steps.fetch.conclusion == 'success' }} + run: | + make -f Makefile.metalv1 patch + git add spec/services/metalv1 + echo `git commit -m 'sync: patch spec with ${{ steps.date.outputs.date }} spec'` + - name: Generate code + id: generate + if: ${{ always() && steps.patch.conclusion == 'success' }} + run: | + make -f Makefile.metalv1 generate + git add services/metalv1 + echo `git commit -m 'sync: generate client with ${{ steps.date.outputs.date }} spec'` + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v6 + if: ${{ always() && steps.fetch.conclusion == 'success' }} + with: + branch: sync/gh + branch-suffix: timestamp + author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + commit-message: "sync: uncommitted changes detected when opening PR" + title: "feat: API Sync by GitHub Action for @${{ github.event.sender.login }}" + body: | + This API Sync PR was triggered by @${{ github.event.sender.login }} through [GitHub Actions workflow_displatch](https://github.com/equinix/equinix-sdk-python/actions?query=event%3Aworkflow_dispatch) + on ${{ steps.date.outputs.date }}. + + * latest Swagger is fetched + * patches have been applied + * generated client has been updated + delete-branch: true + draft: ${{ steps.patch.conclusion == 'failure' || steps.generate.conclusion == 'failure' }} + - name: Comment for failed patch + uses: mshick/add-pr-comment@v2 + if: ${{ always() && steps.patch.conclusion == 'failure' && steps.cpr.conclusion == 'success' }} + with: + issue: ${{ steps.cpr.outputs.pull-request-number }} + message: Failed to patch latest spec. Someone with write access must fix this PR manually and then convert it from Draft status to Ready for Review. + - name: Comment for failed generate + uses: mshick/add-pr-comment@v2 + if: ${{ always() && steps.generate.conclusion == 'failure' && steps.cpr.conclusion == 'success' }} + with: + issue: ${{ steps.cpr.outputs.pull-request-number }} + message: Failed to generate code from latest patched spec. Someone with write access must fix this PR manually and then convert it from Draft status to Ready for Review. + - name: Check outputs + if: ${{ always() && steps.cpr.conclusion == 'success' }} + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/Makefile.metalv1 b/Makefile.metalv1 new file mode 100644 index 00000000..7a2f32b9 --- /dev/null +++ b/Makefile.metalv1 @@ -0,0 +1,75 @@ +.PHONY: all pull fetch patch generate clean codegen mod docs move-other patch-post fmt test stage + +include Makefile + +PACKAGE_NAME=metalv1 +SPEC_BASE_URL:=https://api.equinix.com/metal/v1/api-docs +SPEC_ROOT_FILE:=openapi3.yaml + +CODE_DIR=equinix/services/${PACKAGE_NAME} +TEMPLATE_DIR=${TEMPLATE_BASE_DIR}/${PACKAGE_NAME} +SPEC_FETCHED_DIR=${SPEC_BASE_DIR}/${PACKAGE_NAME}/oas3.fetched +SPEC_PATCH_DIR=${SPEC_BASE_DIR}/${PACKAGE_NAME}/patches +SPEC_PATCHED_DIR=${SPEC_BASE_DIR}/${PACKAGE_NAME}/oas3.patched +SPEC_STITCHED_DIR=${SPEC_BASE_DIR}/${PACKAGE_NAME}/oas3.stitched +all: pull fetch patch generate stage + +generate: clean codegen patch-post fmt test + +pull: + ${CRI} pull ${OPENAPI_IMAGE} + +fetch: + ${SPEC_FETCHER} ${SPEC_BASE_URL} ${SPEC_FETCHED_DIR} ${SPEC_ROOT_FILE} + +patch: + rm -rf ${SPEC_PATCHED_DIR} + cp -r ${SPEC_FETCHED_DIR} ${SPEC_PATCHED_DIR} + + # TODO: fetch the merged (single-file) spec + # instead of merging it here + ${OPENAPI_GENERATOR} generate \ + -i /local/${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE} \ + -g openapi-yaml \ + -p skipOperationExample=true -p outputFile=${SPEC_ROOT_FILE} \ + -o /local/${SPEC_PATCHED_DIR} + + rm -rf ${SPEC_PATCHED_DIR}/.openapi-generator* \ + ${SPEC_PATCHED_DIR}/README.md \ + ${SPEC_PATCHED_DIR}/components \ + ${SPEC_PATCHED_DIR}/paths + + for diff in $(shell set -x; find ${SPEC_PATCH_DIR} -name '*.patch' | sort -n); do \ + patch --no-backup-if-mismatch -N -t -p1 -i $$diff; \ + done + + script/patch_metal_spec.py ${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE} ${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE} + +patch-post: + # patch is idempotent, always starting with the generated files + for diff in $(shell find patches/post -name \*.patch | sort -n); do \ + patch --no-backup-if-mismatch -N -t -p1 -i $$diff; \ + done + +clean: + rm -rf $(CODE_DIR) + +codegen: + ${OPENAPI_GENERATOR} generate -g python \ + --package-name equinix.services.${PACKAGE_NAME} \ + --http-user-agent "${USER_AGENT}" \ + -p packageVersion=${PACKAGE_VERSION} \ + --git-user-id ${GIT_ORG} \ + --git-repo-id ${GIT_REPO} \ + `# TODO: re-enable the config file option so that generated code follows OpenAPI standards; this is only disabled to provide an upgrade path for metal-python` \ + `# -c /local/config/openapi-generator.json` \ + `# TODO: remove this when the config file is re-enabled` \ + -p generateSourceCodeOnly=true \ + -t /local/${TEMPLATE_DIR} \ + -o /local/ \ + -i /local/${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE} + +validate: + ${OPENAPI_GENERATOR} validate \ + --recommend \ + -i /local/${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE} diff --git a/equinix/services/metalv1/__init__.py b/equinix/services/metalv1/__init__.py new file mode 100644 index 00000000..a82184ec --- /dev/null +++ b/equinix/services/metalv1/__init__.py @@ -0,0 +1,328 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Metal API + + 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 + + +__version__ = "0.3.0" + +# import apis into sdk package +from equinix.services.metalv1.api.authentication_api import AuthenticationApi +from equinix.services.metalv1.api.bgp_api import BGPApi +from equinix.services.metalv1.api.batches_api import BatchesApi +from equinix.services.metalv1.api.capacity_api import CapacityApi +from equinix.services.metalv1.api.console_log_details_api import ConsoleLogDetailsApi +from equinix.services.metalv1.api.devices_api import DevicesApi +from equinix.services.metalv1.api.emails_api import EmailsApi +from equinix.services.metalv1.api.events_api import EventsApi +from equinix.services.metalv1.api.facilities_api import FacilitiesApi +from equinix.services.metalv1.api.firmware_sets_api import FirmwareSetsApi +from equinix.services.metalv1.api.hardware_reservations_api import HardwareReservationsApi +from equinix.services.metalv1.api.ip_addresses_api import IPAddressesApi +from equinix.services.metalv1.api.incidents_api import IncidentsApi +from equinix.services.metalv1.api.interconnections_api import InterconnectionsApi +from equinix.services.metalv1.api.invitations_api import InvitationsApi +from equinix.services.metalv1.api.invoices_api import InvoicesApi +from equinix.services.metalv1.api.licenses_api import LicensesApi +from equinix.services.metalv1.api.memberships_api import MembershipsApi +from equinix.services.metalv1.api.metal_gateways_api import MetalGatewaysApi +from equinix.services.metalv1.api.metros_api import MetrosApi +from equinix.services.metalv1.api.otps_api import OTPsApi +from equinix.services.metalv1.api.operating_systems_api import OperatingSystemsApi +from equinix.services.metalv1.api.organizations_api import OrganizationsApi +from equinix.services.metalv1.api.password_reset_tokens_api import PasswordResetTokensApi +from equinix.services.metalv1.api.payment_methods_api import PaymentMethodsApi +from equinix.services.metalv1.api.plans_api import PlansApi +from equinix.services.metalv1.api.ports_api import PortsApi +from equinix.services.metalv1.api.projects_api import ProjectsApi +from equinix.services.metalv1.api.ssh_keys_api import SSHKeysApi +from equinix.services.metalv1.api.self_service_reservations_api import SelfServiceReservationsApi +from equinix.services.metalv1.api.spot_market_api import SpotMarketApi +from equinix.services.metalv1.api.support_request_api import SupportRequestApi +from equinix.services.metalv1.api.transfer_requests_api import TransferRequestsApi +from equinix.services.metalv1.api.two_factor_auth_api import TwoFactorAuthApi +from equinix.services.metalv1.api.usages_api import UsagesApi +from equinix.services.metalv1.api.user_verification_tokens_api import UserVerificationTokensApi +from equinix.services.metalv1.api.userdata_api import UserdataApi +from equinix.services.metalv1.api.users_api import UsersApi +from equinix.services.metalv1.api.vlans_api import VLANsApi +from equinix.services.metalv1.api.vrfs_api import VRFsApi + +# import ApiClient +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.api_client import ApiClient +from equinix.services.metalv1.configuration import Configuration +from equinix.services.metalv1.exceptions import OpenApiException +from equinix.services.metalv1.exceptions import ApiTypeError +from equinix.services.metalv1.exceptions import ApiValueError +from equinix.services.metalv1.exceptions import ApiKeyError +from equinix.services.metalv1.exceptions import ApiAttributeError +from equinix.services.metalv1.exceptions import ApiException + +# import models into sdk package +from equinix.services.metalv1.models.aws_fabric_provider import AWSFabricProvider +from equinix.services.metalv1.models.activate_hardware_reservation_request import ActivateHardwareReservationRequest +from equinix.services.metalv1.models.address import Address +from equinix.services.metalv1.models.attribute import Attribute +from equinix.services.metalv1.models.attribute_data import AttributeData +from equinix.services.metalv1.models.auth_token import AuthToken +from equinix.services.metalv1.models.auth_token_input import AuthTokenInput +from equinix.services.metalv1.models.auth_token_list import AuthTokenList +from equinix.services.metalv1.models.auth_token_project import AuthTokenProject +from equinix.services.metalv1.models.auth_token_user import AuthTokenUser +from equinix.services.metalv1.models.bgp_session_input import BGPSessionInput +from equinix.services.metalv1.models.batch import Batch +from equinix.services.metalv1.models.batches_list import BatchesList +from equinix.services.metalv1.models.bgp_config import BgpConfig +from equinix.services.metalv1.models.bgp_config_request_input import BgpConfigRequestInput +from equinix.services.metalv1.models.bgp_dynamic_neighbor import BgpDynamicNeighbor +from equinix.services.metalv1.models.bgp_dynamic_neighbor_create_input import BgpDynamicNeighborCreateInput +from equinix.services.metalv1.models.bgp_dynamic_neighbor_list import BgpDynamicNeighborList +from equinix.services.metalv1.models.bgp_neighbor_data import BgpNeighborData +from equinix.services.metalv1.models.bgp_route import BgpRoute +from equinix.services.metalv1.models.bgp_session import BgpSession +from equinix.services.metalv1.models.bgp_session_list import BgpSessionList +from equinix.services.metalv1.models.bgp_session_neighbors import BgpSessionNeighbors +from equinix.services.metalv1.models.bond_port_data import BondPortData +from equinix.services.metalv1.models.capacity_check_per_facility_info import CapacityCheckPerFacilityInfo +from equinix.services.metalv1.models.capacity_check_per_facility_list import CapacityCheckPerFacilityList +from equinix.services.metalv1.models.capacity_check_per_metro_info import CapacityCheckPerMetroInfo +from equinix.services.metalv1.models.capacity_check_per_metro_list import CapacityCheckPerMetroList +from equinix.services.metalv1.models.capacity_input import CapacityInput +from equinix.services.metalv1.models.capacity_level_per_baremetal import CapacityLevelPerBaremetal +from equinix.services.metalv1.models.capacity_list import CapacityList +from equinix.services.metalv1.models.component import Component +from equinix.services.metalv1.models.coordinates import Coordinates +from equinix.services.metalv1.models.create_device_request import CreateDeviceRequest +from equinix.services.metalv1.models.create_email_input import CreateEmailInput +from equinix.services.metalv1.models.create_metal_gateway_request import CreateMetalGatewayRequest +from equinix.services.metalv1.models.create_organization_interconnection_request import CreateOrganizationInterconnectionRequest +from equinix.services.metalv1.models.create_self_service_reservation_request import CreateSelfServiceReservationRequest +from equinix.services.metalv1.models.create_self_service_reservation_request_period import CreateSelfServiceReservationRequestPeriod +from equinix.services.metalv1.models.dedicated_port_create_input import DedicatedPortCreateInput +from equinix.services.metalv1.models.device import Device +from equinix.services.metalv1.models.device_action_input import DeviceActionInput +from equinix.services.metalv1.models.device_actions_inner import DeviceActionsInner +from equinix.services.metalv1.models.device_create_in_facility_input import DeviceCreateInFacilityInput +from equinix.services.metalv1.models.device_create_in_metro_input import DeviceCreateInMetroInput +from equinix.services.metalv1.models.device_create_input import DeviceCreateInput +from equinix.services.metalv1.models.device_created_by import DeviceCreatedBy +from equinix.services.metalv1.models.device_health_rollup import DeviceHealthRollup +from equinix.services.metalv1.models.device_list import DeviceList +from equinix.services.metalv1.models.device_metro import DeviceMetro +from equinix.services.metalv1.models.device_project_lite import DeviceProjectLite +from equinix.services.metalv1.models.device_update_input import DeviceUpdateInput +from equinix.services.metalv1.models.device_usage import DeviceUsage +from equinix.services.metalv1.models.device_usage_list import DeviceUsageList +from equinix.services.metalv1.models.disk import Disk +from equinix.services.metalv1.models.email import Email +from equinix.services.metalv1.models.email_input import EmailInput +from equinix.services.metalv1.models.entitlement import Entitlement +from equinix.services.metalv1.models.error import Error +from equinix.services.metalv1.models.event import Event +from equinix.services.metalv1.models.event_list import EventList +from equinix.services.metalv1.models.fabric_service_token import FabricServiceToken +from equinix.services.metalv1.models.facility import Facility +from equinix.services.metalv1.models.facility_input import FacilityInput +from equinix.services.metalv1.models.facility_input_facility import FacilityInputFacility +from equinix.services.metalv1.models.facility_list import FacilityList +from equinix.services.metalv1.models.filesystem import Filesystem +from equinix.services.metalv1.models.find_ip_address_by_id200_response import FindIPAddressById200Response +from equinix.services.metalv1.models.find_metal_gateway_by_id200_response import FindMetalGatewayById200Response +from equinix.services.metalv1.models.find_traffic_timeframe_parameter import FindTrafficTimeframeParameter +from equinix.services.metalv1.models.firmware_set import FirmwareSet +from equinix.services.metalv1.models.firmware_set_list_response import FirmwareSetListResponse +from equinix.services.metalv1.models.firmware_set_response import FirmwareSetResponse +from equinix.services.metalv1.models.global_bgp_range import GlobalBgpRange +from equinix.services.metalv1.models.global_bgp_range_list import GlobalBgpRangeList +from equinix.services.metalv1.models.hardware_reservation import HardwareReservation +from equinix.services.metalv1.models.hardware_reservation_list import HardwareReservationList +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.ip_address import IPAddress +from equinix.services.metalv1.models.ip_assignment import IPAssignment +from equinix.services.metalv1.models.ip_assignment_input import IPAssignmentInput +from equinix.services.metalv1.models.ip_assignment_list import IPAssignmentList +from equinix.services.metalv1.models.ip_assignment_metro import IPAssignmentMetro +from equinix.services.metalv1.models.ip_assignment_update_input import IPAssignmentUpdateInput +from equinix.services.metalv1.models.ip_availabilities_list import IPAvailabilitiesList +from equinix.services.metalv1.models.ip_reservation import IPReservation +from equinix.services.metalv1.models.ip_reservation_facility import IPReservationFacility +from equinix.services.metalv1.models.ip_reservation_list import IPReservationList +from equinix.services.metalv1.models.ip_reservation_list_ip_addresses_inner import IPReservationListIpAddressesInner +from equinix.services.metalv1.models.ip_reservation_metro import IPReservationMetro +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.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_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_providers_inner import InterconnectionMetroListMetrosInnerAllOfProvidersInner +from equinix.services.metalv1.models.interconnection_port import InterconnectionPort +from equinix.services.metalv1.models.interconnection_port_list import InterconnectionPortList +from equinix.services.metalv1.models.interconnection_pricing_list import InterconnectionPricingList +from equinix.services.metalv1.models.interconnection_pricing_list_provider_pricing_inner import InterconnectionPricingListProviderPricingInner +from equinix.services.metalv1.models.interconnection_pricing_list_provider_pricing_inner_tiers_inner import InterconnectionPricingListProviderPricingInnerTiersInner +from equinix.services.metalv1.models.interconnection_update_input import InterconnectionUpdateInput +from equinix.services.metalv1.models.invitation import Invitation +from equinix.services.metalv1.models.invitation_input import InvitationInput +from equinix.services.metalv1.models.invitation_list import InvitationList +from equinix.services.metalv1.models.invoice import Invoice +from equinix.services.metalv1.models.invoice_list import InvoiceList +from equinix.services.metalv1.models.license import License +from equinix.services.metalv1.models.license_create_input import LicenseCreateInput +from equinix.services.metalv1.models.license_list import LicenseList +from equinix.services.metalv1.models.license_update_input import LicenseUpdateInput +from equinix.services.metalv1.models.line_item import LineItem +from equinix.services.metalv1.models.line_item_adjustment import LineItemAdjustment +from equinix.services.metalv1.models.membership import Membership +from equinix.services.metalv1.models.membership_input import MembershipInput +from equinix.services.metalv1.models.membership_list import MembershipList +from equinix.services.metalv1.models.meta import Meta +from equinix.services.metalv1.models.metadata import Metadata +from equinix.services.metalv1.models.metadata_network import MetadataNetwork +from equinix.services.metalv1.models.metadata_network_network import MetadataNetworkNetwork +from equinix.services.metalv1.models.metadata_network_network_bonding import MetadataNetworkNetworkBonding +from equinix.services.metalv1.models.metal_gateway import MetalGateway +from equinix.services.metalv1.models.metal_gateway_create_input import MetalGatewayCreateInput +from equinix.services.metalv1.models.metal_gateway_elastic_ip_create_input import MetalGatewayElasticIpCreateInput +from equinix.services.metalv1.models.metal_gateway_list import MetalGatewayList +from equinix.services.metalv1.models.metal_gateway_list_metal_gateways_inner import MetalGatewayListMetalGatewaysInner +from equinix.services.metalv1.models.metal_gateway_lite import MetalGatewayLite +from equinix.services.metalv1.models.metro import Metro +from equinix.services.metalv1.models.metro_input import MetroInput +from equinix.services.metalv1.models.metro_list import MetroList +from equinix.services.metalv1.models.mount import Mount +from equinix.services.metalv1.models.move_hardware_reservation_request import MoveHardwareReservationRequest +from equinix.services.metalv1.models.new_password import NewPassword +from equinix.services.metalv1.models.operating_system import OperatingSystem +from equinix.services.metalv1.models.operating_system_list import OperatingSystemList +from equinix.services.metalv1.models.organization import Organization +from equinix.services.metalv1.models.organization_input import OrganizationInput +from equinix.services.metalv1.models.organization_list import OrganizationList +from equinix.services.metalv1.models.parent_block import ParentBlock +from equinix.services.metalv1.models.partition import Partition +from equinix.services.metalv1.models.payment_method import PaymentMethod +from equinix.services.metalv1.models.payment_method_billing_address import PaymentMethodBillingAddress +from equinix.services.metalv1.models.payment_method_create_input import PaymentMethodCreateInput +from equinix.services.metalv1.models.payment_method_list import PaymentMethodList +from equinix.services.metalv1.models.payment_method_update_input import PaymentMethodUpdateInput +from equinix.services.metalv1.models.plan import Plan +from equinix.services.metalv1.models.plan_available_in_inner import PlanAvailableInInner +from equinix.services.metalv1.models.plan_available_in_inner_price import PlanAvailableInInnerPrice +from equinix.services.metalv1.models.plan_available_in_metros_inner import PlanAvailableInMetrosInner +from equinix.services.metalv1.models.plan_id_name import PlanIdName +from equinix.services.metalv1.models.plan_list import PlanList +from equinix.services.metalv1.models.plan_specs import PlanSpecs +from equinix.services.metalv1.models.plan_specs_cpus_inner import PlanSpecsCpusInner +from equinix.services.metalv1.models.plan_specs_drives_inner import PlanSpecsDrivesInner +from equinix.services.metalv1.models.plan_specs_features import PlanSpecsFeatures +from equinix.services.metalv1.models.plan_specs_memory import PlanSpecsMemory +from equinix.services.metalv1.models.plan_specs_nics_inner import PlanSpecsNicsInner +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.models.port_assign_input import PortAssignInput +from equinix.services.metalv1.models.port_convert_layer3_input import PortConvertLayer3Input +from equinix.services.metalv1.models.port_convert_layer3_input_request_ips_inner import PortConvertLayer3InputRequestIpsInner +from equinix.services.metalv1.models.port_data import PortData +from equinix.services.metalv1.models.port_vlan_assignment import PortVlanAssignment +from equinix.services.metalv1.models.port_vlan_assignment_batch import PortVlanAssignmentBatch +from equinix.services.metalv1.models.port_vlan_assignment_batch_create_input import PortVlanAssignmentBatchCreateInput +from equinix.services.metalv1.models.port_vlan_assignment_batch_create_input_vlan_assignments_inner import PortVlanAssignmentBatchCreateInputVlanAssignmentsInner +from equinix.services.metalv1.models.port_vlan_assignment_batch_list import PortVlanAssignmentBatchList +from equinix.services.metalv1.models.port_vlan_assignment_batch_vlan_assignments_inner import PortVlanAssignmentBatchVlanAssignmentsInner +from equinix.services.metalv1.models.port_vlan_assignment_list import PortVlanAssignmentList +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.project_create_from_root_input import ProjectCreateFromRootInput +from equinix.services.metalv1.models.project_create_input import ProjectCreateInput +from equinix.services.metalv1.models.project_id_name import ProjectIdName +from equinix.services.metalv1.models.project_list import ProjectList +from equinix.services.metalv1.models.project_update_input import ProjectUpdateInput +from equinix.services.metalv1.models.project_usage import ProjectUsage +from equinix.services.metalv1.models.project_usage_list import ProjectUsageList +from equinix.services.metalv1.models.raid import Raid +from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList +from equinix.services.metalv1.models.request_ip_reservation201_response import RequestIPReservation201Response +from equinix.services.metalv1.models.request_ip_reservation_request import RequestIPReservationRequest +from equinix.services.metalv1.models.ssh_key import SSHKey +from equinix.services.metalv1.models.ssh_key_create_input import SSHKeyCreateInput +from equinix.services.metalv1.models.ssh_key_input import SSHKeyInput +from equinix.services.metalv1.models.ssh_key_list import SSHKeyList +from equinix.services.metalv1.models.self_service_reservation_item_request import SelfServiceReservationItemRequest +from equinix.services.metalv1.models.self_service_reservation_item_response import SelfServiceReservationItemResponse +from equinix.services.metalv1.models.self_service_reservation_list import SelfServiceReservationList +from equinix.services.metalv1.models.self_service_reservation_response import SelfServiceReservationResponse +from equinix.services.metalv1.models.server_info import ServerInfo +from equinix.services.metalv1.models.shared_port_vc_vlan_create_input import SharedPortVCVlanCreateInput +from equinix.services.metalv1.models.spot_market_prices_list import SpotMarketPricesList +from equinix.services.metalv1.models.spot_market_prices_per_metro_list import SpotMarketPricesPerMetroList +from equinix.services.metalv1.models.spot_market_prices_per_metro_report import SpotMarketPricesPerMetroReport +from equinix.services.metalv1.models.spot_market_request import SpotMarketRequest +from equinix.services.metalv1.models.spot_market_request_create_input import SpotMarketRequestCreateInput +from equinix.services.metalv1.models.spot_market_request_create_input_instance_parameters import SpotMarketRequestCreateInputInstanceParameters +from equinix.services.metalv1.models.spot_market_request_list import SpotMarketRequestList +from equinix.services.metalv1.models.spot_market_request_metro import SpotMarketRequestMetro +from equinix.services.metalv1.models.spot_prices_datapoints import SpotPricesDatapoints +from equinix.services.metalv1.models.spot_prices_history_report import SpotPricesHistoryReport +from equinix.services.metalv1.models.spot_prices_per_baremetal import SpotPricesPerBaremetal +from equinix.services.metalv1.models.spot_prices_per_facility import SpotPricesPerFacility +from equinix.services.metalv1.models.spot_prices_per_new_facility import SpotPricesPerNewFacility +from equinix.services.metalv1.models.spot_prices_report import SpotPricesReport +from equinix.services.metalv1.models.storage import Storage +from equinix.services.metalv1.models.support_request_input import SupportRequestInput +from equinix.services.metalv1.models.transfer_request import TransferRequest +from equinix.services.metalv1.models.transfer_request_input import TransferRequestInput +from equinix.services.metalv1.models.transfer_request_list import TransferRequestList +from equinix.services.metalv1.models.update_email_input import UpdateEmailInput +from equinix.services.metalv1.models.user import User +from equinix.services.metalv1.models.user_create_input import UserCreateInput +from equinix.services.metalv1.models.user_limited import UserLimited +from equinix.services.metalv1.models.user_list import UserList +from equinix.services.metalv1.models.user_lite import UserLite +from equinix.services.metalv1.models.user_update_input import UserUpdateInput +from equinix.services.metalv1.models.userdata import Userdata +from equinix.services.metalv1.models.verify_email import VerifyEmail +from equinix.services.metalv1.models.virtual_circuit import VirtualCircuit +from equinix.services.metalv1.models.virtual_circuit_create_input import VirtualCircuitCreateInput +from equinix.services.metalv1.models.virtual_circuit_list import VirtualCircuitList +from equinix.services.metalv1.models.virtual_circuit_update_input import VirtualCircuitUpdateInput +from equinix.services.metalv1.models.virtual_network import VirtualNetwork +from equinix.services.metalv1.models.virtual_network_create_input import VirtualNetworkCreateInput +from equinix.services.metalv1.models.virtual_network_list import VirtualNetworkList +from equinix.services.metalv1.models.virtual_network_update_input import VirtualNetworkUpdateInput +from equinix.services.metalv1.models.vlan_csp_connection_create_input import VlanCSPConnectionCreateInput +from equinix.services.metalv1.models.vlan_csp_connection_create_input_fabric_provider import VlanCSPConnectionCreateInputFabricProvider +from equinix.services.metalv1.models.vlan_fabric_vc_create_input import VlanFabricVcCreateInput +from equinix.services.metalv1.models.vlan_virtual_circuit import VlanVirtualCircuit +from equinix.services.metalv1.models.vlan_virtual_circuit_create_input import VlanVirtualCircuitCreateInput +from equinix.services.metalv1.models.vlan_virtual_circuit_update_input import VlanVirtualCircuitUpdateInput +from equinix.services.metalv1.models.vrf import Vrf +from equinix.services.metalv1.models.vrf_bgp_neighbors import VrfBGPNeighbors +from equinix.services.metalv1.models.vrf_bgp_neighbors_list import VrfBGPNeighborsList +from equinix.services.metalv1.models.vrf_create_input import VrfCreateInput +from equinix.services.metalv1.models.vrf_fabric_vc_create_input import VrfFabricVcCreateInput +from equinix.services.metalv1.models.vrf_ip_reservation import VrfIpReservation +from equinix.services.metalv1.models.vrf_ip_reservation_create_input import VrfIpReservationCreateInput +from equinix.services.metalv1.models.vrf_ip_reservation_list import VrfIpReservationList +from equinix.services.metalv1.models.vrf_learned_routes import VrfLearnedRoutes +from equinix.services.metalv1.models.vrf_learned_routes_list import VrfLearnedRoutesList +from equinix.services.metalv1.models.vrf_list import VrfList +from equinix.services.metalv1.models.vrf_metal_gateway import VrfMetalGateway +from equinix.services.metalv1.models.vrf_metal_gateway_create_input import VrfMetalGatewayCreateInput +from equinix.services.metalv1.models.vrf_route import VrfRoute +from equinix.services.metalv1.models.vrf_route_create_input import VrfRouteCreateInput +from equinix.services.metalv1.models.vrf_route_list import VrfRouteList +from equinix.services.metalv1.models.vrf_route_update_input import VrfRouteUpdateInput +from equinix.services.metalv1.models.vrf_update_input import VrfUpdateInput +from equinix.services.metalv1.models.vrf_virtual_circuit import VrfVirtualCircuit +from equinix.services.metalv1.models.vrf_virtual_circuit_create_input import VrfVirtualCircuitCreateInput +from equinix.services.metalv1.models.vrf_virtual_circuit_update_input import VrfVirtualCircuitUpdateInput diff --git a/equinix/services/metalv1/api/__init__.py b/equinix/services/metalv1/api/__init__.py new file mode 100644 index 00000000..3cedc5a3 --- /dev/null +++ b/equinix/services/metalv1/api/__init__.py @@ -0,0 +1,44 @@ +# flake8: noqa + +# import apis into api package +from equinix.services.metalv1.api.authentication_api import AuthenticationApi +from equinix.services.metalv1.api.bgp_api import BGPApi +from equinix.services.metalv1.api.batches_api import BatchesApi +from equinix.services.metalv1.api.capacity_api import CapacityApi +from equinix.services.metalv1.api.console_log_details_api import ConsoleLogDetailsApi +from equinix.services.metalv1.api.devices_api import DevicesApi +from equinix.services.metalv1.api.emails_api import EmailsApi +from equinix.services.metalv1.api.events_api import EventsApi +from equinix.services.metalv1.api.facilities_api import FacilitiesApi +from equinix.services.metalv1.api.firmware_sets_api import FirmwareSetsApi +from equinix.services.metalv1.api.hardware_reservations_api import HardwareReservationsApi +from equinix.services.metalv1.api.ip_addresses_api import IPAddressesApi +from equinix.services.metalv1.api.incidents_api import IncidentsApi +from equinix.services.metalv1.api.interconnections_api import InterconnectionsApi +from equinix.services.metalv1.api.invitations_api import InvitationsApi +from equinix.services.metalv1.api.invoices_api import InvoicesApi +from equinix.services.metalv1.api.licenses_api import LicensesApi +from equinix.services.metalv1.api.memberships_api import MembershipsApi +from equinix.services.metalv1.api.metal_gateways_api import MetalGatewaysApi +from equinix.services.metalv1.api.metros_api import MetrosApi +from equinix.services.metalv1.api.otps_api import OTPsApi +from equinix.services.metalv1.api.operating_systems_api import OperatingSystemsApi +from equinix.services.metalv1.api.organizations_api import OrganizationsApi +from equinix.services.metalv1.api.password_reset_tokens_api import PasswordResetTokensApi +from equinix.services.metalv1.api.payment_methods_api import PaymentMethodsApi +from equinix.services.metalv1.api.plans_api import PlansApi +from equinix.services.metalv1.api.ports_api import PortsApi +from equinix.services.metalv1.api.projects_api import ProjectsApi +from equinix.services.metalv1.api.ssh_keys_api import SSHKeysApi +from equinix.services.metalv1.api.self_service_reservations_api import SelfServiceReservationsApi +from equinix.services.metalv1.api.spot_market_api import SpotMarketApi +from equinix.services.metalv1.api.support_request_api import SupportRequestApi +from equinix.services.metalv1.api.transfer_requests_api import TransferRequestsApi +from equinix.services.metalv1.api.two_factor_auth_api import TwoFactorAuthApi +from equinix.services.metalv1.api.usages_api import UsagesApi +from equinix.services.metalv1.api.user_verification_tokens_api import UserVerificationTokensApi +from equinix.services.metalv1.api.userdata_api import UserdataApi +from equinix.services.metalv1.api.users_api import UsersApi +from equinix.services.metalv1.api.vlans_api import VLANsApi +from equinix.services.metalv1.api.vrfs_api import VRFsApi + diff --git a/equinix/services/metalv1/api/authentication_api.py b/equinix/services/metalv1/api/authentication_api.py new file mode 100644 index 00000000..6debc033 --- /dev/null +++ b/equinix/services/metalv1/api/authentication_api.py @@ -0,0 +1,1733 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.auth_token import AuthToken +from equinix.services.metalv1.models.auth_token_input import AuthTokenInput +from equinix.services.metalv1.models.auth_token_list import AuthTokenList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class AuthenticationApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_api_key( + self, + auth_token_input: Annotated[AuthTokenInput, Field(description="API key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthToken: + """Create an API key + + Creates a API key for the current user. + + :param auth_token_input: API key to create (required) + :type auth_token_input: AuthTokenInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_api_key_serialize( + auth_token_input=auth_token_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AuthToken", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_api_key_with_http_info( + self, + auth_token_input: Annotated[AuthTokenInput, Field(description="API key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthToken]: + """Create an API key + + Creates a API key for the current user. + + :param auth_token_input: API key to create (required) + :type auth_token_input: AuthTokenInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_api_key_serialize( + auth_token_input=auth_token_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AuthToken", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_api_key_without_preload_content( + self, + auth_token_input: Annotated[AuthTokenInput, Field(description="API key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an API key + + Creates a API key for the current user. + + :param auth_token_input: API key to create (required) + :type auth_token_input: AuthTokenInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_api_key_serialize( + auth_token_input=auth_token_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AuthToken", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_api_key_serialize( + self, + auth_token_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if auth_token_input is not None: + _body_params = auth_token_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/user/api-keys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_project_api_key( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + auth_token_input: Annotated[AuthTokenInput, Field(description="API Key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthToken: + """Create an API key for a project. + + Creates an API key for a project. + + :param id: Project UUID (required) + :type id: str + :param auth_token_input: API Key to create (required) + :type auth_token_input: AuthTokenInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_api_key_serialize( + id=id, + auth_token_input=auth_token_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AuthToken", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_project_api_key_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + auth_token_input: Annotated[AuthTokenInput, Field(description="API Key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthToken]: + """Create an API key for a project. + + Creates an API key for a project. + + :param id: Project UUID (required) + :type id: str + :param auth_token_input: API Key to create (required) + :type auth_token_input: AuthTokenInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_api_key_serialize( + id=id, + auth_token_input=auth_token_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AuthToken", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_project_api_key_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + auth_token_input: Annotated[AuthTokenInput, Field(description="API Key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an API key for a project. + + Creates an API key for a project. + + :param id: Project UUID (required) + :type id: str + :param auth_token_input: API Key to create (required) + :type auth_token_input: AuthTokenInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_api_key_serialize( + id=id, + auth_token_input=auth_token_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AuthToken", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_project_api_key_serialize( + self, + id, + auth_token_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if auth_token_input is not None: + _body_params = auth_token_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/api-keys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_api_key( + self, + id: Annotated[StrictStr, Field(description="API Key UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the API key + + Deletes the API key. + + :param id: API Key UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_api_key_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_api_key_with_http_info( + self, + id: Annotated[StrictStr, Field(description="API Key UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the API key + + Deletes the API key. + + :param id: API Key UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_api_key_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_api_key_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="API Key UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the API key + + Deletes the API key. + + :param id: API Key UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_api_key_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_api_key_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api-keys/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_user_api_key( + self, + id: Annotated[StrictStr, Field(description="API Key UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the API key + + Deletes the current user API key. + + :param id: API Key UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_api_key_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_user_api_key_with_http_info( + self, + id: Annotated[StrictStr, Field(description="API Key UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the API key + + Deletes the current user API key. + + :param id: API Key UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_api_key_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_user_api_key_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="API Key UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the API key + + Deletes the current user API key. + + :param id: API Key UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_api_key_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_user_api_key_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/user/api-keys/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_api_keys( + self, + search: Annotated[Optional[StrictStr], Field(description="Search by description")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthTokenList: + """Retrieve all user API keys + + Returns all API keys for the current user. + + :param search: Search by description + :type search: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_api_keys_serialize( + search=search, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthTokenList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_api_keys_with_http_info( + self, + search: Annotated[Optional[StrictStr], Field(description="Search by description")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthTokenList]: + """Retrieve all user API keys + + Returns all API keys for the current user. + + :param search: Search by description + :type search: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_api_keys_serialize( + search=search, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthTokenList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_api_keys_without_preload_content( + self, + search: Annotated[Optional[StrictStr], Field(description="Search by description")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all user API keys + + Returns all API keys for the current user. + + :param search: Search by description + :type search: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_api_keys_serialize( + search=search, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthTokenList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_api_keys_serialize( + self, + search, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/user/api-keys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_api_keys( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AuthTokenList: + """Retrieve all API keys for the project. + + Returns all API keys for a specific project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_api_keys_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthTokenList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_api_keys_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AuthTokenList]: + """Retrieve all API keys for the project. + + Returns all API keys for a specific project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_api_keys_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthTokenList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_api_keys_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all API keys for the project. + + Returns all API keys for a specific project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_api_keys_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AuthTokenList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_api_keys_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/api-keys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/batches_api.py b/equinix/services/metalv1/api/batches_api.py new file mode 100644 index 00000000..4d6c3490 --- /dev/null +++ b/equinix/services/metalv1/api/batches_api.py @@ -0,0 +1,1178 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.batch import Batch +from equinix.services.metalv1.models.batches_list import BatchesList +from equinix.services.metalv1.models.instances_batch_create_input import InstancesBatchCreateInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class BatchesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_device_batch( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + instances_batch_create_input: Annotated[InstancesBatchCreateInput, Field(description="Batches to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BatchesList: + """Create a devices batch + + Creates new devices in batch and provisions them in our datacenter. + + :param id: Project UUID (required) + :type id: str + :param instances_batch_create_input: Batches to create (required) + :type instances_batch_create_input: InstancesBatchCreateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_device_batch_serialize( + id=id, + instances_batch_create_input=instances_batch_create_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BatchesList", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_device_batch_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + instances_batch_create_input: Annotated[InstancesBatchCreateInput, Field(description="Batches to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BatchesList]: + """Create a devices batch + + Creates new devices in batch and provisions them in our datacenter. + + :param id: Project UUID (required) + :type id: str + :param instances_batch_create_input: Batches to create (required) + :type instances_batch_create_input: InstancesBatchCreateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_device_batch_serialize( + id=id, + instances_batch_create_input=instances_batch_create_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BatchesList", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_device_batch_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + instances_batch_create_input: Annotated[InstancesBatchCreateInput, Field(description="Batches to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a devices batch + + Creates new devices in batch and provisions them in our datacenter. + + :param id: Project UUID (required) + :type id: str + :param instances_batch_create_input: Batches to create (required) + :type instances_batch_create_input: InstancesBatchCreateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_device_batch_serialize( + id=id, + instances_batch_create_input=instances_batch_create_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BatchesList", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_device_batch_serialize( + self, + id, + instances_batch_create_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if instances_batch_create_input is not None: + _body_params = instances_batch_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/devices/batch', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_batch( + self, + id: Annotated[StrictStr, Field(description="Batch UUID")], + remove_associated_instances: Annotated[Optional[StrictBool], Field(description="Delete all instances created from this batch")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the Batch + + Deletes the Batch. + + :param id: Batch UUID (required) + :type id: str + :param remove_associated_instances: Delete all instances created from this batch + :type remove_associated_instances: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_batch_serialize( + id=id, + remove_associated_instances=remove_associated_instances, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_batch_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Batch UUID")], + remove_associated_instances: Annotated[Optional[StrictBool], Field(description="Delete all instances created from this batch")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the Batch + + Deletes the Batch. + + :param id: Batch UUID (required) + :type id: str + :param remove_associated_instances: Delete all instances created from this batch + :type remove_associated_instances: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_batch_serialize( + id=id, + remove_associated_instances=remove_associated_instances, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_batch_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Batch UUID")], + remove_associated_instances: Annotated[Optional[StrictBool], Field(description="Delete all instances created from this batch")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the Batch + + Deletes the Batch. + + :param id: Batch UUID (required) + :type id: str + :param remove_associated_instances: Delete all instances created from this batch + :type remove_associated_instances: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_batch_serialize( + id=id, + remove_associated_instances=remove_associated_instances, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_batch_serialize( + self, + id, + remove_associated_instances, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if remove_associated_instances is not None: + + _query_params.append(('remove_associated_instances', remove_associated_instances)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/batches/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_batch_by_id( + self, + id: Annotated[StrictStr, Field(description="Batch UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Batch: + """Retrieve a Batch + + Returns a Batch + + :param id: Batch UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_batch_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Batch", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_batch_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Batch UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Batch]: + """Retrieve a Batch + + Returns a Batch + + :param id: Batch UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_batch_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Batch", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_batch_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Batch UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a Batch + + Returns a Batch + + :param id: Batch UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_batch_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Batch", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_batch_by_id_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/batches/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_batches_by_project( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BatchesList: + """Retrieve all batches by project + + Returns all batches for the given project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_batches_by_project_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BatchesList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_batches_by_project_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BatchesList]: + """Retrieve all batches by project + + Returns all batches for the given project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_batches_by_project_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BatchesList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_batches_by_project_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all batches by project + + Returns all batches for the given project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_batches_by_project_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BatchesList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_batches_by_project_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/batches', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/bgp_api.py b/equinix/services/metalv1/api/bgp_api.py new file mode 100644 index 00000000..ca1468d0 --- /dev/null +++ b/equinix/services/metalv1/api/bgp_api.py @@ -0,0 +1,2010 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.bgp_config import BgpConfig +from equinix.services.metalv1.models.bgp_config_request_input import BgpConfigRequestInput +from equinix.services.metalv1.models.bgp_session import BgpSession +from equinix.services.metalv1.models.bgp_session_list import BgpSessionList +from equinix.services.metalv1.models.global_bgp_range_list import GlobalBgpRangeList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class BGPApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def delete_bgp_session( + self, + id: Annotated[StrictStr, Field(description="BGP session UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the BGP session + + Deletes the BGP session. + + :param id: BGP session UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bgp_session_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_bgp_session_with_http_info( + self, + id: Annotated[StrictStr, Field(description="BGP session UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the BGP session + + Deletes the BGP session. + + :param id: BGP session UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bgp_session_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_bgp_session_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="BGP session UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the BGP session + + Deletes the BGP session. + + :param id: BGP session UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bgp_session_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_bgp_session_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/bgp/sessions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_bgp_config_by_project( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpConfig: + """Retrieve a bgp config + + Returns a bgp config + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_bgp_config_by_project_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpConfig", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_bgp_config_by_project_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpConfig]: + """Retrieve a bgp config + + Returns a bgp config + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_bgp_config_by_project_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpConfig", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_bgp_config_by_project_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a bgp config + + Returns a bgp config + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_bgp_config_by_project_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpConfig", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_bgp_config_by_project_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/bgp-config', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_bgp_session_by_id( + self, + id: Annotated[StrictStr, Field(description="BGP session UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpSession: + """Retrieve a BGP session + + Returns a BGP session + + :param id: BGP session UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_bgp_session_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSession", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_bgp_session_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="BGP session UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpSession]: + """Retrieve a BGP session + + Returns a BGP session + + :param id: BGP session UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_bgp_session_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSession", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_bgp_session_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="BGP session UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a BGP session + + Returns a BGP session + + :param id: BGP session UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_bgp_session_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSession", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_bgp_session_by_id_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/bgp/sessions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_global_bgp_ranges( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GlobalBgpRangeList: + """Retrieve all global bgp ranges + + Returns all global bgp ranges for a project + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_global_bgp_ranges_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalBgpRangeList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_global_bgp_ranges_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GlobalBgpRangeList]: + """Retrieve all global bgp ranges + + Returns all global bgp ranges for a project + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_global_bgp_ranges_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalBgpRangeList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_global_bgp_ranges_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all global bgp ranges + + Returns all global bgp ranges for a project + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_global_bgp_ranges_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalBgpRangeList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_global_bgp_ranges_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/global-bgp-ranges', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_bgp_sessions( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpSessionList: + """Retrieve all BGP sessions for project + + Provides a listing of available BGP sessions for the project. + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_bgp_sessions_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSessionList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_bgp_sessions_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpSessionList]: + """Retrieve all BGP sessions for project + + Provides a listing of available BGP sessions for the project. + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_bgp_sessions_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSessionList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_bgp_sessions_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all BGP sessions for project + + Provides a listing of available BGP sessions for the project. + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_bgp_sessions_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSessionList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_bgp_sessions_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/bgp/sessions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def request_bgp_config( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + bgp_config_request_input: Annotated[BgpConfigRequestInput, Field(description="BGP config Request to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Requesting bgp config + + Requests to enable bgp configuration for a project. + + :param id: Project UUID (required) + :type id: str + :param bgp_config_request_input: BGP config Request to create (required) + :type bgp_config_request_input: BgpConfigRequestInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._request_bgp_config_serialize( + id=id, + bgp_config_request_input=bgp_config_request_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def request_bgp_config_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + bgp_config_request_input: Annotated[BgpConfigRequestInput, Field(description="BGP config Request to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Requesting bgp config + + Requests to enable bgp configuration for a project. + + :param id: Project UUID (required) + :type id: str + :param bgp_config_request_input: BGP config Request to create (required) + :type bgp_config_request_input: BgpConfigRequestInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._request_bgp_config_serialize( + id=id, + bgp_config_request_input=bgp_config_request_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def request_bgp_config_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + bgp_config_request_input: Annotated[BgpConfigRequestInput, Field(description="BGP config Request to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Requesting bgp config + + Requests to enable bgp configuration for a project. + + :param id: Project UUID (required) + :type id: str + :param bgp_config_request_input: BGP config Request to create (required) + :type bgp_config_request_input: BgpConfigRequestInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._request_bgp_config_serialize( + id=id, + bgp_config_request_input=bgp_config_request_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _request_bgp_config_serialize( + self, + id, + bgp_config_request_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if bgp_config_request_input is not None: + _body_params = bgp_config_request_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/bgp-configs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_bgp_session( + self, + id: Annotated[StrictStr, Field(description="BGP session UUID")], + body: Annotated[StrictBool, Field(description="Default route")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Update the BGP session + + Updates the BGP session by either enabling or disabling the default route functionality. + + :param id: BGP session UUID (required) + :type id: str + :param body: Default route (required) + :type body: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_bgp_session_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_bgp_session_with_http_info( + self, + id: Annotated[StrictStr, Field(description="BGP session UUID")], + body: Annotated[StrictBool, Field(description="Default route")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Update the BGP session + + Updates the BGP session by either enabling or disabling the default route functionality. + + :param id: BGP session UUID (required) + :type id: str + :param body: Default route (required) + :type body: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_bgp_session_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_bgp_session_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="BGP session UUID")], + body: Annotated[StrictBool, Field(description="Default route")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the BGP session + + Updates the BGP session by either enabling or disabling the default route functionality. + + :param id: BGP session UUID (required) + :type id: str + :param body: Default route (required) + :type body: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_bgp_session_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_bgp_session_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/bgp/sessions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/capacity_api.py b/equinix/services/metalv1/api/capacity_api.py new file mode 100644 index 00000000..2424431c --- /dev/null +++ b/equinix/services/metalv1/api/capacity_api.py @@ -0,0 +1,1605 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from equinix.services.metalv1.models.capacity_check_per_facility_list import CapacityCheckPerFacilityList +from equinix.services.metalv1.models.capacity_check_per_metro_list import CapacityCheckPerMetroList +from equinix.services.metalv1.models.capacity_input import CapacityInput +from equinix.services.metalv1.models.capacity_list import CapacityList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class CapacityApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def check_capacity_for_facility( + self, + capacity_input: Annotated[CapacityInput, Field(description="Facility to check capacity in")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CapacityCheckPerFacilityList: + """(Deprecated) Check capacity + + Validates if a deploy can be fulfilled. + + :param capacity_input: Facility to check capacity in (required) + :type capacity_input: CapacityInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /capacity is deprecated.", DeprecationWarning) + + _param = self._check_capacity_for_facility_serialize( + capacity_input=capacity_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityCheckPerFacilityList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def check_capacity_for_facility_with_http_info( + self, + capacity_input: Annotated[CapacityInput, Field(description="Facility to check capacity in")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CapacityCheckPerFacilityList]: + """(Deprecated) Check capacity + + Validates if a deploy can be fulfilled. + + :param capacity_input: Facility to check capacity in (required) + :type capacity_input: CapacityInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /capacity is deprecated.", DeprecationWarning) + + _param = self._check_capacity_for_facility_serialize( + capacity_input=capacity_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityCheckPerFacilityList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def check_capacity_for_facility_without_preload_content( + self, + capacity_input: Annotated[CapacityInput, Field(description="Facility to check capacity in")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Check capacity + + Validates if a deploy can be fulfilled. + + :param capacity_input: Facility to check capacity in (required) + :type capacity_input: CapacityInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /capacity is deprecated.", DeprecationWarning) + + _param = self._check_capacity_for_facility_serialize( + capacity_input=capacity_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityCheckPerFacilityList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _check_capacity_for_facility_serialize( + self, + capacity_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if capacity_input is not None: + _body_params = capacity_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/capacity', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def check_capacity_for_metro( + self, + capacity_input: Annotated[CapacityInput, Field(description="Metro to check capacity in")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CapacityCheckPerMetroList: + """Check capacity for a metro + + Validates if a deploy can be fulfilled in a metro. + + :param capacity_input: Metro to check capacity in (required) + :type capacity_input: CapacityInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._check_capacity_for_metro_serialize( + capacity_input=capacity_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityCheckPerMetroList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def check_capacity_for_metro_with_http_info( + self, + capacity_input: Annotated[CapacityInput, Field(description="Metro to check capacity in")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CapacityCheckPerMetroList]: + """Check capacity for a metro + + Validates if a deploy can be fulfilled in a metro. + + :param capacity_input: Metro to check capacity in (required) + :type capacity_input: CapacityInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._check_capacity_for_metro_serialize( + capacity_input=capacity_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityCheckPerMetroList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def check_capacity_for_metro_without_preload_content( + self, + capacity_input: Annotated[CapacityInput, Field(description="Metro to check capacity in")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Check capacity for a metro + + Validates if a deploy can be fulfilled in a metro. + + :param capacity_input: Metro to check capacity in (required) + :type capacity_input: CapacityInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._check_capacity_for_metro_serialize( + capacity_input=capacity_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityCheckPerMetroList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _check_capacity_for_metro_serialize( + self, + capacity_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if capacity_input is not None: + _body_params = capacity_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/capacity/metros', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_capacity_for_facility( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CapacityList: + """View capacity + + Returns a list of facilities and plans with their current capacity. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_capacity_for_facility_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_capacity_for_facility_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CapacityList]: + """View capacity + + Returns a list of facilities and plans with their current capacity. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_capacity_for_facility_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_capacity_for_facility_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """View capacity + + Returns a list of facilities and plans with their current capacity. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_capacity_for_facility_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_capacity_for_facility_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/capacity', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_capacity_for_metro( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CapacityList: + """View capacity for metros + + Returns a list of metros and plans with their current capacity. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_capacity_for_metro_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_capacity_for_metro_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CapacityList]: + """View capacity for metros + + Returns a list of metros and plans with their current capacity. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_capacity_for_metro_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_capacity_for_metro_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """View capacity for metros + + Returns a list of metros and plans with their current capacity. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_capacity_for_metro_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_capacity_for_metro_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/capacity/metros', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organization_capacity_per_facility( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CapacityList: + """View available hardware plans per Facility for given organization + + Returns a list of facilities and plans with their current capacity. + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_capacity_per_facility_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_capacity_per_facility_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CapacityList]: + """View available hardware plans per Facility for given organization + + Returns a list of facilities and plans with their current capacity. + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_capacity_per_facility_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_capacity_per_facility_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """View available hardware plans per Facility for given organization + + Returns a list of facilities and plans with their current capacity. + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_capacity_per_facility_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_capacity_per_facility_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/capacity', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organization_capacity_per_metro( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CapacityList: + """View available hardware plans per Metro for given organization + + Returns a list of metros and plans with their current capacity. + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_capacity_per_metro_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_capacity_per_metro_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CapacityList]: + """View available hardware plans per Metro for given organization + + Returns a list of metros and plans with their current capacity. + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_capacity_per_metro_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_capacity_per_metro_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """View available hardware plans per Metro for given organization + + Returns a list of metros and plans with their current capacity. + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_capacity_per_metro_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CapacityList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_capacity_per_metro_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/capacity/metros', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/console_log_details_api.py b/equinix/services/metalv1/api/console_log_details_api.py new file mode 100644 index 00000000..af7008e2 --- /dev/null +++ b/equinix/services/metalv1/api/console_log_details_api.py @@ -0,0 +1,302 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class ConsoleLogDetailsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def capture_screenshot( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """capture_screenshot + + Capture a screenshot from the device, if supported, via the BMC. + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._capture_screenshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '403': "Error", + '404': "Error", + '501': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def capture_screenshot_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """capture_screenshot + + Capture a screenshot from the device, if supported, via the BMC. + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._capture_screenshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '403': "Error", + '404': "Error", + '501': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def capture_screenshot_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """capture_screenshot + + Capture a screenshot from the device, if supported, via the BMC. + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._capture_screenshot_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytearray", + '403': "Error", + '404': "Error", + '501': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _capture_screenshot_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/jpeg', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/diagnostics/screenshot', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/devices_api.py b/equinix/services/metalv1/api/devices_api.py new file mode 100644 index 00000000..e6b21d76 --- /dev/null +++ b/equinix/services/metalv1/api/devices_api.py @@ -0,0 +1,6494 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.bgp_session_input import BGPSessionInput +from equinix.services.metalv1.models.bgp_session import BgpSession +from equinix.services.metalv1.models.bgp_session_list import BgpSessionList +from equinix.services.metalv1.models.bgp_session_neighbors import BgpSessionNeighbors +from equinix.services.metalv1.models.create_device_request import CreateDeviceRequest +from equinix.services.metalv1.models.device import Device +from equinix.services.metalv1.models.device_action_input import DeviceActionInput +from equinix.services.metalv1.models.device_health_rollup import DeviceHealthRollup +from equinix.services.metalv1.models.device_list import DeviceList +from equinix.services.metalv1.models.device_update_input import DeviceUpdateInput +from equinix.services.metalv1.models.find_traffic_timeframe_parameter import FindTrafficTimeframeParameter +from equinix.services.metalv1.models.firmware_set_response import FirmwareSetResponse +from equinix.services.metalv1.models.ip_assignment import IPAssignment +from equinix.services.metalv1.models.ip_assignment_input import IPAssignmentInput +from equinix.services.metalv1.models.ip_assignment_list import IPAssignmentList +from equinix.services.metalv1.models.metadata import Metadata +from equinix.services.metalv1.models.userdata import Userdata + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class DevicesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_bgp_session( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + bgp_session_input: Annotated[BGPSessionInput, Field(description="BGP session to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpSession: + """Create a BGP session + + Creates a BGP session. + + :param id: Device UUID (required) + :type id: str + :param bgp_session_input: BGP session to create (required) + :type bgp_session_input: BGPSessionInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bgp_session_serialize( + id=id, + bgp_session_input=bgp_session_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BgpSession", + '401': "Error", + '403': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_bgp_session_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + bgp_session_input: Annotated[BGPSessionInput, Field(description="BGP session to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpSession]: + """Create a BGP session + + Creates a BGP session. + + :param id: Device UUID (required) + :type id: str + :param bgp_session_input: BGP session to create (required) + :type bgp_session_input: BGPSessionInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bgp_session_serialize( + id=id, + bgp_session_input=bgp_session_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BgpSession", + '401': "Error", + '403': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_bgp_session_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + bgp_session_input: Annotated[BGPSessionInput, Field(description="BGP session to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a BGP session + + Creates a BGP session. + + :param id: Device UUID (required) + :type id: str + :param bgp_session_input: BGP session to create (required) + :type bgp_session_input: BGPSessionInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bgp_session_serialize( + id=id, + bgp_session_input=bgp_session_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BgpSession", + '401': "Error", + '403': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_bgp_session_serialize( + self, + id, + bgp_session_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if bgp_session_input is not None: + _body_params = bgp_session_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/devices/{id}/bgp/sessions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_device( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + create_device_request: Annotated[CreateDeviceRequest, Field(description="Device to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Device: + """Create a device + + Creates a new device and provisions it in the specified location. Device type-specific options are accepted. For example, `baremetal` devices accept `operating_system`, `hostname`, and `plan`. These parameters may not be accepted for other device types. The default device type is `baremetal`. + + :param id: Project UUID (required) + :type id: str + :param create_device_request: Device to create (required) + :type create_device_request: CreateDeviceRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_device_serialize( + id=id, + create_device_request=create_device_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Device", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_device_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + create_device_request: Annotated[CreateDeviceRequest, Field(description="Device to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Device]: + """Create a device + + Creates a new device and provisions it in the specified location. Device type-specific options are accepted. For example, `baremetal` devices accept `operating_system`, `hostname`, and `plan`. These parameters may not be accepted for other device types. The default device type is `baremetal`. + + :param id: Project UUID (required) + :type id: str + :param create_device_request: Device to create (required) + :type create_device_request: CreateDeviceRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_device_serialize( + id=id, + create_device_request=create_device_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Device", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_device_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + create_device_request: Annotated[CreateDeviceRequest, Field(description="Device to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a device + + Creates a new device and provisions it in the specified location. Device type-specific options are accepted. For example, `baremetal` devices accept `operating_system`, `hostname`, and `plan`. These parameters may not be accepted for other device types. The default device type is `baremetal`. + + :param id: Project UUID (required) + :type id: str + :param create_device_request: Device to create (required) + :type create_device_request: CreateDeviceRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_device_serialize( + id=id, + create_device_request=create_device_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Device", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_device_serialize( + self, + id, + create_device_request, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if create_device_request is not None: + _body_params = create_device_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/devices', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_ip_assignment( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + ip_assignment_input: Annotated[IPAssignmentInput, Field(description="IPAssignment to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IPAssignment: + """Create an ip assignment + + Creates an ip assignment for a device. + + :param id: Device UUID (required) + :type id: str + :param ip_assignment_input: IPAssignment to create (required) + :type ip_assignment_input: IPAssignmentInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ip_assignment_serialize( + id=id, + ip_assignment_input=ip_assignment_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "IPAssignment", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_ip_assignment_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + ip_assignment_input: Annotated[IPAssignmentInput, Field(description="IPAssignment to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IPAssignment]: + """Create an ip assignment + + Creates an ip assignment for a device. + + :param id: Device UUID (required) + :type id: str + :param ip_assignment_input: IPAssignment to create (required) + :type ip_assignment_input: IPAssignmentInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ip_assignment_serialize( + id=id, + ip_assignment_input=ip_assignment_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "IPAssignment", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_ip_assignment_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + ip_assignment_input: Annotated[IPAssignmentInput, Field(description="IPAssignment to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an ip assignment + + Creates an ip assignment for a device. + + :param id: Device UUID (required) + :type id: str + :param ip_assignment_input: IPAssignment to create (required) + :type ip_assignment_input: IPAssignmentInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ip_assignment_serialize( + id=id, + ip_assignment_input=ip_assignment_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "IPAssignment", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_ip_assignment_serialize( + self, + id, + ip_assignment_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if ip_assignment_input is not None: + _body_params = ip_assignment_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/devices/{id}/ips', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_device( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + force_delete: Annotated[Optional[StrictBool], Field(description="Force the deletion of the device, by detaching any storage volume still active.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the device + + Deletes a device and deprovisions it in our datacenter. + + :param id: Device UUID (required) + :type id: str + :param force_delete: Force the deletion of the device, by detaching any storage volume still active. + :type force_delete: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_device_serialize( + id=id, + force_delete=force_delete, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_device_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + force_delete: Annotated[Optional[StrictBool], Field(description="Force the deletion of the device, by detaching any storage volume still active.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the device + + Deletes a device and deprovisions it in our datacenter. + + :param id: Device UUID (required) + :type id: str + :param force_delete: Force the deletion of the device, by detaching any storage volume still active. + :type force_delete: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_device_serialize( + id=id, + force_delete=force_delete, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_device_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + force_delete: Annotated[Optional[StrictBool], Field(description="Force the deletion of the device, by detaching any storage volume still active.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the device + + Deletes a device and deprovisions it in our datacenter. + + :param id: Device UUID (required) + :type id: str + :param force_delete: Force the deletion of the device, by detaching any storage volume still active. + :type force_delete: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_device_serialize( + id=id, + force_delete=force_delete, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_device_serialize( + self, + id, + force_delete, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if force_delete is not None: + + _query_params.append(('force_delete', force_delete)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/devices/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_bgp_sessions( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpSessionList: + """Retrieve all BGP sessions + + Provides a listing of available BGP sessions for the device. + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_bgp_sessions_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSessionList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_bgp_sessions_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpSessionList]: + """Retrieve all BGP sessions + + Provides a listing of available BGP sessions for the device. + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_bgp_sessions_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSessionList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_bgp_sessions_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all BGP sessions + + Provides a listing of available BGP sessions for the device. + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_bgp_sessions_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSessionList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_bgp_sessions_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/bgp/sessions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_device_by_id( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Device: + """Retrieve a device + + Type-specific options (such as facility for baremetal devices) will be included as part of the main data structure. State value can be one of: active inactive queued or provisioning + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_device_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Device]: + """Retrieve a device + + Type-specific options (such as facility for baremetal devices) will be included as part of the main data structure. State value can be one of: active inactive queued or provisioning + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_device_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a device + + Type-specific options (such as facility for baremetal devices) will be included as part of the main data structure. State value can be one of: active inactive queued or provisioning + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_device_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_device_customdata( + self, + id: Annotated[StrictStr, Field(description="Instance UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Retrieve the custom metadata of an instance + + Provides the custom metadata stored for this instance in json format + + :param id: Instance UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_device_customdata_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Instance UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Retrieve the custom metadata of an instance + + Provides the custom metadata stored for this instance in json format + + :param id: Instance UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_device_customdata_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Instance UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the custom metadata of an instance + + Provides the custom metadata stored for this instance in json format + + :param id: Instance UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_device_customdata_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/customdata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_device_metadata_by_id( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Metadata: + """Retrieve metadata + + Retrieve device metadata + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_metadata_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Metadata", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_device_metadata_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Metadata]: + """Retrieve metadata + + Retrieve device metadata + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_metadata_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Metadata", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_device_metadata_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve metadata + + Retrieve device metadata + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_metadata_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Metadata", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_device_metadata_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/metadata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_device_userdata_by_id( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Userdata: + """Retrieve userdata + + Retrieve device userdata + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_userdata_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Userdata", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_device_userdata_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Userdata]: + """Retrieve userdata + + Retrieve device userdata + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_userdata_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Userdata", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_device_userdata_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve userdata + + Retrieve device userdata + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_userdata_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Userdata", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_device_userdata_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/userdata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_instance_bandwidth( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + var_from: Annotated[StrictStr, Field(description="Timestamp from range")], + until: Annotated[StrictStr, Field(description="Timestamp to range")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Retrieve an instance bandwidth + + Retrieve an instance bandwidth for a given period of time. + + :param id: Device UUID (required) + :type id: str + :param var_from: Timestamp from range (required) + :type var_from: str + :param until: Timestamp to range (required) + :type until: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_instance_bandwidth_serialize( + id=id, + var_from=var_from, + until=until, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_instance_bandwidth_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + var_from: Annotated[StrictStr, Field(description="Timestamp from range")], + until: Annotated[StrictStr, Field(description="Timestamp to range")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Retrieve an instance bandwidth + + Retrieve an instance bandwidth for a given period of time. + + :param id: Device UUID (required) + :type id: str + :param var_from: Timestamp from range (required) + :type var_from: str + :param until: Timestamp to range (required) + :type until: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_instance_bandwidth_serialize( + id=id, + var_from=var_from, + until=until, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_instance_bandwidth_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + var_from: Annotated[StrictStr, Field(description="Timestamp from range")], + until: Annotated[StrictStr, Field(description="Timestamp to range")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve an instance bandwidth + + Retrieve an instance bandwidth for a given period of time. + + :param id: Device UUID (required) + :type id: str + :param var_from: Timestamp from range (required) + :type var_from: str + :param until: Timestamp to range (required) + :type until: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_instance_bandwidth_serialize( + id=id, + var_from=var_from, + until=until, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_instance_bandwidth_serialize( + self, + id, + var_from, + until, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if var_from is not None: + + _query_params.append(('from', var_from)) + + if until is not None: + + _query_params.append(('until', until)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/bandwidth', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_ip_assignment_customdata( + self, + instance_id: Annotated[StrictStr, Field(description="Instance UUID")], + id: Annotated[StrictStr, Field(description="Ip Assignment UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Retrieve the custom metadata of an IP Assignment + + Provides the custom metadata stored for this IP Assignment in json format + + :param instance_id: Instance UUID (required) + :type instance_id: str + :param id: Ip Assignment UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_assignment_customdata_serialize( + instance_id=instance_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_ip_assignment_customdata_with_http_info( + self, + instance_id: Annotated[StrictStr, Field(description="Instance UUID")], + id: Annotated[StrictStr, Field(description="Ip Assignment UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Retrieve the custom metadata of an IP Assignment + + Provides the custom metadata stored for this IP Assignment in json format + + :param instance_id: Instance UUID (required) + :type instance_id: str + :param id: Ip Assignment UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_assignment_customdata_serialize( + instance_id=instance_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_ip_assignment_customdata_without_preload_content( + self, + instance_id: Annotated[StrictStr, Field(description="Instance UUID")], + id: Annotated[StrictStr, Field(description="Ip Assignment UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the custom metadata of an IP Assignment + + Provides the custom metadata stored for this IP Assignment in json format + + :param instance_id: Instance UUID (required) + :type instance_id: str + :param id: Ip Assignment UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_assignment_customdata_serialize( + instance_id=instance_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_ip_assignment_customdata_serialize( + self, + instance_id, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instance_id'] = instance_id + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{instance_id}/ips/{id}/customdata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_ip_assignments( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IPAssignmentList: + """Retrieve all ip assignments + + Returns all ip assignments for a device. + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_assignments_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPAssignmentList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_ip_assignments_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IPAssignmentList]: + """Retrieve all ip assignments + + Returns all ip assignments for a device. + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_assignments_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPAssignmentList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_ip_assignments_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all ip assignments + + Returns all ip assignments for a device. + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_assignments_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPAssignmentList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_ip_assignments_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/ips', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organization_devices_all_pages(self, id : Annotated[StrictStr, Field(description="Organization UUID")], search : Annotated[Optional[StrictStr], Field(description="Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses.")] = None, categories : Annotated[Optional[List[StrictStr]], Field(description="Filter by plan category")] = None, facility : Annotated[Optional[StrictStr], Field(description="Filter by device facility")] = None, hostname : Annotated[Optional[StrictStr], Field(description="Filter by partial hostname")] = None, reserved : Annotated[Optional[StrictBool], Field(description="Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances.")] = None, tag : Annotated[Optional[StrictStr], Field(description="Filter by device tag")] = None, type : Annotated[Optional[StrictStr], Field(description="Filter by instance type (ondemand,spot,reserved)")] = None, has_termination_time : Annotated[Optional[StrictBool], Field(description="Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time.")] = None, mac_address : Annotated[Optional[StrictStr], Field(description="Filter by MAC address")] = None, include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> DeviceList: # noqa: E501 + """Retrieve all devices of an organization # noqa: E501 + + This method is the same as find_organization_devices, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_organization_devices(}id, , }search, , }categories, , }facility, , }hostname, , }reserved, , }tag, , }type, , }has_termination_time, , }mac_address, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param id: Organization UUID (required) + :type id: str + + :param search: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. + :type search: str + + :param categories: Filter by plan category + :type categories: List[str] + + :param facility: Filter by device facility + :type facility: str + + :param hostname: Filter by partial hostname + :type hostname: str + + :param reserved: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + :type reserved: bool + + :param tag: Filter by device tag + :type tag: str + + :param type: Filter by instance type (ondemand,spot,reserved) + :type type: str + + :param has_termination_time: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + :type has_termination_time: bool + + :param mac_address: Filter by MAC address + :type mac_address: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: DeviceList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_organization_devices(id, search, categories, facility, hostname, reserved, tag, type, has_termination_time, mac_address, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.devices.extend(page_response.devices) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_organization_devices( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + search: Annotated[Optional[StrictStr], Field(description="Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses.")] = None, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter by plan category")] = None, + facility: Annotated[Optional[StrictStr], Field(description="Filter by device facility")] = None, + hostname: Annotated[Optional[StrictStr], Field(description="Filter by partial hostname")] = None, + reserved: Annotated[Optional[StrictBool], Field(description="Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances.")] = None, + tag: Annotated[Optional[StrictStr], Field(description="Filter by device tag")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter by instance type (ondemand,spot,reserved)")] = None, + has_termination_time: Annotated[Optional[StrictBool], Field(description="Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time.")] = None, + mac_address: Annotated[Optional[StrictStr], Field(description="Filter by MAC address")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DeviceList: + """Retrieve all devices of an organization + + Provides a collection of devices for a given organization. + + :param id: Organization UUID (required) + :type id: str + :param search: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. + :type search: str + :param categories: Filter by plan category + :type categories: List[str] + :param facility: Filter by device facility + :type facility: str + :param hostname: Filter by partial hostname + :type hostname: str + :param reserved: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + :type reserved: bool + :param tag: Filter by device tag + :type tag: str + :param type: Filter by instance type (ondemand,spot,reserved) + :type type: str + :param has_termination_time: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + :type has_termination_time: bool + :param mac_address: Filter by MAC address + :type mac_address: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_devices_serialize( + id=id, + search=search, + categories=categories, + facility=facility, + hostname=hostname, + reserved=reserved, + tag=tag, + type=type, + has_termination_time=has_termination_time, + mac_address=mac_address, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_devices_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + search: Annotated[Optional[StrictStr], Field(description="Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses.")] = None, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter by plan category")] = None, + facility: Annotated[Optional[StrictStr], Field(description="Filter by device facility")] = None, + hostname: Annotated[Optional[StrictStr], Field(description="Filter by partial hostname")] = None, + reserved: Annotated[Optional[StrictBool], Field(description="Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances.")] = None, + tag: Annotated[Optional[StrictStr], Field(description="Filter by device tag")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter by instance type (ondemand,spot,reserved)")] = None, + has_termination_time: Annotated[Optional[StrictBool], Field(description="Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time.")] = None, + mac_address: Annotated[Optional[StrictStr], Field(description="Filter by MAC address")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DeviceList]: + """Retrieve all devices of an organization + + Provides a collection of devices for a given organization. + + :param id: Organization UUID (required) + :type id: str + :param search: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. + :type search: str + :param categories: Filter by plan category + :type categories: List[str] + :param facility: Filter by device facility + :type facility: str + :param hostname: Filter by partial hostname + :type hostname: str + :param reserved: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + :type reserved: bool + :param tag: Filter by device tag + :type tag: str + :param type: Filter by instance type (ondemand,spot,reserved) + :type type: str + :param has_termination_time: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + :type has_termination_time: bool + :param mac_address: Filter by MAC address + :type mac_address: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_devices_serialize( + id=id, + search=search, + categories=categories, + facility=facility, + hostname=hostname, + reserved=reserved, + tag=tag, + type=type, + has_termination_time=has_termination_time, + mac_address=mac_address, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_devices_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + search: Annotated[Optional[StrictStr], Field(description="Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses.")] = None, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter by plan category")] = None, + facility: Annotated[Optional[StrictStr], Field(description="Filter by device facility")] = None, + hostname: Annotated[Optional[StrictStr], Field(description="Filter by partial hostname")] = None, + reserved: Annotated[Optional[StrictBool], Field(description="Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances.")] = None, + tag: Annotated[Optional[StrictStr], Field(description="Filter by device tag")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter by instance type (ondemand,spot,reserved)")] = None, + has_termination_time: Annotated[Optional[StrictBool], Field(description="Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time.")] = None, + mac_address: Annotated[Optional[StrictStr], Field(description="Filter by MAC address")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all devices of an organization + + Provides a collection of devices for a given organization. + + :param id: Organization UUID (required) + :type id: str + :param search: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. + :type search: str + :param categories: Filter by plan category + :type categories: List[str] + :param facility: Filter by device facility + :type facility: str + :param hostname: Filter by partial hostname + :type hostname: str + :param reserved: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + :type reserved: bool + :param tag: Filter by device tag + :type tag: str + :param type: Filter by instance type (ondemand,spot,reserved) + :type type: str + :param has_termination_time: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + :type has_termination_time: bool + :param mac_address: Filter by MAC address + :type mac_address: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_devices_serialize( + id=id, + search=search, + categories=categories, + facility=facility, + hostname=hostname, + reserved=reserved, + tag=tag, + type=type, + has_termination_time=has_termination_time, + mac_address=mac_address, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_devices_serialize( + self, + id, + search, + categories, + facility, + hostname, + reserved, + tag, + type, + has_termination_time, + mac_address, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'categories': 'multi', + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if categories is not None: + + _query_params.append(('categories', categories)) + + if facility is not None: + + _query_params.append(('facility', facility)) + + if hostname is not None: + + _query_params.append(('hostname', hostname)) + + if reserved is not None: + + _query_params.append(('reserved', reserved)) + + if tag is not None: + + _query_params.append(('tag', tag)) + + if type is not None: + + _query_params.append(('type', type)) + + if has_termination_time is not None: + + _query_params.append(('has_termination_time', has_termination_time)) + + if mac_address is not None: + + _query_params.append(('mac_address', mac_address)) + + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/devices', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_devices_all_pages(self, id : Annotated[StrictStr, Field(description="Project UUID")], search : Annotated[Optional[StrictStr], Field(description="Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses.")] = None, categories : Annotated[Optional[List[StrictStr]], Field(description="Filter by plan category")] = None, facility : Annotated[Optional[StrictStr], Field(description="Filter by device facility")] = None, metro : Annotated[Optional[StrictStr], Field(description="Filter by device metro")] = None, hostname : Annotated[Optional[StrictStr], Field(description="Filter by partial hostname")] = None, reserved : Annotated[Optional[StrictBool], Field(description="Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances.")] = None, tag : Annotated[Optional[StrictStr], Field(description="Filter by device tag")] = None, type : Annotated[Optional[StrictStr], Field(description="Filter by instance type (ondemand,spot,reserved)")] = None, has_termination_time : Annotated[Optional[StrictBool], Field(description="Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time.")] = None, mac_address : Annotated[Optional[StrictStr], Field(description="Filter by MAC address")] = None, include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> DeviceList: # noqa: E501 + """Retrieve all devices of a project # noqa: E501 + + This method is the same as find_project_devices, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_project_devices(}id, , }search, , }categories, , }facility, , }metro, , }hostname, , }reserved, , }tag, , }type, , }has_termination_time, , }mac_address, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param id: Project UUID (required) + :type id: str + + :param search: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. + :type search: str + + :param categories: Filter by plan category + :type categories: List[str] + + :param facility: Filter by device facility + :type facility: str + + :param metro: Filter by device metro + :type metro: str + + :param hostname: Filter by partial hostname + :type hostname: str + + :param reserved: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + :type reserved: bool + + :param tag: Filter by device tag + :type tag: str + + :param type: Filter by instance type (ondemand,spot,reserved) + :type type: str + + :param has_termination_time: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + :type has_termination_time: bool + + :param mac_address: Filter by MAC address + :type mac_address: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: DeviceList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_project_devices(id, search, categories, facility, metro, hostname, reserved, tag, type, has_termination_time, mac_address, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.devices.extend(page_response.devices) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_project_devices( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + search: Annotated[Optional[StrictStr], Field(description="Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses.")] = None, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter by plan category")] = None, + facility: Annotated[Optional[StrictStr], Field(description="Filter by device facility")] = None, + metro: Annotated[Optional[StrictStr], Field(description="Filter by device metro")] = None, + hostname: Annotated[Optional[StrictStr], Field(description="Filter by partial hostname")] = None, + reserved: Annotated[Optional[StrictBool], Field(description="Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances.")] = None, + tag: Annotated[Optional[StrictStr], Field(description="Filter by device tag")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter by instance type (ondemand,spot,reserved)")] = None, + has_termination_time: Annotated[Optional[StrictBool], Field(description="Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time.")] = None, + mac_address: Annotated[Optional[StrictStr], Field(description="Filter by MAC address")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DeviceList: + """Retrieve all devices of a project + + Provides a collection of devices for a given project. + + :param id: Project UUID (required) + :type id: str + :param search: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. + :type search: str + :param categories: Filter by plan category + :type categories: List[str] + :param facility: Filter by device facility + :type facility: str + :param metro: Filter by device metro + :type metro: str + :param hostname: Filter by partial hostname + :type hostname: str + :param reserved: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + :type reserved: bool + :param tag: Filter by device tag + :type tag: str + :param type: Filter by instance type (ondemand,spot,reserved) + :type type: str + :param has_termination_time: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + :type has_termination_time: bool + :param mac_address: Filter by MAC address + :type mac_address: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_devices_serialize( + id=id, + search=search, + categories=categories, + facility=facility, + metro=metro, + hostname=hostname, + reserved=reserved, + tag=tag, + type=type, + has_termination_time=has_termination_time, + mac_address=mac_address, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_devices_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + search: Annotated[Optional[StrictStr], Field(description="Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses.")] = None, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter by plan category")] = None, + facility: Annotated[Optional[StrictStr], Field(description="Filter by device facility")] = None, + metro: Annotated[Optional[StrictStr], Field(description="Filter by device metro")] = None, + hostname: Annotated[Optional[StrictStr], Field(description="Filter by partial hostname")] = None, + reserved: Annotated[Optional[StrictBool], Field(description="Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances.")] = None, + tag: Annotated[Optional[StrictStr], Field(description="Filter by device tag")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter by instance type (ondemand,spot,reserved)")] = None, + has_termination_time: Annotated[Optional[StrictBool], Field(description="Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time.")] = None, + mac_address: Annotated[Optional[StrictStr], Field(description="Filter by MAC address")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DeviceList]: + """Retrieve all devices of a project + + Provides a collection of devices for a given project. + + :param id: Project UUID (required) + :type id: str + :param search: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. + :type search: str + :param categories: Filter by plan category + :type categories: List[str] + :param facility: Filter by device facility + :type facility: str + :param metro: Filter by device metro + :type metro: str + :param hostname: Filter by partial hostname + :type hostname: str + :param reserved: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + :type reserved: bool + :param tag: Filter by device tag + :type tag: str + :param type: Filter by instance type (ondemand,spot,reserved) + :type type: str + :param has_termination_time: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + :type has_termination_time: bool + :param mac_address: Filter by MAC address + :type mac_address: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_devices_serialize( + id=id, + search=search, + categories=categories, + facility=facility, + metro=metro, + hostname=hostname, + reserved=reserved, + tag=tag, + type=type, + has_termination_time=has_termination_time, + mac_address=mac_address, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_devices_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + search: Annotated[Optional[StrictStr], Field(description="Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses.")] = None, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter by plan category")] = None, + facility: Annotated[Optional[StrictStr], Field(description="Filter by device facility")] = None, + metro: Annotated[Optional[StrictStr], Field(description="Filter by device metro")] = None, + hostname: Annotated[Optional[StrictStr], Field(description="Filter by partial hostname")] = None, + reserved: Annotated[Optional[StrictBool], Field(description="Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances.")] = None, + tag: Annotated[Optional[StrictStr], Field(description="Filter by device tag")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter by instance type (ondemand,spot,reserved)")] = None, + has_termination_time: Annotated[Optional[StrictBool], Field(description="Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time.")] = None, + mac_address: Annotated[Optional[StrictStr], Field(description="Filter by MAC address")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all devices of a project + + Provides a collection of devices for a given project. + + :param id: Project UUID (required) + :type id: str + :param search: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. + :type search: str + :param categories: Filter by plan category + :type categories: List[str] + :param facility: Filter by device facility + :type facility: str + :param metro: Filter by device metro + :type metro: str + :param hostname: Filter by partial hostname + :type hostname: str + :param reserved: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + :type reserved: bool + :param tag: Filter by device tag + :type tag: str + :param type: Filter by instance type (ondemand,spot,reserved) + :type type: str + :param has_termination_time: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + :type has_termination_time: bool + :param mac_address: Filter by MAC address + :type mac_address: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_devices_serialize( + id=id, + search=search, + categories=categories, + facility=facility, + metro=metro, + hostname=hostname, + reserved=reserved, + tag=tag, + type=type, + has_termination_time=has_termination_time, + mac_address=mac_address, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_devices_serialize( + self, + id, + search, + categories, + facility, + metro, + hostname, + reserved, + tag, + type, + has_termination_time, + mac_address, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'categories': 'multi', + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if categories is not None: + + _query_params.append(('categories', categories)) + + if facility is not None: + + _query_params.append(('facility', facility)) + + if metro is not None: + + _query_params.append(('metro', metro)) + + if hostname is not None: + + _query_params.append(('hostname', hostname)) + + if reserved is not None: + + _query_params.append(('reserved', reserved)) + + if tag is not None: + + _query_params.append(('tag', tag)) + + if type is not None: + + _query_params.append(('type', type)) + + if has_termination_time is not None: + + _query_params.append(('has_termination_time', has_termination_time)) + + if mac_address is not None: + + _query_params.append(('mac_address', mac_address)) + + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/devices', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_traffic( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + direction: Annotated[StrictStr, Field(description="Traffic direction")], + interval: Annotated[Optional[StrictStr], Field(description="Traffic interval")] = None, + bucket: Annotated[Optional[StrictStr], Field(description="Traffic bucket")] = None, + timeframe: Optional[FindTrafficTimeframeParameter] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Retrieve device traffic + + Returns the total amount of inbound or outbound traffic for a specific device. The default time period is 1 hour. Please note the results capture all network traffic for the server, but not all traffic may come from or be destined to the Internet and may be non-billable. Only Internet bound traffic is charged. + + :param id: Device UUID (required) + :type id: str + :param direction: Traffic direction (required) + :type direction: str + :param interval: Traffic interval + :type interval: str + :param bucket: Traffic bucket + :type bucket: str + :param timeframe: + :type timeframe: FindTrafficTimeframeParameter + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_traffic_serialize( + id=id, + direction=direction, + interval=interval, + bucket=bucket, + timeframe=timeframe, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_traffic_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + direction: Annotated[StrictStr, Field(description="Traffic direction")], + interval: Annotated[Optional[StrictStr], Field(description="Traffic interval")] = None, + bucket: Annotated[Optional[StrictStr], Field(description="Traffic bucket")] = None, + timeframe: Optional[FindTrafficTimeframeParameter] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Retrieve device traffic + + Returns the total amount of inbound or outbound traffic for a specific device. The default time period is 1 hour. Please note the results capture all network traffic for the server, but not all traffic may come from or be destined to the Internet and may be non-billable. Only Internet bound traffic is charged. + + :param id: Device UUID (required) + :type id: str + :param direction: Traffic direction (required) + :type direction: str + :param interval: Traffic interval + :type interval: str + :param bucket: Traffic bucket + :type bucket: str + :param timeframe: + :type timeframe: FindTrafficTimeframeParameter + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_traffic_serialize( + id=id, + direction=direction, + interval=interval, + bucket=bucket, + timeframe=timeframe, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_traffic_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + direction: Annotated[StrictStr, Field(description="Traffic direction")], + interval: Annotated[Optional[StrictStr], Field(description="Traffic interval")] = None, + bucket: Annotated[Optional[StrictStr], Field(description="Traffic bucket")] = None, + timeframe: Optional[FindTrafficTimeframeParameter] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve device traffic + + Returns the total amount of inbound or outbound traffic for a specific device. The default time period is 1 hour. Please note the results capture all network traffic for the server, but not all traffic may come from or be destined to the Internet and may be non-billable. Only Internet bound traffic is charged. + + :param id: Device UUID (required) + :type id: str + :param direction: Traffic direction (required) + :type direction: str + :param interval: Traffic interval + :type interval: str + :param bucket: Traffic bucket + :type bucket: str + :param timeframe: + :type timeframe: FindTrafficTimeframeParameter + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_traffic_serialize( + id=id, + direction=direction, + interval=interval, + bucket=bucket, + timeframe=timeframe, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_traffic_serialize( + self, + id, + direction, + interval, + bucket, + timeframe, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if direction is not None: + + _query_params.append(('direction', direction)) + + if interval is not None: + + _query_params.append(('interval', interval)) + + if bucket is not None: + + _query_params.append(('bucket', bucket)) + + if timeframe is not None: + + _query_params.append(('timeframe', timeframe)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/traffic', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_bgp_neighbor_data( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpSessionNeighbors: + """Retrieve BGP neighbor data for this device + + Provides a summary of the BGP neighbor data associated to the BGP sessions for this device. + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_neighbor_data_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSessionNeighbors", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_bgp_neighbor_data_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpSessionNeighbors]: + """Retrieve BGP neighbor data for this device + + Provides a summary of the BGP neighbor data associated to the BGP sessions for this device. + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_neighbor_data_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSessionNeighbors", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_bgp_neighbor_data_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve BGP neighbor data for this device + + Provides a summary of the BGP neighbor data associated to the BGP sessions for this device. + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_neighbor_data_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpSessionNeighbors", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bgp_neighbor_data_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/bgp/neighbors', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_device_firmware_sets( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FirmwareSetResponse: + """Get Device's associated Firmware Set + + Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_firmware_sets_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FirmwareSetResponse", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_device_firmware_sets_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FirmwareSetResponse]: + """Get Device's associated Firmware Set + + Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_firmware_sets_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FirmwareSetResponse", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_device_firmware_sets_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Device's associated Firmware Set + + Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_firmware_sets_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FirmwareSetResponse", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_device_firmware_sets_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/firmware-sets', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_device_health_rollup( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DeviceHealthRollup: + """Get Device's Health Status + + Returns the health rollup status of the device. + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_health_rollup_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceHealthRollup", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_device_health_rollup_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DeviceHealthRollup]: + """Get Device's Health Status + + Returns the health rollup status of the device. + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_health_rollup_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceHealthRollup", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_device_health_rollup_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Device's Health Status + + Returns the health rollup status of the device. + + :param id: Device UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_health_rollup_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceHealthRollup", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_device_health_rollup_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/diagnostics/health/rollup', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def perform_action( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + device_action_input: Annotated[DeviceActionInput, Field(description="Action to perform")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Perform an action + + Performs an action for the given device. Possible actions include: power_on, power_off, reboot, reinstall, and rescue (reboot the device into rescue OS.) + + :param id: Device UUID (required) + :type id: str + :param device_action_input: Action to perform (required) + :type device_action_input: DeviceActionInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._perform_action_serialize( + id=id, + device_action_input=device_action_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def perform_action_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + device_action_input: Annotated[DeviceActionInput, Field(description="Action to perform")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Perform an action + + Performs an action for the given device. Possible actions include: power_on, power_off, reboot, reinstall, and rescue (reboot the device into rescue OS.) + + :param id: Device UUID (required) + :type id: str + :param device_action_input: Action to perform (required) + :type device_action_input: DeviceActionInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._perform_action_serialize( + id=id, + device_action_input=device_action_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def perform_action_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + device_action_input: Annotated[DeviceActionInput, Field(description="Action to perform")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Perform an action + + Performs an action for the given device. Possible actions include: power_on, power_off, reboot, reinstall, and rescue (reboot the device into rescue OS.) + + :param id: Device UUID (required) + :type id: str + :param device_action_input: Action to perform (required) + :type device_action_input: DeviceActionInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._perform_action_serialize( + id=id, + device_action_input=device_action_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _perform_action_serialize( + self, + id, + device_action_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if device_action_input is not None: + _body_params = device_action_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/devices/{id}/actions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_device( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + device_update_input: Annotated[DeviceUpdateInput, Field(description="Device to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Device: + """Update the device + + Updates the device. + + :param id: Device UUID (required) + :type id: str + :param device_update_input: Device to update (required) + :type device_update_input: DeviceUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_device_serialize( + id=id, + device_update_input=device_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_device_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + device_update_input: Annotated[DeviceUpdateInput, Field(description="Device to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Device]: + """Update the device + + Updates the device. + + :param id: Device UUID (required) + :type id: str + :param device_update_input: Device to update (required) + :type device_update_input: DeviceUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_device_serialize( + id=id, + device_update_input=device_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_device_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + device_update_input: Annotated[DeviceUpdateInput, Field(description="Device to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the device + + Updates the device. + + :param id: Device UUID (required) + :type id: str + :param device_update_input: Device to update (required) + :type device_update_input: DeviceUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_device_serialize( + id=id, + device_update_input=device_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Device", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_device_serialize( + self, + id, + device_update_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if device_update_input is not None: + _body_params = device_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/devices/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/emails_api.py b/equinix/services/metalv1/api/emails_api.py new file mode 100644 index 00000000..2d6aea66 --- /dev/null +++ b/equinix/services/metalv1/api/emails_api.py @@ -0,0 +1,1143 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from equinix.services.metalv1.models.create_email_input import CreateEmailInput +from equinix.services.metalv1.models.email import Email +from equinix.services.metalv1.models.update_email_input import UpdateEmailInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class EmailsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_email( + self, + create_email_input: Annotated[CreateEmailInput, Field(description="Email to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Email: + """(Deprecated) Create an email + + Add a new email address to the current user. + + :param create_email_input: Email to create (required) + :type create_email_input: CreateEmailInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /emails is deprecated.", DeprecationWarning) + + _param = self._create_email_serialize( + create_email_input=create_email_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Email", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_email_with_http_info( + self, + create_email_input: Annotated[CreateEmailInput, Field(description="Email to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Email]: + """(Deprecated) Create an email + + Add a new email address to the current user. + + :param create_email_input: Email to create (required) + :type create_email_input: CreateEmailInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /emails is deprecated.", DeprecationWarning) + + _param = self._create_email_serialize( + create_email_input=create_email_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Email", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_email_without_preload_content( + self, + create_email_input: Annotated[CreateEmailInput, Field(description="Email to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Create an email + + Add a new email address to the current user. + + :param create_email_input: Email to create (required) + :type create_email_input: CreateEmailInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /emails is deprecated.", DeprecationWarning) + + _param = self._create_email_serialize( + create_email_input=create_email_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Email", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_email_serialize( + self, + create_email_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_email_input is not None: + _body_params = create_email_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/emails', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_email( + self, + id: Annotated[StrictStr, Field(description="Email UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the email + + Deletes the email. + + :param id: Email UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_email_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_email_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Email UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the email + + Deletes the email. + + :param id: Email UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_email_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_email_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Email UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the email + + Deletes the email. + + :param id: Email UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_email_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_email_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/emails/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_email_by_id( + self, + id: Annotated[StrictStr, Field(description="Email UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Email: + """Retrieve an email + + Provides one of the user’s emails. + + :param id: Email UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_email_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Email", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_email_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Email UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Email]: + """Retrieve an email + + Provides one of the user’s emails. + + :param id: Email UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_email_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Email", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_email_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Email UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve an email + + Provides one of the user’s emails. + + :param id: Email UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_email_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Email", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_email_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/emails/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_email( + self, + id: Annotated[StrictStr, Field(description="Email UUID")], + update_email_input: Annotated[UpdateEmailInput, Field(description="email to update")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Email: + """Update the email + + Updates the email. + + :param id: Email UUID (required) + :type id: str + :param update_email_input: email to update (required) + :type update_email_input: UpdateEmailInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_email_serialize( + id=id, + update_email_input=update_email_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Email", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_email_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Email UUID")], + update_email_input: Annotated[UpdateEmailInput, Field(description="email to update")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Email]: + """Update the email + + Updates the email. + + :param id: Email UUID (required) + :type id: str + :param update_email_input: email to update (required) + :type update_email_input: UpdateEmailInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_email_serialize( + id=id, + update_email_input=update_email_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Email", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_email_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Email UUID")], + update_email_input: Annotated[UpdateEmailInput, Field(description="email to update")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the email + + Updates the email. + + :param id: Email UUID (required) + :type id: str + :param update_email_input: email to update (required) + :type update_email_input: UpdateEmailInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_email_serialize( + id=id, + update_email_input=update_email_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Email", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_email_serialize( + self, + id, + update_email_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_email_input is not None: + _body_params = update_email_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/emails/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/events_api.py b/equinix/services/metalv1/api/events_api.py new file mode 100644 index 00000000..6ca91c24 --- /dev/null +++ b/equinix/services/metalv1/api/events_api.py @@ -0,0 +1,3286 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.event import Event +from equinix.services.metalv1.models.event_list import EventList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class EventsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def find_device_events_all_pages(self, id : Annotated[StrictStr, Field(description="Device UUID")], include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> EventList: # noqa: E501 + """Retrieve device's events # noqa: E501 + + This method is the same as find_device_events, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_device_events(}id, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param id: Device UUID (required) + :type id: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_device_events(id, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.events.extend(page_response.events) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_device_events( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventList: + """Retrieve device's events + + Returns a list of events pertaining to a specific device + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_device_events_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventList]: + """Retrieve device's events + + Returns a list of events pertaining to a specific device + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_device_events_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve device's events + + Returns a list of events pertaining to a specific device + + :param id: Device UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_device_events_serialize( + self, + id, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_event_by_id( + self, + id: Annotated[StrictStr, Field(description="Event UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Event: + """Retrieve an event + + Returns a single event if the user has access + + :param id: Event UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_event_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_event_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Event UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Event]: + """Retrieve an event + + Returns a single event if the user has access + + :param id: Event UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_event_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_event_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Event UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve an event + + Returns a single event if the user has access + + :param id: Event UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_event_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_event_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/events/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_events_all_pages(self, include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> EventList: # noqa: E501 + """Retrieve current user's events # noqa: E501 + + This method is the same as find_events, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_events(}include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_events(include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.events.extend(page_response.events) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_events( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventList: + """Retrieve current user's events + + Returns a list of the current user’s events + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_events_serialize( + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_events_with_http_info( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventList]: + """Retrieve current user's events + + Returns a list of the current user’s events + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_events_serialize( + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_events_without_preload_content( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve current user's events + + Returns a list of the current user’s events + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_events_serialize( + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_events_serialize( + self, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_interconnection_events_all_pages(self, connection_id : Annotated[StrictStr, Field(description="Interconnection UUID")], include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> EventList: # noqa: E501 + """Retrieve interconnection events # noqa: E501 + + This method is the same as find_interconnection_events, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_interconnection_events(}connection_id, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_interconnection_events(connection_id, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.events.extend(page_response.events) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_interconnection_events( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventList: + """Retrieve interconnection events + + Returns a list of the interconnection events + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_interconnection_events_serialize( + connection_id=connection_id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_interconnection_events_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventList]: + """Retrieve interconnection events + + Returns a list of the interconnection events + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_interconnection_events_serialize( + connection_id=connection_id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_interconnection_events_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve interconnection events + + Returns a list of the interconnection events + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_interconnection_events_serialize( + connection_id=connection_id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_interconnection_events_serialize( + self, + connection_id, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/connections/{connection_id}/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_interconnection_port_events( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + id: Annotated[StrictStr, Field(description="Interconnection Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Event: + """Retrieve interconnection port events + + Returns a list of the interconnection port events + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param id: Interconnection Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_interconnection_port_events_serialize( + connection_id=connection_id, + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_interconnection_port_events_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + id: Annotated[StrictStr, Field(description="Interconnection Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Event]: + """Retrieve interconnection port events + + Returns a list of the interconnection port events + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param id: Interconnection Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_interconnection_port_events_serialize( + connection_id=connection_id, + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_interconnection_port_events_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + id: Annotated[StrictStr, Field(description="Interconnection Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve interconnection port events + + Returns a list of the interconnection port events + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param id: Interconnection Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_interconnection_port_events_serialize( + connection_id=connection_id, + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_interconnection_port_events_serialize( + self, + connection_id, + id, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/connections/{connection_id}/ports/{id}/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organization_events_all_pages(self, id : Annotated[StrictStr, Field(description="Organization UUID")], include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> EventList: # noqa: E501 + """Retrieve organization's events # noqa: E501 + + This method is the same as find_organization_events, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_organization_events(}id, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param id: Organization UUID (required) + :type id: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_organization_events(id, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.events.extend(page_response.events) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_organization_events( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventList: + """Retrieve organization's events + + Returns a list of events for a single organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_events_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventList]: + """Retrieve organization's events + + Returns a list of events for a single organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_events_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve organization's events + + Returns a list of events for a single organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_events_serialize( + self, + id, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_events_all_pages(self, id : Annotated[StrictStr, Field(description="Project UUID")], include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> EventList: # noqa: E501 + """Retrieve project's events # noqa: E501 + + This method is the same as find_project_events, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_project_events(}id, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param id: Project UUID (required) + :type id: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_project_events(id, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.events.extend(page_response.events) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_project_events( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventList: + """Retrieve project's events + + Returns a list of events for a single project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_events_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventList]: + """Retrieve project's events + + Returns a list of events for a single project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_events_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve project's events + + Returns a list of events for a single project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_events_serialize( + self, + id, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_virtual_circuit_events( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Event: + """Retrieve virtual circuit events + + Returns a list of the virtual circuit events + + :param id: Virtual Circuit UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_virtual_circuit_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_virtual_circuit_events_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Event]: + """Retrieve virtual circuit events + + Returns a list of the virtual circuit events + + :param id: Virtual Circuit UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_virtual_circuit_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_virtual_circuit_events_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve virtual circuit events + + Returns a list of the virtual circuit events + + :param id: Virtual Circuit UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_virtual_circuit_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_virtual_circuit_events_serialize( + self, + id, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/virtual-circuits/{id}/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_vrf_route_events( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Event: + """Retrieve VRF route events + + Returns a list of the VRF route events + + :param id: VRF Route UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_route_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_vrf_route_events_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Event]: + """Retrieve VRF route events + + Returns a list of the VRF route events + + :param id: VRF Route UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_route_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_vrf_route_events_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve VRF route events + + Returns a list of the VRF route events + + :param id: VRF Route UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_route_events_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_vrf_route_events_serialize( + self, + id, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/routes/{id}/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/facilities_api.py b/equinix/services/metalv1/api/facilities_api.py new file mode 100644 index 00000000..4c7a7a1b --- /dev/null +++ b/equinix/services/metalv1/api/facilities_api.py @@ -0,0 +1,929 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.facility_list import FacilityList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class FacilitiesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def find_facilities( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FacilityList: + """(Deprecated) Retrieve all facilities + + Provides a listing of available datacenters where you can provision Packet devices. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /facilities is deprecated.", DeprecationWarning) + + _param = self._find_facilities_serialize( + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FacilityList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_facilities_with_http_info( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FacilityList]: + """(Deprecated) Retrieve all facilities + + Provides a listing of available datacenters where you can provision Packet devices. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /facilities is deprecated.", DeprecationWarning) + + _param = self._find_facilities_serialize( + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FacilityList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_facilities_without_preload_content( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Retrieve all facilities + + Provides a listing of available datacenters where you can provision Packet devices. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /facilities is deprecated.", DeprecationWarning) + + _param = self._find_facilities_serialize( + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FacilityList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_facilities_serialize( + self, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'multi', + 'exclude': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/facilities', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_facilities_by_organization( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FacilityList: + """(Deprecated) Retrieve all facilities visible by the organization + + Returns a listing of available datacenters for the given organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /organizations/{id}/facilities is deprecated.", DeprecationWarning) + + _param = self._find_facilities_by_organization_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FacilityList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_facilities_by_organization_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FacilityList]: + """(Deprecated) Retrieve all facilities visible by the organization + + Returns a listing of available datacenters for the given organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /organizations/{id}/facilities is deprecated.", DeprecationWarning) + + _param = self._find_facilities_by_organization_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FacilityList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_facilities_by_organization_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Retrieve all facilities visible by the organization + + Returns a listing of available datacenters for the given organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /organizations/{id}/facilities is deprecated.", DeprecationWarning) + + _param = self._find_facilities_by_organization_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FacilityList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_facilities_by_organization_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/facilities', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_facilities_by_project( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FacilityList: + """(Deprecated) Retrieve all facilities visible by the project + + Returns a listing of available datacenters for the given project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /projects/{id}/facilities is deprecated.", DeprecationWarning) + + _param = self._find_facilities_by_project_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FacilityList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_facilities_by_project_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FacilityList]: + """(Deprecated) Retrieve all facilities visible by the project + + Returns a listing of available datacenters for the given project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /projects/{id}/facilities is deprecated.", DeprecationWarning) + + _param = self._find_facilities_by_project_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FacilityList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_facilities_by_project_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Retrieve all facilities visible by the project + + Returns a listing of available datacenters for the given project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /projects/{id}/facilities is deprecated.", DeprecationWarning) + + _param = self._find_facilities_by_project_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FacilityList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_facilities_by_project_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/facilities', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/firmware_sets_api.py b/equinix/services/metalv1/api/firmware_sets_api.py new file mode 100644 index 00000000..2b24a2c1 --- /dev/null +++ b/equinix/services/metalv1/api/firmware_sets_api.py @@ -0,0 +1,636 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.firmware_set_list_response import FirmwareSetListResponse + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class FirmwareSetsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def get_organization_firmware_sets( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + page: Annotated[Optional[StrictInt], Field(description="page number to return")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="items returned per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FirmwareSetListResponse: + """Get Organization's Firmware Sets + + Returns all firmware sets associated with the organization. + + :param id: Organization UUID (required) + :type id: str + :param page: page number to return + :type page: int + :param per_page: items returned per page. + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_organization_firmware_sets_serialize( + id=id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FirmwareSetListResponse", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_organization_firmware_sets_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + page: Annotated[Optional[StrictInt], Field(description="page number to return")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="items returned per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FirmwareSetListResponse]: + """Get Organization's Firmware Sets + + Returns all firmware sets associated with the organization. + + :param id: Organization UUID (required) + :type id: str + :param page: page number to return + :type page: int + :param per_page: items returned per page. + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_organization_firmware_sets_serialize( + id=id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FirmwareSetListResponse", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_organization_firmware_sets_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + page: Annotated[Optional[StrictInt], Field(description="page number to return")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="items returned per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Organization's Firmware Sets + + Returns all firmware sets associated with the organization. + + :param id: Organization UUID (required) + :type id: str + :param page: page number to return + :type page: int + :param per_page: items returned per page. + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_organization_firmware_sets_serialize( + id=id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FirmwareSetListResponse", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_organization_firmware_sets_serialize( + self, + id, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/firmware-sets', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_project_firmware_sets( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + page: Annotated[Optional[StrictInt], Field(description="page number to return")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="items returned per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FirmwareSetListResponse: + """Get Project's Firmware Sets + + Returns all firmware sets associated with the project or organization. + + :param id: Project UUID (required) + :type id: str + :param page: page number to return + :type page: int + :param per_page: items returned per page. + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_firmware_sets_serialize( + id=id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FirmwareSetListResponse", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_project_firmware_sets_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + page: Annotated[Optional[StrictInt], Field(description="page number to return")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="items returned per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FirmwareSetListResponse]: + """Get Project's Firmware Sets + + Returns all firmware sets associated with the project or organization. + + :param id: Project UUID (required) + :type id: str + :param page: page number to return + :type page: int + :param per_page: items returned per page. + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_firmware_sets_serialize( + id=id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FirmwareSetListResponse", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_project_firmware_sets_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + page: Annotated[Optional[StrictInt], Field(description="page number to return")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="items returned per page.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Project's Firmware Sets + + Returns all firmware sets associated with the project or organization. + + :param id: Project UUID (required) + :type id: str + :param page: page number to return + :type page: int + :param per_page: items returned per page. + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_firmware_sets_serialize( + id=id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FirmwareSetListResponse", + '401': None, + '404': None, + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_project_firmware_sets_serialize( + self, + id, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/firmware-sets', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/hardware_reservations_api.py b/equinix/services/metalv1/api/hardware_reservations_api.py new file mode 100644 index 00000000..2ed26677 --- /dev/null +++ b/equinix/services/metalv1/api/hardware_reservations_api.py @@ -0,0 +1,1450 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.activate_hardware_reservation_request import ActivateHardwareReservationRequest +from equinix.services.metalv1.models.hardware_reservation import HardwareReservation +from equinix.services.metalv1.models.hardware_reservation_list import HardwareReservationList +from equinix.services.metalv1.models.move_hardware_reservation_request import MoveHardwareReservationRequest + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class HardwareReservationsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def activate_hardware_reservation( + self, + id: Annotated[StrictStr, Field(description="Hardware Reservation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + activate_hardware_reservation_request: Annotated[Optional[ActivateHardwareReservationRequest], Field(description="Note to attach to the reservation")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HardwareReservation: + """Activate a spare hardware reservation + + Activate a spare hardware reservation + + :param id: Hardware Reservation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param activate_hardware_reservation_request: Note to attach to the reservation + :type activate_hardware_reservation_request: ActivateHardwareReservationRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._activate_hardware_reservation_serialize( + id=id, + include=include, + exclude=exclude, + activate_hardware_reservation_request=activate_hardware_reservation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HardwareReservation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def activate_hardware_reservation_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Hardware Reservation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + activate_hardware_reservation_request: Annotated[Optional[ActivateHardwareReservationRequest], Field(description="Note to attach to the reservation")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HardwareReservation]: + """Activate a spare hardware reservation + + Activate a spare hardware reservation + + :param id: Hardware Reservation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param activate_hardware_reservation_request: Note to attach to the reservation + :type activate_hardware_reservation_request: ActivateHardwareReservationRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._activate_hardware_reservation_serialize( + id=id, + include=include, + exclude=exclude, + activate_hardware_reservation_request=activate_hardware_reservation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HardwareReservation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def activate_hardware_reservation_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Hardware Reservation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + activate_hardware_reservation_request: Annotated[Optional[ActivateHardwareReservationRequest], Field(description="Note to attach to the reservation")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Activate a spare hardware reservation + + Activate a spare hardware reservation + + :param id: Hardware Reservation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param activate_hardware_reservation_request: Note to attach to the reservation + :type activate_hardware_reservation_request: ActivateHardwareReservationRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._activate_hardware_reservation_serialize( + id=id, + include=include, + exclude=exclude, + activate_hardware_reservation_request=activate_hardware_reservation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HardwareReservation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _activate_hardware_reservation_serialize( + self, + id, + include, + exclude, + activate_hardware_reservation_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if activate_hardware_reservation_request is not None: + _body_params = activate_hardware_reservation_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/hardware-reservations/{id}/activate', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_hardware_reservation_by_id( + self, + id: Annotated[StrictStr, Field(description="HardwareReservation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HardwareReservation: + """Retrieve a hardware reservation + + Returns a single hardware reservation + + :param id: HardwareReservation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_hardware_reservation_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HardwareReservation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_hardware_reservation_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="HardwareReservation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HardwareReservation]: + """Retrieve a hardware reservation + + Returns a single hardware reservation + + :param id: HardwareReservation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_hardware_reservation_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HardwareReservation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_hardware_reservation_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="HardwareReservation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a hardware reservation + + Returns a single hardware reservation + + :param id: HardwareReservation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_hardware_reservation_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HardwareReservation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_hardware_reservation_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/hardware-reservations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_hardware_reservations_all_pages(self, id : Annotated[StrictStr, Field(description="Project UUID")], query : Annotated[Optional[StrictStr], Field(description="Search by facility code, plan name, project name, reservation short ID or device hostname")] = None, state : Annotated[Optional[StrictStr], Field(description="Filter by hardware reservation state")] = None, provisionable : Annotated[Optional[StrictStr], Field(description="Filter hardware reservation that is provisionable")] = None, include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> HardwareReservationList: # noqa: E501 + """Retrieve all hardware reservations for a given project # noqa: E501 + + This method is the same as find_project_hardware_reservations, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_project_hardware_reservations(}id, , }query, , }state, , }provisionable, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param id: Project UUID (required) + :type id: str + + :param query: Search by facility code, plan name, project name, reservation short ID or device hostname + :type query: str + + :param state: Filter by hardware reservation state + :type state: str + + :param provisionable: Filter hardware reservation that is provisionable + :type provisionable: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: HardwareReservationList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_project_hardware_reservations(id, query, state, provisionable, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.hardware_reservations.extend(page_response.hardware_reservations) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_project_hardware_reservations( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + query: Annotated[Optional[StrictStr], Field(description="Search by facility code, plan name, project name, reservation short ID or device hostname")] = None, + state: Annotated[Optional[StrictStr], Field(description="Filter by hardware reservation state")] = None, + provisionable: Annotated[Optional[StrictStr], Field(description="Filter hardware reservation that is provisionable")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HardwareReservationList: + """Retrieve all hardware reservations for a given project + + Provides a collection of hardware reservations for a given project. + + :param id: Project UUID (required) + :type id: str + :param query: Search by facility code, plan name, project name, reservation short ID or device hostname + :type query: str + :param state: Filter by hardware reservation state + :type state: str + :param provisionable: Filter hardware reservation that is provisionable + :type provisionable: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_hardware_reservations_serialize( + id=id, + query=query, + state=state, + provisionable=provisionable, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HardwareReservationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_hardware_reservations_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + query: Annotated[Optional[StrictStr], Field(description="Search by facility code, plan name, project name, reservation short ID or device hostname")] = None, + state: Annotated[Optional[StrictStr], Field(description="Filter by hardware reservation state")] = None, + provisionable: Annotated[Optional[StrictStr], Field(description="Filter hardware reservation that is provisionable")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HardwareReservationList]: + """Retrieve all hardware reservations for a given project + + Provides a collection of hardware reservations for a given project. + + :param id: Project UUID (required) + :type id: str + :param query: Search by facility code, plan name, project name, reservation short ID or device hostname + :type query: str + :param state: Filter by hardware reservation state + :type state: str + :param provisionable: Filter hardware reservation that is provisionable + :type provisionable: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_hardware_reservations_serialize( + id=id, + query=query, + state=state, + provisionable=provisionable, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HardwareReservationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_hardware_reservations_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + query: Annotated[Optional[StrictStr], Field(description="Search by facility code, plan name, project name, reservation short ID or device hostname")] = None, + state: Annotated[Optional[StrictStr], Field(description="Filter by hardware reservation state")] = None, + provisionable: Annotated[Optional[StrictStr], Field(description="Filter hardware reservation that is provisionable")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all hardware reservations for a given project + + Provides a collection of hardware reservations for a given project. + + :param id: Project UUID (required) + :type id: str + :param query: Search by facility code, plan name, project name, reservation short ID or device hostname + :type query: str + :param state: Filter by hardware reservation state + :type state: str + :param provisionable: Filter hardware reservation that is provisionable + :type provisionable: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_hardware_reservations_serialize( + id=id, + query=query, + state=state, + provisionable=provisionable, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HardwareReservationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_hardware_reservations_serialize( + self, + id, + query, + state, + provisionable, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if query is not None: + + _query_params.append(('query', query)) + + if state is not None: + + _query_params.append(('state', state)) + + if provisionable is not None: + + _query_params.append(('provisionable', provisionable)) + + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/hardware-reservations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def move_hardware_reservation( + self, + id: Annotated[StrictStr, Field(description="Hardware Reservation UUID")], + move_hardware_reservation_request: Annotated[MoveHardwareReservationRequest, Field(description="Destination Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HardwareReservation: + """Move a hardware reservation + + Move a hardware reservation to another project + + :param id: Hardware Reservation UUID (required) + :type id: str + :param move_hardware_reservation_request: Destination Project UUID (required) + :type move_hardware_reservation_request: MoveHardwareReservationRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_hardware_reservation_serialize( + id=id, + move_hardware_reservation_request=move_hardware_reservation_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HardwareReservation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def move_hardware_reservation_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Hardware Reservation UUID")], + move_hardware_reservation_request: Annotated[MoveHardwareReservationRequest, Field(description="Destination Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HardwareReservation]: + """Move a hardware reservation + + Move a hardware reservation to another project + + :param id: Hardware Reservation UUID (required) + :type id: str + :param move_hardware_reservation_request: Destination Project UUID (required) + :type move_hardware_reservation_request: MoveHardwareReservationRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_hardware_reservation_serialize( + id=id, + move_hardware_reservation_request=move_hardware_reservation_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HardwareReservation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def move_hardware_reservation_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Hardware Reservation UUID")], + move_hardware_reservation_request: Annotated[MoveHardwareReservationRequest, Field(description="Destination Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Move a hardware reservation + + Move a hardware reservation to another project + + :param id: Hardware Reservation UUID (required) + :type id: str + :param move_hardware_reservation_request: Destination Project UUID (required) + :type move_hardware_reservation_request: MoveHardwareReservationRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_hardware_reservation_serialize( + id=id, + move_hardware_reservation_request=move_hardware_reservation_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "HardwareReservation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _move_hardware_reservation_serialize( + self, + id, + move_hardware_reservation_request, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if move_hardware_reservation_request is not None: + _body_params = move_hardware_reservation_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/hardware-reservations/{id}/move', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/incidents_api.py b/equinix/services/metalv1/api/incidents_api.py new file mode 100644 index 00000000..8f1efdc5 --- /dev/null +++ b/equinix/services/metalv1/api/incidents_api.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class IncidentsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def find_incidents( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Retrieve the number of incidents + + Retrieve the number of incidents. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_incidents_serialize( + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_incidents_with_http_info( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Retrieve the number of incidents + + Retrieve the number of incidents. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_incidents_serialize( + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_incidents_without_preload_content( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the number of incidents + + Retrieve the number of incidents. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_incidents_serialize( + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_incidents_serialize( + self, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/incidents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/interconnections_api.py b/equinix/services/metalv1/api/interconnections_api.py new file mode 100644 index 00000000..4dbebcb6 --- /dev/null +++ b/equinix/services/metalv1/api/interconnections_api.py @@ -0,0 +1,5185 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.create_organization_interconnection_request import CreateOrganizationInterconnectionRequest +from equinix.services.metalv1.models.interconnection import Interconnection +from equinix.services.metalv1.models.interconnection_list import InterconnectionList +from equinix.services.metalv1.models.interconnection_metro_list import InterconnectionMetroList +from equinix.services.metalv1.models.interconnection_port import InterconnectionPort +from equinix.services.metalv1.models.interconnection_port_list import InterconnectionPortList +from equinix.services.metalv1.models.interconnection_pricing_list import InterconnectionPricingList +from equinix.services.metalv1.models.interconnection_update_input import InterconnectionUpdateInput +from equinix.services.metalv1.models.virtual_circuit import VirtualCircuit +from equinix.services.metalv1.models.virtual_circuit_create_input import VirtualCircuitCreateInput +from equinix.services.metalv1.models.virtual_circuit_list import VirtualCircuitList +from equinix.services.metalv1.models.virtual_circuit_update_input import VirtualCircuitUpdateInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class InterconnectionsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_interconnection_port_virtual_circuit( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + port_id: Annotated[StrictStr, Field(description="UUID of the interconnection port")], + virtual_circuit_create_input: Annotated[VirtualCircuitCreateInput, Field(description="Virtual Circuit details")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VirtualCircuit: + """Create a new Virtual Circuit + + Create a new Virtual Circuit on a Dedicated Port. To create a regular Virtual Circuit, specify a Virtual Network record and an NNI VLAN value. To create a VRF-based Virtual Circuit, specify the VRF ID and subnet, along with the NNI VLAN value. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param port_id: UUID of the interconnection port (required) + :type port_id: str + :param virtual_circuit_create_input: Virtual Circuit details (required) + :type virtual_circuit_create_input: VirtualCircuitCreateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_interconnection_port_virtual_circuit_serialize( + connection_id=connection_id, + port_id=port_id, + virtual_circuit_create_input=virtual_circuit_create_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_interconnection_port_virtual_circuit_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + port_id: Annotated[StrictStr, Field(description="UUID of the interconnection port")], + virtual_circuit_create_input: Annotated[VirtualCircuitCreateInput, Field(description="Virtual Circuit details")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VirtualCircuit]: + """Create a new Virtual Circuit + + Create a new Virtual Circuit on a Dedicated Port. To create a regular Virtual Circuit, specify a Virtual Network record and an NNI VLAN value. To create a VRF-based Virtual Circuit, specify the VRF ID and subnet, along with the NNI VLAN value. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param port_id: UUID of the interconnection port (required) + :type port_id: str + :param virtual_circuit_create_input: Virtual Circuit details (required) + :type virtual_circuit_create_input: VirtualCircuitCreateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_interconnection_port_virtual_circuit_serialize( + connection_id=connection_id, + port_id=port_id, + virtual_circuit_create_input=virtual_circuit_create_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_interconnection_port_virtual_circuit_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + port_id: Annotated[StrictStr, Field(description="UUID of the interconnection port")], + virtual_circuit_create_input: Annotated[VirtualCircuitCreateInput, Field(description="Virtual Circuit details")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new Virtual Circuit + + Create a new Virtual Circuit on a Dedicated Port. To create a regular Virtual Circuit, specify a Virtual Network record and an NNI VLAN value. To create a VRF-based Virtual Circuit, specify the VRF ID and subnet, along with the NNI VLAN value. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param port_id: UUID of the interconnection port (required) + :type port_id: str + :param virtual_circuit_create_input: Virtual Circuit details (required) + :type virtual_circuit_create_input: VirtualCircuitCreateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_interconnection_port_virtual_circuit_serialize( + connection_id=connection_id, + port_id=port_id, + virtual_circuit_create_input=virtual_circuit_create_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_interconnection_port_virtual_circuit_serialize( + self, + connection_id, + port_id, + virtual_circuit_create_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + if port_id is not None: + _path_params['port_id'] = port_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if virtual_circuit_create_input is not None: + _body_params = virtual_circuit_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/connections/{connection_id}/ports/{port_id}/virtual-circuits', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_organization_interconnection( + self, + organization_id: Annotated[StrictStr, Field(description="UUID of the organization")], + create_organization_interconnection_request: Annotated[CreateOrganizationInterconnectionRequest, Field(description="Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. ")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Interconnection: + """Request a new interconnection for the organization + + Creates a new interconnection request. A Project ID must be specified in the request body for connections on shared ports. + + :param organization_id: UUID of the organization (required) + :type organization_id: str + :param create_organization_interconnection_request: Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. (required) + :type create_organization_interconnection_request: CreateOrganizationInterconnectionRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_interconnection_serialize( + organization_id=organization_id, + create_organization_interconnection_request=create_organization_interconnection_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Interconnection", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_organization_interconnection_with_http_info( + self, + organization_id: Annotated[StrictStr, Field(description="UUID of the organization")], + create_organization_interconnection_request: Annotated[CreateOrganizationInterconnectionRequest, Field(description="Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. ")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Interconnection]: + """Request a new interconnection for the organization + + Creates a new interconnection request. A Project ID must be specified in the request body for connections on shared ports. + + :param organization_id: UUID of the organization (required) + :type organization_id: str + :param create_organization_interconnection_request: Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. (required) + :type create_organization_interconnection_request: CreateOrganizationInterconnectionRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_interconnection_serialize( + organization_id=organization_id, + create_organization_interconnection_request=create_organization_interconnection_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Interconnection", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_organization_interconnection_without_preload_content( + self, + organization_id: Annotated[StrictStr, Field(description="UUID of the organization")], + create_organization_interconnection_request: Annotated[CreateOrganizationInterconnectionRequest, Field(description="Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. ")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Request a new interconnection for the organization + + Creates a new interconnection request. A Project ID must be specified in the request body for connections on shared ports. + + :param organization_id: UUID of the organization (required) + :type organization_id: str + :param create_organization_interconnection_request: Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. (required) + :type create_organization_interconnection_request: CreateOrganizationInterconnectionRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_interconnection_serialize( + organization_id=organization_id, + create_organization_interconnection_request=create_organization_interconnection_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Interconnection", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_organization_interconnection_serialize( + self, + organization_id, + create_organization_interconnection_request, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if organization_id is not None: + _path_params['organization_id'] = organization_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if create_organization_interconnection_request is not None: + _body_params = create_organization_interconnection_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/{organization_id}/connections', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_project_interconnection( + self, + project_id: Annotated[StrictStr, Field(description="UUID of the project")], + create_organization_interconnection_request: Annotated[CreateOrganizationInterconnectionRequest, Field(description="Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. ")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Interconnection: + """Request a new interconnection for the project's organization + + Creates a new interconnection request + + :param project_id: UUID of the project (required) + :type project_id: str + :param create_organization_interconnection_request: Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. (required) + :type create_organization_interconnection_request: CreateOrganizationInterconnectionRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_interconnection_serialize( + project_id=project_id, + create_organization_interconnection_request=create_organization_interconnection_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Interconnection", + '403': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_project_interconnection_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="UUID of the project")], + create_organization_interconnection_request: Annotated[CreateOrganizationInterconnectionRequest, Field(description="Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. ")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Interconnection]: + """Request a new interconnection for the project's organization + + Creates a new interconnection request + + :param project_id: UUID of the project (required) + :type project_id: str + :param create_organization_interconnection_request: Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. (required) + :type create_organization_interconnection_request: CreateOrganizationInterconnectionRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_interconnection_serialize( + project_id=project_id, + create_organization_interconnection_request=create_organization_interconnection_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Interconnection", + '403': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_project_interconnection_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="UUID of the project")], + create_organization_interconnection_request: Annotated[CreateOrganizationInterconnectionRequest, Field(description="Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. ")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Request a new interconnection for the project's organization + + Creates a new interconnection request + + :param project_id: UUID of the project (required) + :type project_id: str + :param create_organization_interconnection_request: Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. (required) + :type create_organization_interconnection_request: CreateOrganizationInterconnectionRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_interconnection_serialize( + project_id=project_id, + create_organization_interconnection_request=create_organization_interconnection_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Interconnection", + '403': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_project_interconnection_serialize( + self, + project_id, + create_organization_interconnection_request, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if create_organization_interconnection_request is not None: + _body_params = create_organization_interconnection_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{project_id}/connections', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_interconnection( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Interconnection: + """Delete interconnection + + Delete a interconnection, its associated ports and virtual circuits. + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_interconnection_serialize( + connection_id=connection_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "Interconnection", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_interconnection_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Interconnection]: + """Delete interconnection + + Delete a interconnection, its associated ports and virtual circuits. + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_interconnection_serialize( + connection_id=connection_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "Interconnection", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_interconnection_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete interconnection + + Delete a interconnection, its associated ports and virtual circuits. + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_interconnection_serialize( + connection_id=connection_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "Interconnection", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_interconnection_serialize( + self, + connection_id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/connections/{connection_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_virtual_circuit( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VirtualCircuit: + """Delete a virtual circuit + + Delete a virtual circuit from a Dedicated Port. + + :param id: Virtual Circuit UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_virtual_circuit_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_virtual_circuit_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VirtualCircuit]: + """Delete a virtual circuit + + Delete a virtual circuit from a Dedicated Port. + + :param id: Virtual Circuit UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_virtual_circuit_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_virtual_circuit_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a virtual circuit + + Delete a virtual circuit from a Dedicated Port. + + :param id: Virtual Circuit UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_virtual_circuit_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_virtual_circuit_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/virtual-circuits/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_interconnection( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Interconnection: + """Get interconnection + + Get the details of a interconnection + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_serialize( + connection_id=connection_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Interconnection", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_interconnection_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Interconnection]: + """Get interconnection + + Get the details of a interconnection + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_serialize( + connection_id=connection_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Interconnection", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_interconnection_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get interconnection + + Get the details of a interconnection + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_serialize( + connection_id=connection_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Interconnection", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_interconnection_serialize( + self, + connection_id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/connections/{connection_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_interconnection_metros( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InterconnectionMetroList: + """Get connectivity to network provider by metro + + Displays which providers you can connect to directly from Equinix Metal Metros. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_metros_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionMetroList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_interconnection_metros_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InterconnectionMetroList]: + """Get connectivity to network provider by metro + + Displays which providers you can connect to directly from Equinix Metal Metros. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_metros_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionMetroList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_interconnection_metros_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get connectivity to network provider by metro + + Displays which providers you can connect to directly from Equinix Metal Metros. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_metros_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionMetroList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_interconnection_metros_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/connections/metros', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_interconnection_port( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InterconnectionPort: + """Get a interconnection port + + Get the details of an interconnection port. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_port_serialize( + connection_id=connection_id, + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionPort", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_interconnection_port_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InterconnectionPort]: + """Get a interconnection port + + Get the details of an interconnection port. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_port_serialize( + connection_id=connection_id, + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionPort", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_interconnection_port_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a interconnection port + + Get the details of an interconnection port. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_port_serialize( + connection_id=connection_id, + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionPort", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_interconnection_port_serialize( + self, + connection_id, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/connections/{connection_id}/ports/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_interconnection_pricing( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InterconnectionPricingList: + """Get Interconnection Pricing + + Displays pricing information for connecting to networks outside of Equinix. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_pricing_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionPricingList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_interconnection_pricing_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InterconnectionPricingList]: + """Get Interconnection Pricing + + Displays pricing information for connecting to networks outside of Equinix. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_pricing_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionPricingList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_interconnection_pricing_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Interconnection Pricing + + Displays pricing information for connecting to networks outside of Equinix. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_interconnection_pricing_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionPricingList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_interconnection_pricing_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/connections/prices', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_virtual_circuit( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VirtualCircuit: + """Get a virtual circuit + + Get the details of a virtual circuit + + :param id: Virtual Circuit UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_virtual_circuit_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_virtual_circuit_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VirtualCircuit]: + """Get a virtual circuit + + Get the details of a virtual circuit + + :param id: Virtual Circuit UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_virtual_circuit_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_virtual_circuit_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a virtual circuit + + Get the details of a virtual circuit + + :param id: Virtual Circuit UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_virtual_circuit_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_virtual_circuit_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/virtual-circuits/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def list_interconnection_port_virtual_circuits( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + port_id: Annotated[StrictStr, Field(description="UUID of the interconnection port")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VirtualCircuitList: + """List a interconnection port's virtual circuits + + List the virtual circuit record(s) associatiated with a particular interconnection port. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param port_id: UUID of the interconnection port (required) + :type port_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_interconnection_port_virtual_circuits_serialize( + connection_id=connection_id, + port_id=port_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuitList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_interconnection_port_virtual_circuits_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + port_id: Annotated[StrictStr, Field(description="UUID of the interconnection port")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VirtualCircuitList]: + """List a interconnection port's virtual circuits + + List the virtual circuit record(s) associatiated with a particular interconnection port. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param port_id: UUID of the interconnection port (required) + :type port_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_interconnection_port_virtual_circuits_serialize( + connection_id=connection_id, + port_id=port_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuitList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_interconnection_port_virtual_circuits_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + port_id: Annotated[StrictStr, Field(description="UUID of the interconnection port")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List a interconnection port's virtual circuits + + List the virtual circuit record(s) associatiated with a particular interconnection port. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param port_id: UUID of the interconnection port (required) + :type port_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_interconnection_port_virtual_circuits_serialize( + connection_id=connection_id, + port_id=port_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuitList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_interconnection_port_virtual_circuits_serialize( + self, + connection_id, + port_id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + if port_id is not None: + _path_params['port_id'] = port_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/connections/{connection_id}/ports/{port_id}/virtual-circuits', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def list_interconnection_ports( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InterconnectionPortList: + """List a interconnection's ports + + List the ports associated to an interconnection. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_interconnection_ports_serialize( + connection_id=connection_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionPortList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_interconnection_ports_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InterconnectionPortList]: + """List a interconnection's ports + + List the ports associated to an interconnection. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_interconnection_ports_serialize( + connection_id=connection_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionPortList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_interconnection_ports_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List a interconnection's ports + + List the ports associated to an interconnection. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_interconnection_ports_serialize( + connection_id=connection_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionPortList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_interconnection_ports_serialize( + self, + connection_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/connections/{connection_id}/ports', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def list_interconnection_virtual_circuits( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VirtualCircuitList: + """List a interconnection's virtual circuits + + List the virtual circuit record(s) associated with a particular interconnection id. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_interconnection_virtual_circuits_serialize( + connection_id=connection_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuitList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_interconnection_virtual_circuits_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VirtualCircuitList]: + """List a interconnection's virtual circuits + + List the virtual circuit record(s) associated with a particular interconnection id. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_interconnection_virtual_circuits_serialize( + connection_id=connection_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuitList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_interconnection_virtual_circuits_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="UUID of the interconnection")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List a interconnection's virtual circuits + + List the virtual circuit record(s) associated with a particular interconnection id. + + :param connection_id: UUID of the interconnection (required) + :type connection_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_interconnection_virtual_circuits_serialize( + connection_id=connection_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuitList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_interconnection_virtual_circuits_serialize( + self, + connection_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/connections/{connection_id}/virtual-circuits', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def organization_list_interconnections( + self, + organization_id: Annotated[StrictStr, Field(description="UUID of the organization")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InterconnectionList: + """List organization connections + + List the connections belonging to the organization + + :param organization_id: UUID of the organization (required) + :type organization_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._organization_list_interconnections_serialize( + organization_id=organization_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def organization_list_interconnections_with_http_info( + self, + organization_id: Annotated[StrictStr, Field(description="UUID of the organization")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InterconnectionList]: + """List organization connections + + List the connections belonging to the organization + + :param organization_id: UUID of the organization (required) + :type organization_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._organization_list_interconnections_serialize( + organization_id=organization_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def organization_list_interconnections_without_preload_content( + self, + organization_id: Annotated[StrictStr, Field(description="UUID of the organization")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List organization connections + + List the connections belonging to the organization + + :param organization_id: UUID of the organization (required) + :type organization_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._organization_list_interconnections_serialize( + organization_id=organization_id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _organization_list_interconnections_serialize( + self, + organization_id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if organization_id is not None: + _path_params['organization_id'] = organization_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{organization_id}/connections', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def project_list_interconnections_all_pages(self, project_id : Annotated[StrictStr, Field(description="UUID of the project")], include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> InterconnectionList: # noqa: E501 + """List project connections # noqa: E501 + + This method is the same as project_list_interconnections, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.project_list_interconnections(}project_id, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param project_id: UUID of the project (required) + :type project_id: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: InterconnectionList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.project_list_interconnections(project_id, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.interconnections.extend(page_response.interconnections) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def project_list_interconnections( + self, + project_id: Annotated[StrictStr, Field(description="UUID of the project")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InterconnectionList: + """List project connections + + List the connections belonging to the project + + :param project_id: UUID of the project (required) + :type project_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._project_list_interconnections_serialize( + project_id=project_id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def project_list_interconnections_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="UUID of the project")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InterconnectionList]: + """List project connections + + List the connections belonging to the project + + :param project_id: UUID of the project (required) + :type project_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._project_list_interconnections_serialize( + project_id=project_id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def project_list_interconnections_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="UUID of the project")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List project connections + + List the connections belonging to the project + + :param project_id: UUID of the project (required) + :type project_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._project_list_interconnections_serialize( + project_id=project_id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InterconnectionList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _project_list_interconnections_serialize( + self, + project_id, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{project_id}/connections', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_interconnection( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + interconnection_update_input: Annotated[InterconnectionUpdateInput, Field(description="Updated interconnection details")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Interconnection: + """Update interconnection + + Update the details of a interconnection + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param interconnection_update_input: Updated interconnection details (required) + :type interconnection_update_input: InterconnectionUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_interconnection_serialize( + connection_id=connection_id, + interconnection_update_input=interconnection_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Interconnection", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_interconnection_with_http_info( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + interconnection_update_input: Annotated[InterconnectionUpdateInput, Field(description="Updated interconnection details")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Interconnection]: + """Update interconnection + + Update the details of a interconnection + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param interconnection_update_input: Updated interconnection details (required) + :type interconnection_update_input: InterconnectionUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_interconnection_serialize( + connection_id=connection_id, + interconnection_update_input=interconnection_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Interconnection", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_interconnection_without_preload_content( + self, + connection_id: Annotated[StrictStr, Field(description="Interconnection UUID")], + interconnection_update_input: Annotated[InterconnectionUpdateInput, Field(description="Updated interconnection details")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update interconnection + + Update the details of a interconnection + + :param connection_id: Interconnection UUID (required) + :type connection_id: str + :param interconnection_update_input: Updated interconnection details (required) + :type interconnection_update_input: InterconnectionUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_interconnection_serialize( + connection_id=connection_id, + interconnection_update_input=interconnection_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Interconnection", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_interconnection_serialize( + self, + connection_id, + interconnection_update_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if connection_id is not None: + _path_params['connection_id'] = connection_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if interconnection_update_input is not None: + _body_params = interconnection_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/connections/{connection_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_virtual_circuit( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + virtual_circuit_update_input: Annotated[VirtualCircuitUpdateInput, Field(description="Updated Virtual Circuit details")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VirtualCircuit: + """Update a virtual circuit + + Update the details of a virtual circuit. + + :param id: Virtual Circuit UUID (required) + :type id: str + :param virtual_circuit_update_input: Updated Virtual Circuit details (required) + :type virtual_circuit_update_input: VirtualCircuitUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_virtual_circuit_serialize( + id=id, + virtual_circuit_update_input=virtual_circuit_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuit", + '202': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_virtual_circuit_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + virtual_circuit_update_input: Annotated[VirtualCircuitUpdateInput, Field(description="Updated Virtual Circuit details")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VirtualCircuit]: + """Update a virtual circuit + + Update the details of a virtual circuit. + + :param id: Virtual Circuit UUID (required) + :type id: str + :param virtual_circuit_update_input: Updated Virtual Circuit details (required) + :type virtual_circuit_update_input: VirtualCircuitUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_virtual_circuit_serialize( + id=id, + virtual_circuit_update_input=virtual_circuit_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuit", + '202': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_virtual_circuit_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Virtual Circuit UUID")], + virtual_circuit_update_input: Annotated[VirtualCircuitUpdateInput, Field(description="Updated Virtual Circuit details")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a virtual circuit + + Update the details of a virtual circuit. + + :param id: Virtual Circuit UUID (required) + :type id: str + :param virtual_circuit_update_input: Updated Virtual Circuit details (required) + :type virtual_circuit_update_input: VirtualCircuitUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_virtual_circuit_serialize( + id=id, + virtual_circuit_update_input=virtual_circuit_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualCircuit", + '202': "VirtualCircuit", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_virtual_circuit_serialize( + self, + id, + virtual_circuit_update_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if virtual_circuit_update_input is not None: + _body_params = virtual_circuit_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/virtual-circuits/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/invitations_api.py b/equinix/services/metalv1/api/invitations_api.py new file mode 100644 index 00000000..f80ee116 --- /dev/null +++ b/equinix/services/metalv1/api/invitations_api.py @@ -0,0 +1,870 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.invitation import Invitation +from equinix.services.metalv1.models.membership import Membership + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class InvitationsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def accept_invitation( + self, + id: Annotated[StrictStr, Field(description="Invitation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Membership: + """Accept an invitation + + Accept an invitation. + + :param id: Invitation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._accept_invitation_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Membership", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def accept_invitation_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Invitation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Membership]: + """Accept an invitation + + Accept an invitation. + + :param id: Invitation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._accept_invitation_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Membership", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def accept_invitation_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Invitation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Accept an invitation + + Accept an invitation. + + :param id: Invitation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._accept_invitation_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Membership", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _accept_invitation_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/invitations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def decline_invitation( + self, + id: Annotated[StrictStr, Field(description="Invitation UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Decline an invitation + + Decline an invitation. + + :param id: Invitation UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._decline_invitation_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def decline_invitation_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Invitation UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Decline an invitation + + Decline an invitation. + + :param id: Invitation UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._decline_invitation_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def decline_invitation_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Invitation UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Decline an invitation + + Decline an invitation. + + :param id: Invitation UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._decline_invitation_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _decline_invitation_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/invitations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_invitation_by_id( + self, + id: Annotated[StrictStr, Field(description="Invitation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Invitation: + """View an invitation + + Returns a single invitation. (It include the `invitable` to maintain backward compatibility but will be removed soon) + + :param id: Invitation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_invitation_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Invitation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_invitation_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Invitation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Invitation]: + """View an invitation + + Returns a single invitation. (It include the `invitable` to maintain backward compatibility but will be removed soon) + + :param id: Invitation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_invitation_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Invitation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_invitation_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Invitation UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """View an invitation + + Returns a single invitation. (It include the `invitable` to maintain backward compatibility but will be removed soon) + + :param id: Invitation UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_invitation_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Invitation", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_invitation_by_id_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/invitations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/invoices_api.py b/equinix/services/metalv1/api/invoices_api.py new file mode 100644 index 00000000..782e5f8a --- /dev/null +++ b/equinix/services/metalv1/api/invoices_api.py @@ -0,0 +1,614 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.invoice import Invoice +from equinix.services.metalv1.models.invoice_list import InvoiceList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class InvoicesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def find_organization_invoices( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + page: Annotated[Optional[StrictInt], Field(description="page number")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="per page")] = None, + status: Annotated[Optional[StrictStr], Field(description="filter by status")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InvoiceList: + """Retrieve all invoices for an organization + + Returns all invoices for an organization + + :param id: Organization UUID (required) + :type id: str + :param page: page number + :type page: int + :param per_page: per page + :type per_page: int + :param status: filter by status + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_invoices_serialize( + id=id, + page=page, + per_page=per_page, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvoiceList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_invoices_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + page: Annotated[Optional[StrictInt], Field(description="page number")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="per page")] = None, + status: Annotated[Optional[StrictStr], Field(description="filter by status")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InvoiceList]: + """Retrieve all invoices for an organization + + Returns all invoices for an organization + + :param id: Organization UUID (required) + :type id: str + :param page: page number + :type page: int + :param per_page: per page + :type per_page: int + :param status: filter by status + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_invoices_serialize( + id=id, + page=page, + per_page=per_page, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvoiceList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_invoices_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + page: Annotated[Optional[StrictInt], Field(description="page number")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="per page")] = None, + status: Annotated[Optional[StrictStr], Field(description="filter by status")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all invoices for an organization + + Returns all invoices for an organization + + :param id: Organization UUID (required) + :type id: str + :param page: page number + :type page: int + :param per_page: per page + :type per_page: int + :param status: filter by status + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_invoices_serialize( + id=id, + page=page, + per_page=per_page, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvoiceList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_invoices_serialize( + self, + id, + page, + per_page, + status, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + if status is not None: + + _query_params.append(('status', status)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/invoices', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_invoice_by_id( + self, + id: Annotated[StrictStr, Field(description="Invoice UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Invoice: + """Retrieve an invoice + + Returns the invoice identified by the provided id + + :param id: Invoice UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_invoice_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Invoice", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_invoice_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Invoice UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Invoice]: + """Retrieve an invoice + + Returns the invoice identified by the provided id + + :param id: Invoice UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_invoice_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Invoice", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_invoice_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Invoice UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve an invoice + + Returns the invoice identified by the provided id + + :param id: Invoice UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_invoice_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Invoice", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_invoice_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/invoices/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/ip_addresses_api.py b/equinix/services/metalv1/api/ip_addresses_api.py new file mode 100644 index 00000000..5c61bdf9 --- /dev/null +++ b/equinix/services/metalv1/api/ip_addresses_api.py @@ -0,0 +1,2153 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.find_ip_address_by_id200_response import FindIPAddressById200Response +from equinix.services.metalv1.models.ip_assignment_update_input import IPAssignmentUpdateInput +from equinix.services.metalv1.models.ip_availabilities_list import IPAvailabilitiesList +from equinix.services.metalv1.models.ip_reservation_list import IPReservationList +from equinix.services.metalv1.models.request_ip_reservation201_response import RequestIPReservation201Response +from equinix.services.metalv1.models.request_ip_reservation_request import RequestIPReservationRequest + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class IPAddressesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def delete_ip_address( + self, + id: Annotated[StrictStr, Field(description="IP Address UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Unassign an ip address + + This call can be used to un-assign an IP assignment or delete an IP reservation. Un-assign an IP address record. Use the assignment UUID you get after attaching the IP. This will remove the relationship between an IP and the device or metal gateway and will make the IP address available to be assigned to another device, once the IP has been un-configured from the network. Delete an IP reservation. Use the reservation UUID you get after adding the IP to the project. This will permanently delete the IP block reservation from the project. + + :param id: IP Address UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_ip_address_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_ip_address_with_http_info( + self, + id: Annotated[StrictStr, Field(description="IP Address UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Unassign an ip address + + This call can be used to un-assign an IP assignment or delete an IP reservation. Un-assign an IP address record. Use the assignment UUID you get after attaching the IP. This will remove the relationship between an IP and the device or metal gateway and will make the IP address available to be assigned to another device, once the IP has been un-configured from the network. Delete an IP reservation. Use the reservation UUID you get after adding the IP to the project. This will permanently delete the IP block reservation from the project. + + :param id: IP Address UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_ip_address_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_ip_address_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="IP Address UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Unassign an ip address + + This call can be used to un-assign an IP assignment or delete an IP reservation. Un-assign an IP address record. Use the assignment UUID you get after attaching the IP. This will remove the relationship between an IP and the device or metal gateway and will make the IP address available to be assigned to another device, once the IP has been un-configured from the network. Delete an IP reservation. Use the reservation UUID you get after adding the IP to the project. This will permanently delete the IP block reservation from the project. + + :param id: IP Address UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_ip_address_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_ip_address_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/ips/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_ip_address_by_id( + self, + id: Annotated[StrictStr, Field(description="IP Address UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FindIPAddressById200Response: + """Retrieve an ip address + + Returns a single ip address if the user has access. + + :param id: IP Address UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_address_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindIPAddressById200Response", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_ip_address_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="IP Address UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FindIPAddressById200Response]: + """Retrieve an ip address + + Returns a single ip address if the user has access. + + :param id: IP Address UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_address_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindIPAddressById200Response", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_ip_address_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="IP Address UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve an ip address + + Returns a single ip address if the user has access. + + :param id: IP Address UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_address_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindIPAddressById200Response", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_ip_address_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/ips/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_ip_address_customdata( + self, + id: Annotated[StrictStr, Field(description="Ip Reservation UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Retrieve the custom metadata of an IP Reservation or IP Assignment + + Provides the custom metadata stored for this IP Reservation or IP Assignment in json format + + :param id: Ip Reservation UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_address_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_ip_address_customdata_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Ip Reservation UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Retrieve the custom metadata of an IP Reservation or IP Assignment + + Provides the custom metadata stored for this IP Reservation or IP Assignment in json format + + :param id: Ip Reservation UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_address_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_ip_address_customdata_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Ip Reservation UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the custom metadata of an IP Reservation or IP Assignment + + Provides the custom metadata stored for this IP Reservation or IP Assignment in json format + + :param id: Ip Reservation UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_address_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_ip_address_customdata_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/ips/{id}/customdata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_ip_availabilities( + self, + id: Annotated[StrictStr, Field(description="IP Reservation UUID")], + cidr: Annotated[StrictStr, Field(description="Size of subnets in bits")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IPAvailabilitiesList: + """Retrieve all available subnets of a particular reservation + + Provides a list of IP resevations for a single project. + + :param id: IP Reservation UUID (required) + :type id: str + :param cidr: Size of subnets in bits (required) + :type cidr: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_availabilities_serialize( + id=id, + cidr=cidr, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPAvailabilitiesList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_ip_availabilities_with_http_info( + self, + id: Annotated[StrictStr, Field(description="IP Reservation UUID")], + cidr: Annotated[StrictStr, Field(description="Size of subnets in bits")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IPAvailabilitiesList]: + """Retrieve all available subnets of a particular reservation + + Provides a list of IP resevations for a single project. + + :param id: IP Reservation UUID (required) + :type id: str + :param cidr: Size of subnets in bits (required) + :type cidr: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_availabilities_serialize( + id=id, + cidr=cidr, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPAvailabilitiesList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_ip_availabilities_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="IP Reservation UUID")], + cidr: Annotated[StrictStr, Field(description="Size of subnets in bits")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all available subnets of a particular reservation + + Provides a list of IP resevations for a single project. + + :param id: IP Reservation UUID (required) + :type id: str + :param cidr: Size of subnets in bits (required) + :type cidr: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_availabilities_serialize( + id=id, + cidr=cidr, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPAvailabilitiesList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_ip_availabilities_serialize( + self, + id, + cidr, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if cidr is not None: + + _query_params.append(('cidr', cidr)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/ips/{id}/available', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_ip_reservations( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + types: Annotated[Optional[List[StrictStr]], Field(description="Filter project IP reservations by reservation type")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IPReservationList: + """Retrieve all ip reservations + + Provides a paginated list of IP reservations for a single project. + + :param id: Project UUID (required) + :type id: str + :param types: Filter project IP reservations by reservation type + :type types: List[str] + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_reservations_serialize( + id=id, + types=types, + include=include, + exclude=exclude, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPReservationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_ip_reservations_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + types: Annotated[Optional[List[StrictStr]], Field(description="Filter project IP reservations by reservation type")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IPReservationList]: + """Retrieve all ip reservations + + Provides a paginated list of IP reservations for a single project. + + :param id: Project UUID (required) + :type id: str + :param types: Filter project IP reservations by reservation type + :type types: List[str] + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_reservations_serialize( + id=id, + types=types, + include=include, + exclude=exclude, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPReservationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_ip_reservations_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + types: Annotated[Optional[List[StrictStr]], Field(description="Filter project IP reservations by reservation type")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all ip reservations + + Provides a paginated list of IP reservations for a single project. + + :param id: Project UUID (required) + :type id: str + :param types: Filter project IP reservations by reservation type + :type types: List[str] + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_reservations_serialize( + id=id, + types=types, + include=include, + exclude=exclude, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPReservationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_ip_reservations_serialize( + self, + id, + types, + include, + exclude, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'types': 'multi', + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if types is not None: + + _query_params.append(('types', types)) + + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/ips', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def request_ip_reservation( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + request_ip_reservation_request: Annotated[RequestIPReservationRequest, Field(description="IP Reservation Request to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RequestIPReservation201Response: + """Requesting IP reservations + + Request more IP space for a project in order to have additional IP addresses to assign to devices. If the request is within the max quota, an IP reservation will be created. If the project will exceed its IP quota, a request will be submitted for review, and will return an IP Reservation with a `state` of `pending`. You can automatically have the request fail with HTTP status 422 instead of triggering the review process by providing the `fail_on_approval_required` parameter set to `true` in the request. + + :param id: Project UUID (required) + :type id: str + :param request_ip_reservation_request: IP Reservation Request to create (required) + :type request_ip_reservation_request: RequestIPReservationRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._request_ip_reservation_serialize( + id=id, + request_ip_reservation_request=request_ip_reservation_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "RequestIPReservation201Response", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def request_ip_reservation_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + request_ip_reservation_request: Annotated[RequestIPReservationRequest, Field(description="IP Reservation Request to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RequestIPReservation201Response]: + """Requesting IP reservations + + Request more IP space for a project in order to have additional IP addresses to assign to devices. If the request is within the max quota, an IP reservation will be created. If the project will exceed its IP quota, a request will be submitted for review, and will return an IP Reservation with a `state` of `pending`. You can automatically have the request fail with HTTP status 422 instead of triggering the review process by providing the `fail_on_approval_required` parameter set to `true` in the request. + + :param id: Project UUID (required) + :type id: str + :param request_ip_reservation_request: IP Reservation Request to create (required) + :type request_ip_reservation_request: RequestIPReservationRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._request_ip_reservation_serialize( + id=id, + request_ip_reservation_request=request_ip_reservation_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "RequestIPReservation201Response", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def request_ip_reservation_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + request_ip_reservation_request: Annotated[RequestIPReservationRequest, Field(description="IP Reservation Request to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Requesting IP reservations + + Request more IP space for a project in order to have additional IP addresses to assign to devices. If the request is within the max quota, an IP reservation will be created. If the project will exceed its IP quota, a request will be submitted for review, and will return an IP Reservation with a `state` of `pending`. You can automatically have the request fail with HTTP status 422 instead of triggering the review process by providing the `fail_on_approval_required` parameter set to `true` in the request. + + :param id: Project UUID (required) + :type id: str + :param request_ip_reservation_request: IP Reservation Request to create (required) + :type request_ip_reservation_request: RequestIPReservationRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._request_ip_reservation_serialize( + id=id, + request_ip_reservation_request=request_ip_reservation_request, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "RequestIPReservation201Response", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _request_ip_reservation_serialize( + self, + id, + request_ip_reservation_request, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if request_ip_reservation_request is not None: + _body_params = request_ip_reservation_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/ips', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_ip_address( + self, + id: Annotated[StrictStr, Field(description="IP Address UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + ip_assignment_update_input: Optional[IPAssignmentUpdateInput] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FindIPAddressById200Response: + """Update an ip address + + Update details about an ip address + + :param id: IP Address UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param ip_assignment_update_input: + :type ip_assignment_update_input: IPAssignmentUpdateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ip_address_serialize( + id=id, + include=include, + exclude=exclude, + ip_assignment_update_input=ip_assignment_update_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindIPAddressById200Response", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_ip_address_with_http_info( + self, + id: Annotated[StrictStr, Field(description="IP Address UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + ip_assignment_update_input: Optional[IPAssignmentUpdateInput] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FindIPAddressById200Response]: + """Update an ip address + + Update details about an ip address + + :param id: IP Address UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param ip_assignment_update_input: + :type ip_assignment_update_input: IPAssignmentUpdateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ip_address_serialize( + id=id, + include=include, + exclude=exclude, + ip_assignment_update_input=ip_assignment_update_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindIPAddressById200Response", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_ip_address_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="IP Address UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + ip_assignment_update_input: Optional[IPAssignmentUpdateInput] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an ip address + + Update details about an ip address + + :param id: IP Address UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param ip_assignment_update_input: + :type ip_assignment_update_input: IPAssignmentUpdateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ip_address_serialize( + id=id, + include=include, + exclude=exclude, + ip_assignment_update_input=ip_assignment_update_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindIPAddressById200Response", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_ip_address_serialize( + self, + id, + include, + exclude, + ip_assignment_update_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if ip_assignment_update_input is not None: + _body_params = ip_assignment_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/ips/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/licenses_api.py b/equinix/services/metalv1/api/licenses_api.py new file mode 100644 index 00000000..e5db5170 --- /dev/null +++ b/equinix/services/metalv1/api/licenses_api.py @@ -0,0 +1,1606 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.license import License +from equinix.services.metalv1.models.license_create_input import LicenseCreateInput +from equinix.services.metalv1.models.license_list import LicenseList +from equinix.services.metalv1.models.license_update_input import LicenseUpdateInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class LicensesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_license( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + license_create_input: Annotated[LicenseCreateInput, Field(description="License to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> License: + """Create a License + + Creates a new license for the given project + + :param id: Project UUID (required) + :type id: str + :param license_create_input: License to create (required) + :type license_create_input: LicenseCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_license_serialize( + id=id, + license_create_input=license_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "License", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_license_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + license_create_input: Annotated[LicenseCreateInput, Field(description="License to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[License]: + """Create a License + + Creates a new license for the given project + + :param id: Project UUID (required) + :type id: str + :param license_create_input: License to create (required) + :type license_create_input: LicenseCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_license_serialize( + id=id, + license_create_input=license_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "License", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_license_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + license_create_input: Annotated[LicenseCreateInput, Field(description="License to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a License + + Creates a new license for the given project + + :param id: Project UUID (required) + :type id: str + :param license_create_input: License to create (required) + :type license_create_input: LicenseCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_license_serialize( + id=id, + license_create_input=license_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "License", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_license_serialize( + self, + id, + license_create_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if license_create_input is not None: + _body_params = license_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/licenses', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_license( + self, + id: Annotated[StrictStr, Field(description="License UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the license + + Deletes a license. + + :param id: License UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_license_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_license_with_http_info( + self, + id: Annotated[StrictStr, Field(description="License UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the license + + Deletes a license. + + :param id: License UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_license_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_license_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="License UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the license + + Deletes a license. + + :param id: License UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_license_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_license_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/licenses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_license_by_id( + self, + id: Annotated[StrictStr, Field(description="License UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> License: + """Retrieve a license + + Returns a license + + :param id: License UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_license_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "License", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_license_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="License UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[License]: + """Retrieve a license + + Returns a license + + :param id: License UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_license_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "License", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_license_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="License UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a license + + Returns a license + + :param id: License UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_license_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "License", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_license_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/licenses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_licenses( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LicenseList: + """Retrieve all licenses + + Provides a collection of licenses for a given project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_licenses_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LicenseList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_licenses_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LicenseList]: + """Retrieve all licenses + + Provides a collection of licenses for a given project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_licenses_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LicenseList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_licenses_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all licenses + + Provides a collection of licenses for a given project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_licenses_serialize( + id=id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LicenseList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_licenses_serialize( + self, + id, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/licenses', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_license( + self, + id: Annotated[StrictStr, Field(description="License UUID")], + license_update_input: Annotated[LicenseUpdateInput, Field(description="License to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> License: + """Update the license + + Updates the license. + + :param id: License UUID (required) + :type id: str + :param license_update_input: License to update (required) + :type license_update_input: LicenseUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_license_serialize( + id=id, + license_update_input=license_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "License", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_license_with_http_info( + self, + id: Annotated[StrictStr, Field(description="License UUID")], + license_update_input: Annotated[LicenseUpdateInput, Field(description="License to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[License]: + """Update the license + + Updates the license. + + :param id: License UUID (required) + :type id: str + :param license_update_input: License to update (required) + :type license_update_input: LicenseUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_license_serialize( + id=id, + license_update_input=license_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "License", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_license_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="License UUID")], + license_update_input: Annotated[LicenseUpdateInput, Field(description="License to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the license + + Updates the license. + + :param id: License UUID (required) + :type id: str + :param license_update_input: License to update (required) + :type license_update_input: LicenseUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_license_serialize( + id=id, + license_update_input=license_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "License", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_license_serialize( + self, + id, + license_update_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if license_update_input is not None: + _body_params = license_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/licenses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/memberships_api.py b/equinix/services/metalv1/api/memberships_api.py new file mode 100644 index 00000000..5454cb0f --- /dev/null +++ b/equinix/services/metalv1/api/memberships_api.py @@ -0,0 +1,901 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.membership import Membership +from equinix.services.metalv1.models.membership_input import MembershipInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class MembershipsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def delete_membership( + self, + id: Annotated[StrictStr, Field(description="Membership UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the membership + + Deletes the membership. + + :param id: Membership UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_membership_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_membership_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Membership UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the membership + + Deletes the membership. + + :param id: Membership UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_membership_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_membership_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Membership UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the membership + + Deletes the membership. + + :param id: Membership UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_membership_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_membership_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/memberships/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_membership_by_id( + self, + id: Annotated[StrictStr, Field(description="Membership UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Membership: + """Retrieve a membership + + Returns a single membership. + + :param id: Membership UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_membership_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Membership", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_membership_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Membership UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Membership]: + """Retrieve a membership + + Returns a single membership. + + :param id: Membership UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_membership_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Membership", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_membership_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Membership UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a membership + + Returns a single membership. + + :param id: Membership UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_membership_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Membership", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_membership_by_id_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/memberships/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_membership( + self, + id: Annotated[StrictStr, Field(description="Membership UUID")], + membership_input: Annotated[MembershipInput, Field(description="Membership to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Membership: + """Update the membership + + Updates the membership. + + :param id: Membership UUID (required) + :type id: str + :param membership_input: Membership to update (required) + :type membership_input: MembershipInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_membership_serialize( + id=id, + membership_input=membership_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Membership", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_membership_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Membership UUID")], + membership_input: Annotated[MembershipInput, Field(description="Membership to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Membership]: + """Update the membership + + Updates the membership. + + :param id: Membership UUID (required) + :type id: str + :param membership_input: Membership to update (required) + :type membership_input: MembershipInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_membership_serialize( + id=id, + membership_input=membership_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Membership", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_membership_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Membership UUID")], + membership_input: Annotated[MembershipInput, Field(description="Membership to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the membership + + Updates the membership. + + :param id: Membership UUID (required) + :type id: str + :param membership_input: Membership to update (required) + :type membership_input: MembershipInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_membership_serialize( + id=id, + membership_input=membership_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Membership", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_membership_serialize( + self, + id, + membership_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if membership_input is not None: + _body_params = membership_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/memberships/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/metal_gateways_api.py b/equinix/services/metalv1/api/metal_gateways_api.py new file mode 100644 index 00000000..00947e04 --- /dev/null +++ b/equinix/services/metalv1/api/metal_gateways_api.py @@ -0,0 +1,2652 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.bgp_dynamic_neighbor import BgpDynamicNeighbor +from equinix.services.metalv1.models.bgp_dynamic_neighbor_create_input import BgpDynamicNeighborCreateInput +from equinix.services.metalv1.models.bgp_dynamic_neighbor_list import BgpDynamicNeighborList +from equinix.services.metalv1.models.create_metal_gateway_request import CreateMetalGatewayRequest +from equinix.services.metalv1.models.find_metal_gateway_by_id200_response import FindMetalGatewayById200Response +from equinix.services.metalv1.models.ip_assignment import IPAssignment +from equinix.services.metalv1.models.ip_assignment_list import IPAssignmentList +from equinix.services.metalv1.models.metal_gateway_elastic_ip_create_input import MetalGatewayElasticIpCreateInput +from equinix.services.metalv1.models.metal_gateway_list import MetalGatewayList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class MetalGatewaysApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_bgp_dynamic_neighbor( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + bgp_dynamic_neighbor_create_input: BgpDynamicNeighborCreateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpDynamicNeighbor: + """Create a VRF BGP Dynamic Neighbor range + + Create a VRF BGP Dynamic Neighbor range. BGP Dynamic Neighbor records are limited to 2 per Virtual Network. + + :param id: Metal Gateway UUID (required) + :type id: str + :param bgp_dynamic_neighbor_create_input: (required) + :type bgp_dynamic_neighbor_create_input: BgpDynamicNeighborCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bgp_dynamic_neighbor_serialize( + id=id, + bgp_dynamic_neighbor_create_input=bgp_dynamic_neighbor_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BgpDynamicNeighbor", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_bgp_dynamic_neighbor_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + bgp_dynamic_neighbor_create_input: BgpDynamicNeighborCreateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpDynamicNeighbor]: + """Create a VRF BGP Dynamic Neighbor range + + Create a VRF BGP Dynamic Neighbor range. BGP Dynamic Neighbor records are limited to 2 per Virtual Network. + + :param id: Metal Gateway UUID (required) + :type id: str + :param bgp_dynamic_neighbor_create_input: (required) + :type bgp_dynamic_neighbor_create_input: BgpDynamicNeighborCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bgp_dynamic_neighbor_serialize( + id=id, + bgp_dynamic_neighbor_create_input=bgp_dynamic_neighbor_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BgpDynamicNeighbor", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_bgp_dynamic_neighbor_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + bgp_dynamic_neighbor_create_input: BgpDynamicNeighborCreateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a VRF BGP Dynamic Neighbor range + + Create a VRF BGP Dynamic Neighbor range. BGP Dynamic Neighbor records are limited to 2 per Virtual Network. + + :param id: Metal Gateway UUID (required) + :type id: str + :param bgp_dynamic_neighbor_create_input: (required) + :type bgp_dynamic_neighbor_create_input: BgpDynamicNeighborCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_bgp_dynamic_neighbor_serialize( + id=id, + bgp_dynamic_neighbor_create_input=bgp_dynamic_neighbor_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BgpDynamicNeighbor", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_bgp_dynamic_neighbor_serialize( + self, + id, + bgp_dynamic_neighbor_create_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if bgp_dynamic_neighbor_create_input is not None: + _body_params = bgp_dynamic_neighbor_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/metal-gateways/{id}/bgp-dynamic-neighbors', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_metal_gateway( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + create_metal_gateway_request: Annotated[CreateMetalGatewayRequest, Field(description="Metal Gateway to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FindMetalGatewayById200Response: + """Create a metal gateway + + Create a metal gateway in a project + + :param project_id: Project UUID (required) + :type project_id: str + :param create_metal_gateway_request: Metal Gateway to create (required) + :type create_metal_gateway_request: CreateMetalGatewayRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_metal_gateway_serialize( + project_id=project_id, + create_metal_gateway_request=create_metal_gateway_request, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "FindMetalGatewayById200Response", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_metal_gateway_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + create_metal_gateway_request: Annotated[CreateMetalGatewayRequest, Field(description="Metal Gateway to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FindMetalGatewayById200Response]: + """Create a metal gateway + + Create a metal gateway in a project + + :param project_id: Project UUID (required) + :type project_id: str + :param create_metal_gateway_request: Metal Gateway to create (required) + :type create_metal_gateway_request: CreateMetalGatewayRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_metal_gateway_serialize( + project_id=project_id, + create_metal_gateway_request=create_metal_gateway_request, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "FindMetalGatewayById200Response", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_metal_gateway_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + create_metal_gateway_request: Annotated[CreateMetalGatewayRequest, Field(description="Metal Gateway to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a metal gateway + + Create a metal gateway in a project + + :param project_id: Project UUID (required) + :type project_id: str + :param create_metal_gateway_request: Metal Gateway to create (required) + :type create_metal_gateway_request: CreateMetalGatewayRequest + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_metal_gateway_serialize( + project_id=project_id, + create_metal_gateway_request=create_metal_gateway_request, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "FindMetalGatewayById200Response", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_metal_gateway_serialize( + self, + project_id, + create_metal_gateway_request, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + if create_metal_gateway_request is not None: + _body_params = create_metal_gateway_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{project_id}/metal-gateways', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_metal_gateway_elastic_ip( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + metal_gateway_elastic_ip_create_input: MetalGatewayElasticIpCreateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IPAssignment: + """Create a Metal Gateway Elastic IP + + Create a new Elastic IP on this Metal Gateway. Assign an IPv4 range as an elastic IP to the Metal Gateway, with a specified next-hop address contained within the Metal Gateway. Notice: Elastic IPs on Metal Gateways are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + + :param id: Metal Gateway UUID (required) + :type id: str + :param metal_gateway_elastic_ip_create_input: (required) + :type metal_gateway_elastic_ip_create_input: MetalGatewayElasticIpCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_metal_gateway_elastic_ip_serialize( + id=id, + metal_gateway_elastic_ip_create_input=metal_gateway_elastic_ip_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "IPAssignment", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_metal_gateway_elastic_ip_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + metal_gateway_elastic_ip_create_input: MetalGatewayElasticIpCreateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IPAssignment]: + """Create a Metal Gateway Elastic IP + + Create a new Elastic IP on this Metal Gateway. Assign an IPv4 range as an elastic IP to the Metal Gateway, with a specified next-hop address contained within the Metal Gateway. Notice: Elastic IPs on Metal Gateways are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + + :param id: Metal Gateway UUID (required) + :type id: str + :param metal_gateway_elastic_ip_create_input: (required) + :type metal_gateway_elastic_ip_create_input: MetalGatewayElasticIpCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_metal_gateway_elastic_ip_serialize( + id=id, + metal_gateway_elastic_ip_create_input=metal_gateway_elastic_ip_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "IPAssignment", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_metal_gateway_elastic_ip_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + metal_gateway_elastic_ip_create_input: MetalGatewayElasticIpCreateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a Metal Gateway Elastic IP + + Create a new Elastic IP on this Metal Gateway. Assign an IPv4 range as an elastic IP to the Metal Gateway, with a specified next-hop address contained within the Metal Gateway. Notice: Elastic IPs on Metal Gateways are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + + :param id: Metal Gateway UUID (required) + :type id: str + :param metal_gateway_elastic_ip_create_input: (required) + :type metal_gateway_elastic_ip_create_input: MetalGatewayElasticIpCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_metal_gateway_elastic_ip_serialize( + id=id, + metal_gateway_elastic_ip_create_input=metal_gateway_elastic_ip_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "IPAssignment", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_metal_gateway_elastic_ip_serialize( + self, + id, + metal_gateway_elastic_ip_create_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if metal_gateway_elastic_ip_create_input is not None: + _body_params = metal_gateway_elastic_ip_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/metal-gateways/{id}/ips', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_metal_gateway( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FindMetalGatewayById200Response: + """Deletes the metal gateway + + Deletes a metal gateway and any elastic IP assignments associated with this metal gateway. + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_metal_gateway_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "FindMetalGatewayById200Response", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_metal_gateway_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FindMetalGatewayById200Response]: + """Deletes the metal gateway + + Deletes a metal gateway and any elastic IP assignments associated with this metal gateway. + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_metal_gateway_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "FindMetalGatewayById200Response", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_metal_gateway_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Deletes the metal gateway + + Deletes a metal gateway and any elastic IP assignments associated with this metal gateway. + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_metal_gateway_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "FindMetalGatewayById200Response", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_metal_gateway_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/metal-gateways/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_metal_gateway_by_id( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FindMetalGatewayById200Response: + """Returns the metal gateway + + Returns a specific metal gateway + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metal_gateway_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindMetalGatewayById200Response", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_metal_gateway_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FindMetalGatewayById200Response]: + """Returns the metal gateway + + Returns a specific metal gateway + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metal_gateway_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindMetalGatewayById200Response", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_metal_gateway_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Returns the metal gateway + + Returns a specific metal gateway + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metal_gateway_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindMetalGatewayById200Response", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_metal_gateway_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/metal-gateways/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_metal_gateways_by_project_all_pages(self, project_id : Annotated[StrictStr, Field(description="Project UUID")], include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> MetalGatewayList: # noqa: E501 + """Returns all metal gateways for a project # noqa: E501 + + This method is the same as find_metal_gateways_by_project, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_metal_gateways_by_project(}project_id, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param project_id: Project UUID (required) + :type project_id: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: MetalGatewayList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_metal_gateways_by_project(project_id, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.metal_gateways.extend(page_response.metal_gateways) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_metal_gateways_by_project( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MetalGatewayList: + """Returns all metal gateways for a project + + Return all metal gateways for a project + + :param project_id: Project UUID (required) + :type project_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metal_gateways_by_project_serialize( + project_id=project_id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetalGatewayList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_metal_gateways_by_project_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MetalGatewayList]: + """Returns all metal gateways for a project + + Return all metal gateways for a project + + :param project_id: Project UUID (required) + :type project_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metal_gateways_by_project_serialize( + project_id=project_id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetalGatewayList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_metal_gateways_by_project_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Returns all metal gateways for a project + + Return all metal gateways for a project + + :param project_id: Project UUID (required) + :type project_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metal_gateways_by_project_serialize( + project_id=project_id, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetalGatewayList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_metal_gateways_by_project_serialize( + self, + project_id, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{project_id}/metal-gateways', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_bgp_dynamic_neighbors( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpDynamicNeighborList: + """List BGP Dynamic Neighbors + + Returns the list of VRF BGP Dynamic Neighbors for this Metal Gateway + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_dynamic_neighbors_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpDynamicNeighborList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_bgp_dynamic_neighbors_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpDynamicNeighborList]: + """List BGP Dynamic Neighbors + + Returns the list of VRF BGP Dynamic Neighbors for this Metal Gateway + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_dynamic_neighbors_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpDynamicNeighborList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_bgp_dynamic_neighbors_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List BGP Dynamic Neighbors + + Returns the list of VRF BGP Dynamic Neighbors for this Metal Gateway + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_bgp_dynamic_neighbors_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpDynamicNeighborList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bgp_dynamic_neighbors_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/metal-gateways/{id}/bgp-dynamic-neighbors', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_metal_gateway_elastic_ips( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IPAssignmentList: + """List Metal Gateway Elastic IPs + + Returns the list of Elastic IPs assigned to this Metal Gateway + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_metal_gateway_elastic_ips_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPAssignmentList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_metal_gateway_elastic_ips_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IPAssignmentList]: + """List Metal Gateway Elastic IPs + + Returns the list of Elastic IPs assigned to this Metal Gateway + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_metal_gateway_elastic_ips_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPAssignmentList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_metal_gateway_elastic_ips_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Metal Gateway UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Metal Gateway Elastic IPs + + Returns the list of Elastic IPs assigned to this Metal Gateway + + :param id: Metal Gateway UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_metal_gateway_elastic_ips_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IPAssignmentList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_metal_gateway_elastic_ips_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/metal-gateways/{id}/ips', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/metros_api.py b/equinix/services/metalv1/api/metros_api.py new file mode 100644 index 00000000..28407fcb --- /dev/null +++ b/equinix/services/metalv1/api/metros_api.py @@ -0,0 +1,541 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from equinix.services.metalv1.models.metro import Metro +from equinix.services.metalv1.models.metro_list import MetroList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class MetrosApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def find_metros( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MetroList: + """Retrieve all metros + + Provides a listing of available metros + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metros_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetroList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_metros_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MetroList]: + """Retrieve all metros + + Provides a listing of available metros + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metros_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetroList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_metros_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all metros + + Provides a listing of available metros + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metros_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetroList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_metros_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/locations/metros', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_metro( + self, + id: Annotated[StrictStr, Field(description="Metro UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Metro: + """Retrieve a specific Metro's details + + Show the details for a metro, including name, code, and country. + + :param id: Metro UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_metro_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Metro", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_metro_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Metro UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Metro]: + """Retrieve a specific Metro's details + + Show the details for a metro, including name, code, and country. + + :param id: Metro UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_metro_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Metro", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_metro_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Metro UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a specific Metro's details + + Show the details for a metro, including name, code, and country. + + :param id: Metro UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_metro_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Metro", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_metro_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/locations/metros/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/operating_systems_api.py b/equinix/services/metalv1/api/operating_systems_api.py new file mode 100644 index 00000000..8f809fe0 --- /dev/null +++ b/equinix/services/metalv1/api/operating_systems_api.py @@ -0,0 +1,523 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from equinix.services.metalv1.models.operating_system_list import OperatingSystemList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class OperatingSystemsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def find_operating_system_version( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OperatingSystemList: + """Retrieve all operating system versions + + Provides a listing of available operating system versions. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_operating_system_version_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperatingSystemList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_operating_system_version_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OperatingSystemList]: + """Retrieve all operating system versions + + Provides a listing of available operating system versions. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_operating_system_version_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperatingSystemList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_operating_system_version_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all operating system versions + + Provides a listing of available operating system versions. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_operating_system_version_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperatingSystemList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_operating_system_version_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/operating-system-versions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_operating_systems( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OperatingSystemList: + """Retrieve all operating systems + + Provides a listing of available operating systems to provision your new device with. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_operating_systems_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperatingSystemList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_operating_systems_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OperatingSystemList]: + """Retrieve all operating systems + + Provides a listing of available operating systems to provision your new device with. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_operating_systems_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperatingSystemList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_operating_systems_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all operating systems + + Provides a listing of available operating systems to provision your new device with. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_operating_systems_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperatingSystemList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_operating_systems_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/operating-systems', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/organizations_api.py b/equinix/services/metalv1/api/organizations_api.py new file mode 100644 index 00000000..f6f14be2 --- /dev/null +++ b/equinix/services/metalv1/api/organizations_api.py @@ -0,0 +1,4782 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.invitation import Invitation +from equinix.services.metalv1.models.invitation_input import InvitationInput +from equinix.services.metalv1.models.invitation_list import InvitationList +from equinix.services.metalv1.models.operating_system_list import OperatingSystemList +from equinix.services.metalv1.models.organization import Organization +from equinix.services.metalv1.models.organization_input import OrganizationInput +from equinix.services.metalv1.models.organization_list import OrganizationList +from equinix.services.metalv1.models.payment_method import PaymentMethod +from equinix.services.metalv1.models.payment_method_create_input import PaymentMethodCreateInput +from equinix.services.metalv1.models.payment_method_list import PaymentMethodList +from equinix.services.metalv1.models.plan_list import PlanList +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.project_create_input import ProjectCreateInput +from equinix.services.metalv1.models.project_list import ProjectList +from equinix.services.metalv1.models.transfer_request_list import TransferRequestList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class OrganizationsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_organization( + self, + organization_input: Annotated[OrganizationInput, Field(description="Organization to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Organization: + """Create an organization + + Creates an organization. + + :param organization_input: Organization to create (required) + :type organization_input: OrganizationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_serialize( + organization_input=organization_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Organization", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_organization_with_http_info( + self, + organization_input: Annotated[OrganizationInput, Field(description="Organization to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Organization]: + """Create an organization + + Creates an organization. + + :param organization_input: Organization to create (required) + :type organization_input: OrganizationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_serialize( + organization_input=organization_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Organization", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_organization_without_preload_content( + self, + organization_input: Annotated[OrganizationInput, Field(description="Organization to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an organization + + Creates an organization. + + :param organization_input: Organization to create (required) + :type organization_input: OrganizationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_serialize( + organization_input=organization_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Organization", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_organization_serialize( + self, + organization_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if organization_input is not None: + _body_params = organization_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_organization_invitation( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + invitation_input: Annotated[InvitationInput, Field(description="Invitation to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Invitation: + """Create an invitation for an organization + + In order to add a user to an organization, they must first be invited. To invite to several projects the parameter `projects_ids:[a,b,c]` can be used + + :param id: Organization UUID (required) + :type id: str + :param invitation_input: Invitation to create (required) + :type invitation_input: InvitationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_invitation_serialize( + id=id, + invitation_input=invitation_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Invitation", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_organization_invitation_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + invitation_input: Annotated[InvitationInput, Field(description="Invitation to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Invitation]: + """Create an invitation for an organization + + In order to add a user to an organization, they must first be invited. To invite to several projects the parameter `projects_ids:[a,b,c]` can be used + + :param id: Organization UUID (required) + :type id: str + :param invitation_input: Invitation to create (required) + :type invitation_input: InvitationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_invitation_serialize( + id=id, + invitation_input=invitation_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Invitation", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_organization_invitation_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + invitation_input: Annotated[InvitationInput, Field(description="Invitation to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an invitation for an organization + + In order to add a user to an organization, they must first be invited. To invite to several projects the parameter `projects_ids:[a,b,c]` can be used + + :param id: Organization UUID (required) + :type id: str + :param invitation_input: Invitation to create (required) + :type invitation_input: InvitationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_invitation_serialize( + id=id, + invitation_input=invitation_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Invitation", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_organization_invitation_serialize( + self, + id, + invitation_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if invitation_input is not None: + _body_params = invitation_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/{id}/invitations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_organization_project( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + project_create_input: Annotated[ProjectCreateInput, Field(description="Project to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Create a project for the organization + + Creates a new project for the organization + + :param id: Organization UUID (required) + :type id: str + :param project_create_input: Project to create (required) + :type project_create_input: ProjectCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_project_serialize( + id=id, + project_create_input=project_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_organization_project_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + project_create_input: Annotated[ProjectCreateInput, Field(description="Project to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Create a project for the organization + + Creates a new project for the organization + + :param id: Organization UUID (required) + :type id: str + :param project_create_input: Project to create (required) + :type project_create_input: ProjectCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_project_serialize( + id=id, + project_create_input=project_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_organization_project_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + project_create_input: Annotated[ProjectCreateInput, Field(description="Project to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a project for the organization + + Creates a new project for the organization + + :param id: Organization UUID (required) + :type id: str + :param project_create_input: Project to create (required) + :type project_create_input: ProjectCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_project_serialize( + id=id, + project_create_input=project_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_organization_project_serialize( + self, + id, + project_create_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if project_create_input is not None: + _body_params = project_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/{id}/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_payment_method( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + payment_method_create_input: Annotated[PaymentMethodCreateInput, Field(description="Payment Method to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaymentMethod: + """Create a payment method for the given organization + + Creates a payment method. + + :param id: Organization UUID (required) + :type id: str + :param payment_method_create_input: Payment Method to create (required) + :type payment_method_create_input: PaymentMethodCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_payment_method_serialize( + id=id, + payment_method_create_input=payment_method_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PaymentMethod", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_payment_method_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + payment_method_create_input: Annotated[PaymentMethodCreateInput, Field(description="Payment Method to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaymentMethod]: + """Create a payment method for the given organization + + Creates a payment method. + + :param id: Organization UUID (required) + :type id: str + :param payment_method_create_input: Payment Method to create (required) + :type payment_method_create_input: PaymentMethodCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_payment_method_serialize( + id=id, + payment_method_create_input=payment_method_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PaymentMethod", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_payment_method_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + payment_method_create_input: Annotated[PaymentMethodCreateInput, Field(description="Payment Method to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a payment method for the given organization + + Creates a payment method. + + :param id: Organization UUID (required) + :type id: str + :param payment_method_create_input: Payment Method to create (required) + :type payment_method_create_input: PaymentMethodCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_payment_method_serialize( + id=id, + payment_method_create_input=payment_method_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PaymentMethod", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_payment_method_serialize( + self, + id, + payment_method_create_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if payment_method_create_input is not None: + _body_params = payment_method_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/{id}/payment-methods', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_organization( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the organization + + Deletes the organization. + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_organization_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_organization_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the organization + + Deletes the organization. + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_organization_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_organization_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the organization + + Deletes the organization. + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_organization_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_organization_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/organizations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_operating_systems_by_organization( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OperatingSystemList: + """Retrieve all operating systems visible by the organization + + Returns a listing of available operating systems for the given organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_operating_systems_by_organization_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperatingSystemList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_operating_systems_by_organization_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OperatingSystemList]: + """Retrieve all operating systems visible by the organization + + Returns a listing of available operating systems for the given organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_operating_systems_by_organization_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperatingSystemList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_operating_systems_by_organization_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all operating systems visible by the organization + + Returns a listing of available operating systems for the given organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_operating_systems_by_organization_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OperatingSystemList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_operating_systems_by_organization_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/operating-systems', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organization_by_id( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Organization: + """Retrieve an organization's details + + Returns a single organization's details, if the user is authorized to view it. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Organization", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Organization]: + """Retrieve an organization's details + + Returns a single organization's details, if the user is authorized to view it. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Organization", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve an organization's details + + Returns a single organization's details, if the user is authorized to view it. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Organization", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organization_customdata( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Retrieve the custom metadata of an organization + + Provides the custom metadata stored for this organization in json format + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_customdata_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Retrieve the custom metadata of an organization + + Provides the custom metadata stored for this organization in json format + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_customdata_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the custom metadata of an organization + + Provides the custom metadata stored for this organization in json format + + :param id: Organization UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_customdata_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/customdata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organization_invitations( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InvitationList: + """Retrieve organization invitations + + Returns all invitations in an organization. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_invitations_serialize( + id=id, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvitationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_invitations_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InvitationList]: + """Retrieve organization invitations + + Returns all invitations in an organization. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_invitations_serialize( + id=id, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvitationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_invitations_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve organization invitations + + Returns all invitations in an organization. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_invitations_serialize( + id=id, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvitationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_invitations_serialize( + self, + id, + include, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/invitations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organization_payment_methods( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaymentMethodList: + """Retrieve all payment methods of an organization + + Returns all payment methods of an organization. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_payment_methods_serialize( + id=id, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaymentMethodList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_payment_methods_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaymentMethodList]: + """Retrieve all payment methods of an organization + + Returns all payment methods of an organization. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_payment_methods_serialize( + id=id, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaymentMethodList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_payment_methods_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all payment methods of an organization + + Returns all payment methods of an organization. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_payment_methods_serialize( + id=id, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaymentMethodList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_payment_methods_serialize( + self, + id, + include, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/payment-methods', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organization_projects_all_pages(self, id : Annotated[StrictStr, Field(description="Organization UUID")], name : Annotated[Optional[StrictStr], Field(description="Filter results by name.")] = None, include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> ProjectList: # noqa: E501 + """Retrieve all projects of an organization # noqa: E501 + + This method is the same as find_organization_projects, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_organization_projects(}id, , }name, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param id: Organization UUID (required) + :type id: str + + :param name: Filter results by name. + :type name: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ProjectList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_organization_projects(id, name, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.projects.extend(page_response.projects) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_organization_projects( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + name: Annotated[Optional[StrictStr], Field(description="Filter results by name.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectList: + """Retrieve all projects of an organization + + Returns a collection of projects that belong to the organization. + + :param id: Organization UUID (required) + :type id: str + :param name: Filter results by name. + :type name: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_projects_serialize( + id=id, + name=name, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_projects_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + name: Annotated[Optional[StrictStr], Field(description="Filter results by name.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectList]: + """Retrieve all projects of an organization + + Returns a collection of projects that belong to the organization. + + :param id: Organization UUID (required) + :type id: str + :param name: Filter results by name. + :type name: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_projects_serialize( + id=id, + name=name, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_projects_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + name: Annotated[Optional[StrictStr], Field(description="Filter results by name.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all projects of an organization + + Returns a collection of projects that belong to the organization. + + :param id: Organization UUID (required) + :type id: str + :param name: Filter results by name. + :type name: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_projects_serialize( + id=id, + name=name, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_projects_serialize( + self, + id, + name, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if name is not None: + + _query_params.append(('name', name)) + + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organization_transfers( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TransferRequestList: + """Retrieve all project transfer requests from or to an organization + + Provides a collection of project transfer requests from or to the organization. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_transfers_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferRequestList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organization_transfers_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TransferRequestList]: + """Retrieve all project transfer requests from or to an organization + + Provides a collection of project transfer requests from or to the organization. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_transfers_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferRequestList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organization_transfers_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all project transfer requests from or to an organization + + Provides a collection of project transfer requests from or to the organization. + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organization_transfers_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferRequestList", + '401': "Error", + '403': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organization_transfers_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/transfers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_organizations_all_pages(self, personal : Annotated[Optional[StrictStr], Field(description="Include, exclude or show only personal organizations.")] = None, without_projects : Annotated[Optional[StrictStr], Field(description="Include, exclude or show only organizations that have no projects.")] = None, include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> OrganizationList: # noqa: E501 + """Retrieve all organizations # noqa: E501 + + This method is the same as find_organizations, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_organizations(}personal, , }without_projects, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param personal: Include, exclude or show only personal organizations. + :type personal: str + + :param without_projects: Include, exclude or show only organizations that have no projects. + :type without_projects: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: OrganizationList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_organizations(personal, without_projects, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.organizations.extend(page_response.organizations) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_organizations( + self, + personal: Annotated[Optional[StrictStr], Field(description="Include, exclude or show only personal organizations.")] = None, + without_projects: Annotated[Optional[StrictStr], Field(description="Include, exclude or show only organizations that have no projects.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OrganizationList: + """Retrieve all organizations + + Returns a list of organizations that are accessible to the current user. + + :param personal: Include, exclude or show only personal organizations. + :type personal: str + :param without_projects: Include, exclude or show only organizations that have no projects. + :type without_projects: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organizations_serialize( + personal=personal, + without_projects=without_projects, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_organizations_with_http_info( + self, + personal: Annotated[Optional[StrictStr], Field(description="Include, exclude or show only personal organizations.")] = None, + without_projects: Annotated[Optional[StrictStr], Field(description="Include, exclude or show only organizations that have no projects.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OrganizationList]: + """Retrieve all organizations + + Returns a list of organizations that are accessible to the current user. + + :param personal: Include, exclude or show only personal organizations. + :type personal: str + :param without_projects: Include, exclude or show only organizations that have no projects. + :type without_projects: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organizations_serialize( + personal=personal, + without_projects=without_projects, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_organizations_without_preload_content( + self, + personal: Annotated[Optional[StrictStr], Field(description="Include, exclude or show only personal organizations.")] = None, + without_projects: Annotated[Optional[StrictStr], Field(description="Include, exclude or show only organizations that have no projects.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all organizations + + Returns a list of organizations that are accessible to the current user. + + :param personal: Include, exclude or show only personal organizations. + :type personal: str + :param without_projects: Include, exclude or show only organizations that have no projects. + :type without_projects: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_organizations_serialize( + personal=personal, + without_projects=without_projects, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_organizations_serialize( + self, + personal, + without_projects, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if personal is not None: + + _query_params.append(('personal', personal)) + + if without_projects is not None: + + _query_params.append(('without_projects', without_projects)) + + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_plans_by_organization( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlanList: + """Retrieve all plans visible by the organization + + Returns a listing of available plans for the given organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_plans_by_organization_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlanList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_plans_by_organization_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlanList]: + """Retrieve all plans visible by the organization + + Returns a listing of available plans for the given organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_plans_by_organization_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlanList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_plans_by_organization_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all plans visible by the organization + + Returns a listing of available plans for the given organization + + :param id: Organization UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_plans_by_organization_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlanList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_plans_by_organization_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/{id}/plans', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_organization( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + organization_input: Annotated[OrganizationInput, Field(description="Organization to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Organization: + """Update the organization + + Updates the organization. + + :param id: Organization UUID (required) + :type id: str + :param organization_input: Organization to update (required) + :type organization_input: OrganizationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_organization_serialize( + id=id, + organization_input=organization_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Organization", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_organization_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + organization_input: Annotated[OrganizationInput, Field(description="Organization to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Organization]: + """Update the organization + + Updates the organization. + + :param id: Organization UUID (required) + :type id: str + :param organization_input: Organization to update (required) + :type organization_input: OrganizationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_organization_serialize( + id=id, + organization_input=organization_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Organization", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_organization_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Organization UUID")], + organization_input: Annotated[OrganizationInput, Field(description="Organization to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the organization + + Updates the organization. + + :param id: Organization UUID (required) + :type id: str + :param organization_input: Organization to update (required) + :type organization_input: OrganizationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_organization_serialize( + id=id, + organization_input=organization_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Organization", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_organization_serialize( + self, + id, + organization_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if organization_input is not None: + _body_params = organization_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/organizations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/otps_api.py b/equinix/services/metalv1/api/otps_api.py new file mode 100644 index 00000000..f5ee9f7d --- /dev/null +++ b/equinix/services/metalv1/api/otps_api.py @@ -0,0 +1,1052 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class OTPsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def find_ensure_otp( + self, + otp: Annotated[StrictStr, Field(description="OTP")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Verify user by providing an OTP + + It verifies the user once a valid OTP is provided. It gives back a session token, essentially logging in the user. + + :param otp: OTP (required) + :type otp: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ensure_otp_serialize( + otp=otp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_ensure_otp_with_http_info( + self, + otp: Annotated[StrictStr, Field(description="OTP")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Verify user by providing an OTP + + It verifies the user once a valid OTP is provided. It gives back a session token, essentially logging in the user. + + :param otp: OTP (required) + :type otp: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ensure_otp_serialize( + otp=otp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_ensure_otp_without_preload_content( + self, + otp: Annotated[StrictStr, Field(description="OTP")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Verify user by providing an OTP + + It verifies the user once a valid OTP is provided. It gives back a session token, essentially logging in the user. + + :param otp: OTP (required) + :type otp: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ensure_otp_serialize( + otp=otp, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_ensure_otp_serialize( + self, + otp, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if otp is not None: + _path_params['otp'] = otp + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/user/otp/verify/{otp}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_recovery_codes( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RecoveryCodeList: + """Retrieve my recovery codes + + Returns my recovery codes. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_recovery_codes_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RecoveryCodeList", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_recovery_codes_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RecoveryCodeList]: + """Retrieve my recovery codes + + Returns my recovery codes. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_recovery_codes_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RecoveryCodeList", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_recovery_codes_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve my recovery codes + + Returns my recovery codes. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_recovery_codes_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RecoveryCodeList", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_recovery_codes_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/user/otp/recovery-codes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def receive_codes( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Receive an OTP per sms + + Sends an OTP to the user's mobile phone. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._receive_codes_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '422': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def receive_codes_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Receive an OTP per sms + + Sends an OTP to the user's mobile phone. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._receive_codes_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '422': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def receive_codes_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Receive an OTP per sms + + Sends an OTP to the user's mobile phone. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._receive_codes_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "Error", + '401': "Error", + '422': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _receive_codes_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/user/otp/sms/receive', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def regenerate_codes( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RecoveryCodeList: + """Generate new recovery codes + + Generate a new set of recovery codes. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._regenerate_codes_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RecoveryCodeList", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def regenerate_codes_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RecoveryCodeList]: + """Generate new recovery codes + + Generate a new set of recovery codes. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._regenerate_codes_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RecoveryCodeList", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def regenerate_codes_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generate new recovery codes + + Generate a new set of recovery codes. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._regenerate_codes_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RecoveryCodeList", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _regenerate_codes_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/user/otp/recovery-codes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/password_reset_tokens_api.py b/equinix/services/metalv1/api/password_reset_tokens_api.py new file mode 100644 index 00000000..95f18e62 --- /dev/null +++ b/equinix/services/metalv1/api/password_reset_tokens_api.py @@ -0,0 +1,548 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from equinix.services.metalv1.models.new_password import NewPassword + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class PasswordResetTokensApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_password_reset_token( + self, + email: Annotated[StrictStr, Field(description="Email of user to create password reset token")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Create a password reset token + + Creates a password reset token + + :param email: Email of user to create password reset token (required) + :type email: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_password_reset_token_serialize( + email=email, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_password_reset_token_with_http_info( + self, + email: Annotated[StrictStr, Field(description="Email of user to create password reset token")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Create a password reset token + + Creates a password reset token + + :param email: Email of user to create password reset token (required) + :type email: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_password_reset_token_serialize( + email=email, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_password_reset_token_without_preload_content( + self, + email: Annotated[StrictStr, Field(description="Email of user to create password reset token")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a password reset token + + Creates a password reset token + + :param email: Email of user to create password reset token (required) + :type email: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_password_reset_token_serialize( + email=email, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_password_reset_token_serialize( + self, + email, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if email is not None: + + _query_params.append(('email', email)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/reset-password', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def reset_password( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NewPassword: + """Reset current user password + + Resets current user password. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reset_password_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "NewPassword", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def reset_password_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NewPassword]: + """Reset current user password + + Resets current user password. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reset_password_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "NewPassword", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def reset_password_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Reset current user password + + Resets current user password. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reset_password_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "NewPassword", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _reset_password_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/reset-password', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/payment_methods_api.py b/equinix/services/metalv1/api/payment_methods_api.py new file mode 100644 index 00000000..dafb9a36 --- /dev/null +++ b/equinix/services/metalv1/api/payment_methods_api.py @@ -0,0 +1,892 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.payment_method import PaymentMethod +from equinix.services.metalv1.models.payment_method_update_input import PaymentMethodUpdateInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class PaymentMethodsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def delete_payment_method( + self, + id: Annotated[StrictStr, Field(description="Payment Method UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the payment method + + Deletes the payment method. + + :param id: Payment Method UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_payment_method_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_payment_method_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Payment Method UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the payment method + + Deletes the payment method. + + :param id: Payment Method UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_payment_method_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_payment_method_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Payment Method UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the payment method + + Deletes the payment method. + + :param id: Payment Method UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_payment_method_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_payment_method_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/payment-methods/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_payment_method_by_id( + self, + id: Annotated[StrictStr, Field(description="Payment Method UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaymentMethod: + """Retrieve a payment method + + Returns a payment method + + :param id: Payment Method UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_payment_method_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaymentMethod", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_payment_method_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Payment Method UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaymentMethod]: + """Retrieve a payment method + + Returns a payment method + + :param id: Payment Method UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_payment_method_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaymentMethod", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_payment_method_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Payment Method UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a payment method + + Returns a payment method + + :param id: Payment Method UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_payment_method_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaymentMethod", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_payment_method_by_id_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/payment-methods/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_payment_method( + self, + id: Annotated[StrictStr, Field(description="Payment Method UUID")], + payment_method_update_input: Annotated[PaymentMethodUpdateInput, Field(description="Payment Method to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaymentMethod: + """Update the payment method + + Updates the payment method. + + :param id: Payment Method UUID (required) + :type id: str + :param payment_method_update_input: Payment Method to update (required) + :type payment_method_update_input: PaymentMethodUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_payment_method_serialize( + id=id, + payment_method_update_input=payment_method_update_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaymentMethod", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_payment_method_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Payment Method UUID")], + payment_method_update_input: Annotated[PaymentMethodUpdateInput, Field(description="Payment Method to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaymentMethod]: + """Update the payment method + + Updates the payment method. + + :param id: Payment Method UUID (required) + :type id: str + :param payment_method_update_input: Payment Method to update (required) + :type payment_method_update_input: PaymentMethodUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_payment_method_serialize( + id=id, + payment_method_update_input=payment_method_update_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaymentMethod", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_payment_method_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Payment Method UUID")], + payment_method_update_input: Annotated[PaymentMethodUpdateInput, Field(description="Payment Method to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the payment method + + Updates the payment method. + + :param id: Payment Method UUID (required) + :type id: str + :param payment_method_update_input: Payment Method to update (required) + :type payment_method_update_input: PaymentMethodUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_payment_method_serialize( + id=id, + payment_method_update_input=payment_method_update_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PaymentMethod", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_payment_method_serialize( + self, + id, + payment_method_update_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if payment_method_update_input is not None: + _body_params = payment_method_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/payment-methods/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/plans_api.py b/equinix/services/metalv1/api/plans_api.py new file mode 100644 index 00000000..e8ce2b7d --- /dev/null +++ b/equinix/services/metalv1/api/plans_api.py @@ -0,0 +1,671 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.plan_list import PlanList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class PlansApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def find_plans( + self, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter plans by its category")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter plans by its plan type")] = None, + slug: Annotated[Optional[StrictStr], Field(description="Filter plans by slug")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlanList: + """Retrieve all plans + + Provides a listing of available plans to provision your device on. + + :param categories: Filter plans by its category + :type categories: List[str] + :param type: Filter plans by its plan type + :type type: str + :param slug: Filter plans by slug + :type slug: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_plans_serialize( + categories=categories, + type=type, + slug=slug, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlanList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_plans_with_http_info( + self, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter plans by its category")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter plans by its plan type")] = None, + slug: Annotated[Optional[StrictStr], Field(description="Filter plans by slug")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlanList]: + """Retrieve all plans + + Provides a listing of available plans to provision your device on. + + :param categories: Filter plans by its category + :type categories: List[str] + :param type: Filter plans by its plan type + :type type: str + :param slug: Filter plans by slug + :type slug: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_plans_serialize( + categories=categories, + type=type, + slug=slug, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlanList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_plans_without_preload_content( + self, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter plans by its category")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter plans by its plan type")] = None, + slug: Annotated[Optional[StrictStr], Field(description="Filter plans by slug")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all plans + + Provides a listing of available plans to provision your device on. + + :param categories: Filter plans by its category + :type categories: List[str] + :param type: Filter plans by its plan type + :type type: str + :param slug: Filter plans by slug + :type slug: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_plans_serialize( + categories=categories, + type=type, + slug=slug, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlanList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_plans_serialize( + self, + categories, + type, + slug, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'categories[]': 'multi', + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if categories is not None: + + _query_params.append(('categories[]', categories)) + + if type is not None: + + _query_params.append(('type', type)) + + if slug is not None: + + _query_params.append(('slug', slug)) + + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/plans', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_plans_by_project( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlanList: + """Retrieve all plans visible by the project + + Returns a listing of available plans for the given project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_plans_by_project_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlanList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_plans_by_project_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlanList]: + """Retrieve all plans visible by the project + + Returns a listing of available plans for the given project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_plans_by_project_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlanList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_plans_by_project_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all plans visible by the project + + Returns a listing of available plans for the given project + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_plans_by_project_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PlanList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_plans_by_project_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/plans', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/ports_api.py b/equinix/services/metalv1/api/ports_api.py new file mode 100644 index 00000000..62099457 --- /dev/null +++ b/equinix/services/metalv1/api/ports_api.py @@ -0,0 +1,4228 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.models.port_assign_input import PortAssignInput +from equinix.services.metalv1.models.port_convert_layer3_input import PortConvertLayer3Input +from equinix.services.metalv1.models.port_vlan_assignment import PortVlanAssignment +from equinix.services.metalv1.models.port_vlan_assignment_batch import PortVlanAssignmentBatch +from equinix.services.metalv1.models.port_vlan_assignment_batch_create_input import PortVlanAssignmentBatchCreateInput +from equinix.services.metalv1.models.port_vlan_assignment_batch_list import PortVlanAssignmentBatchList +from equinix.services.metalv1.models.port_vlan_assignment_list import PortVlanAssignmentList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class PortsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def assign_native_vlan( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + vnid: Annotated[StrictStr, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Port: + """Assign a native VLAN + + Sets a virtual network on this port as a \"native VLAN\". The VLAN must have already been assigned using the using the \"Assign a port to a virtual network\" operation. + + :param id: Port UUID (required) + :type id: str + :param vnid: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type vnid: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_native_vlan_serialize( + id=id, + vnid=vnid, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def assign_native_vlan_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + vnid: Annotated[StrictStr, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Port]: + """Assign a native VLAN + + Sets a virtual network on this port as a \"native VLAN\". The VLAN must have already been assigned using the using the \"Assign a port to a virtual network\" operation. + + :param id: Port UUID (required) + :type id: str + :param vnid: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type vnid: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_native_vlan_serialize( + id=id, + vnid=vnid, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def assign_native_vlan_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + vnid: Annotated[StrictStr, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Assign a native VLAN + + Sets a virtual network on this port as a \"native VLAN\". The VLAN must have already been assigned using the using the \"Assign a port to a virtual network\" operation. + + :param id: Port UUID (required) + :type id: str + :param vnid: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type vnid: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_native_vlan_serialize( + id=id, + vnid=vnid, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _assign_native_vlan_serialize( + self, + id, + vnid, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if vnid is not None: + + _query_params.append(('vnid', vnid)) + + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/ports/{id}/native-vlan', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def assign_port( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_assign_input: Annotated[PortAssignInput, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Port: + """Assign a port to virtual network + + Assign a hardware port to a virtual network. + + :param id: Port UUID (required) + :type id: str + :param port_assign_input: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type port_assign_input: PortAssignInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_port_serialize( + id=id, + port_assign_input=port_assign_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def assign_port_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_assign_input: Annotated[PortAssignInput, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Port]: + """Assign a port to virtual network + + Assign a hardware port to a virtual network. + + :param id: Port UUID (required) + :type id: str + :param port_assign_input: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type port_assign_input: PortAssignInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_port_serialize( + id=id, + port_assign_input=port_assign_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def assign_port_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_assign_input: Annotated[PortAssignInput, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Assign a port to virtual network + + Assign a hardware port to a virtual network. + + :param id: Port UUID (required) + :type id: str + :param port_assign_input: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type port_assign_input: PortAssignInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_port_serialize( + id=id, + port_assign_input=port_assign_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _assign_port_serialize( + self, + id, + port_assign_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if port_assign_input is not None: + _body_params = port_assign_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/ports/{id}/assign', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def bond_port( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + bulk_enable: Annotated[Optional[StrictBool], Field(description="enable both ports")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Port: + """Enabling bonding + + Enabling bonding for one or all ports + + :param id: Port UUID (required) + :type id: str + :param bulk_enable: enable both ports + :type bulk_enable: bool + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bond_port_serialize( + id=id, + bulk_enable=bulk_enable, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def bond_port_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + bulk_enable: Annotated[Optional[StrictBool], Field(description="enable both ports")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Port]: + """Enabling bonding + + Enabling bonding for one or all ports + + :param id: Port UUID (required) + :type id: str + :param bulk_enable: enable both ports + :type bulk_enable: bool + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bond_port_serialize( + id=id, + bulk_enable=bulk_enable, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def bond_port_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + bulk_enable: Annotated[Optional[StrictBool], Field(description="enable both ports")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Enabling bonding + + Enabling bonding for one or all ports + + :param id: Port UUID (required) + :type id: str + :param bulk_enable: enable both ports + :type bulk_enable: bool + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bond_port_serialize( + id=id, + bulk_enable=bulk_enable, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _bond_port_serialize( + self, + id, + bulk_enable, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if bulk_enable is not None: + + _query_params.append(('bulk_enable', bulk_enable)) + + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/ports/{id}/bond', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def convert_layer2( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_assign_input: Annotated[PortAssignInput, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Port: + """Convert to Layer 2 + + Converts a bond port to Layer 2. IP assignments of the port will be removed. + + :param id: Port UUID (required) + :type id: str + :param port_assign_input: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type port_assign_input: PortAssignInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._convert_layer2_serialize( + id=id, + port_assign_input=port_assign_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def convert_layer2_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_assign_input: Annotated[PortAssignInput, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Port]: + """Convert to Layer 2 + + Converts a bond port to Layer 2. IP assignments of the port will be removed. + + :param id: Port UUID (required) + :type id: str + :param port_assign_input: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type port_assign_input: PortAssignInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._convert_layer2_serialize( + id=id, + port_assign_input=port_assign_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def convert_layer2_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_assign_input: Annotated[PortAssignInput, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Convert to Layer 2 + + Converts a bond port to Layer 2. IP assignments of the port will be removed. + + :param id: Port UUID (required) + :type id: str + :param port_assign_input: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type port_assign_input: PortAssignInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._convert_layer2_serialize( + id=id, + port_assign_input=port_assign_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _convert_layer2_serialize( + self, + id, + port_assign_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if port_assign_input is not None: + _body_params = port_assign_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/ports/{id}/convert/layer-2', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def convert_layer3( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + port_convert_layer3_input: Annotated[Optional[PortConvertLayer3Input], Field(description="IPs to request")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Port: + """Convert to Layer 3 + + Converts a bond port to Layer 3. VLANs must first be unassigned. + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param port_convert_layer3_input: IPs to request + :type port_convert_layer3_input: PortConvertLayer3Input + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._convert_layer3_serialize( + id=id, + include=include, + port_convert_layer3_input=port_convert_layer3_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def convert_layer3_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + port_convert_layer3_input: Annotated[Optional[PortConvertLayer3Input], Field(description="IPs to request")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Port]: + """Convert to Layer 3 + + Converts a bond port to Layer 3. VLANs must first be unassigned. + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param port_convert_layer3_input: IPs to request + :type port_convert_layer3_input: PortConvertLayer3Input + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._convert_layer3_serialize( + id=id, + include=include, + port_convert_layer3_input=port_convert_layer3_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def convert_layer3_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + port_convert_layer3_input: Annotated[Optional[PortConvertLayer3Input], Field(description="IPs to request")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Convert to Layer 3 + + Converts a bond port to Layer 3. VLANs must first be unassigned. + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param port_convert_layer3_input: IPs to request + :type port_convert_layer3_input: PortConvertLayer3Input + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._convert_layer3_serialize( + id=id, + include=include, + port_convert_layer3_input=port_convert_layer3_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _convert_layer3_serialize( + self, + id, + include, + port_convert_layer3_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if port_convert_layer3_input is not None: + _body_params = port_convert_layer3_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/ports/{id}/convert/layer-3', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_port_vlan_assignment_batch( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_vlan_assignment_batch_create_input: Annotated[PortVlanAssignmentBatchCreateInput, Field(description="VLAN Assignment batch details")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PortVlanAssignmentBatch: + """Create a new Port-VLAN Assignment management batch + + Create a new asynchronous batch request which handles adding and/or removing the VLANs to which the port is assigned. + + :param id: Port UUID (required) + :type id: str + :param port_vlan_assignment_batch_create_input: VLAN Assignment batch details (required) + :type port_vlan_assignment_batch_create_input: PortVlanAssignmentBatchCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_port_vlan_assignment_batch_serialize( + id=id, + port_vlan_assignment_batch_create_input=port_vlan_assignment_batch_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PortVlanAssignmentBatch", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_port_vlan_assignment_batch_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_vlan_assignment_batch_create_input: Annotated[PortVlanAssignmentBatchCreateInput, Field(description="VLAN Assignment batch details")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PortVlanAssignmentBatch]: + """Create a new Port-VLAN Assignment management batch + + Create a new asynchronous batch request which handles adding and/or removing the VLANs to which the port is assigned. + + :param id: Port UUID (required) + :type id: str + :param port_vlan_assignment_batch_create_input: VLAN Assignment batch details (required) + :type port_vlan_assignment_batch_create_input: PortVlanAssignmentBatchCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_port_vlan_assignment_batch_serialize( + id=id, + port_vlan_assignment_batch_create_input=port_vlan_assignment_batch_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PortVlanAssignmentBatch", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_port_vlan_assignment_batch_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_vlan_assignment_batch_create_input: Annotated[PortVlanAssignmentBatchCreateInput, Field(description="VLAN Assignment batch details")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new Port-VLAN Assignment management batch + + Create a new asynchronous batch request which handles adding and/or removing the VLANs to which the port is assigned. + + :param id: Port UUID (required) + :type id: str + :param port_vlan_assignment_batch_create_input: VLAN Assignment batch details (required) + :type port_vlan_assignment_batch_create_input: PortVlanAssignmentBatchCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_port_vlan_assignment_batch_serialize( + id=id, + port_vlan_assignment_batch_create_input=port_vlan_assignment_batch_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PortVlanAssignmentBatch", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_port_vlan_assignment_batch_serialize( + self, + id, + port_vlan_assignment_batch_create_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if port_vlan_assignment_batch_create_input is not None: + _body_params = port_vlan_assignment_batch_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/ports/{id}/vlan-assignments/batches', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_native_vlan( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Port: + """Remove native VLAN + + Removes the native VLAN from this port + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_native_vlan_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_native_vlan_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Port]: + """Remove native VLAN + + Removes the native VLAN from this port + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_native_vlan_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_native_vlan_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove native VLAN + + Removes the native VLAN from this port + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_native_vlan_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_native_vlan_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/ports/{id}/native-vlan', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def disbond_port( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + bulk_disable: Annotated[Optional[StrictBool], Field(description="disable both ports")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Port: + """Disabling bonding + + Disabling bonding for one or all ports + + :param id: Port UUID (required) + :type id: str + :param bulk_disable: disable both ports + :type bulk_disable: bool + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disbond_port_serialize( + id=id, + bulk_disable=bulk_disable, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def disbond_port_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + bulk_disable: Annotated[Optional[StrictBool], Field(description="disable both ports")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Port]: + """Disabling bonding + + Disabling bonding for one or all ports + + :param id: Port UUID (required) + :type id: str + :param bulk_disable: disable both ports + :type bulk_disable: bool + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disbond_port_serialize( + id=id, + bulk_disable=bulk_disable, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def disbond_port_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + bulk_disable: Annotated[Optional[StrictBool], Field(description="disable both ports")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Disabling bonding + + Disabling bonding for one or all ports + + :param id: Port UUID (required) + :type id: str + :param bulk_disable: disable both ports + :type bulk_disable: bool + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disbond_port_serialize( + id=id, + bulk_disable=bulk_disable, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _disbond_port_serialize( + self, + id, + bulk_disable, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if bulk_disable is not None: + + _query_params.append(('bulk_disable', bulk_disable)) + + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/ports/{id}/disbond', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_port_by_id( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Port: + """Retrieve a port + + Returns a port + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_port_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Port]: + """Retrieve a port + + Returns a port + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_port_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a port + + Returns a port + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_port_by_id_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/ports/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_port_vlan_assignment_batch_by_port_id_and_batch_id( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + batch_id: Annotated[StrictStr, Field(description="Batch ID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PortVlanAssignmentBatch: + """Retrieve a VLAN Assignment Batch's details + + Returns the details of an existing Port-VLAN Assignment batch, including the list of VLANs to assign or unassign, and the current state of the batch. + + :param id: Port UUID (required) + :type id: str + :param batch_id: Batch ID (required) + :type batch_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignment_batch_by_port_id_and_batch_id_serialize( + id=id, + batch_id=batch_id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignmentBatch", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_port_vlan_assignment_batch_by_port_id_and_batch_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + batch_id: Annotated[StrictStr, Field(description="Batch ID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PortVlanAssignmentBatch]: + """Retrieve a VLAN Assignment Batch's details + + Returns the details of an existing Port-VLAN Assignment batch, including the list of VLANs to assign or unassign, and the current state of the batch. + + :param id: Port UUID (required) + :type id: str + :param batch_id: Batch ID (required) + :type batch_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignment_batch_by_port_id_and_batch_id_serialize( + id=id, + batch_id=batch_id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignmentBatch", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_port_vlan_assignment_batch_by_port_id_and_batch_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + batch_id: Annotated[StrictStr, Field(description="Batch ID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a VLAN Assignment Batch's details + + Returns the details of an existing Port-VLAN Assignment batch, including the list of VLANs to assign or unassign, and the current state of the batch. + + :param id: Port UUID (required) + :type id: str + :param batch_id: Batch ID (required) + :type batch_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignment_batch_by_port_id_and_batch_id_serialize( + id=id, + batch_id=batch_id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignmentBatch", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_port_vlan_assignment_batch_by_port_id_and_batch_id_serialize( + self, + id, + batch_id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if batch_id is not None: + _path_params['batch_id'] = batch_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/ports/{id}/vlan-assignments/batches/{batch_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_port_vlan_assignment_batches( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PortVlanAssignmentBatchList: + """List the VLAN Assignment Batches for a port + + Show all the VLAN assignment batches that have been created for managing this port's VLAN assignments + + :param id: Port UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignment_batches_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignmentBatchList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_port_vlan_assignment_batches_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PortVlanAssignmentBatchList]: + """List the VLAN Assignment Batches for a port + + Show all the VLAN assignment batches that have been created for managing this port's VLAN assignments + + :param id: Port UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignment_batches_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignmentBatchList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_port_vlan_assignment_batches_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the VLAN Assignment Batches for a port + + Show all the VLAN assignment batches that have been created for managing this port's VLAN assignments + + :param id: Port UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignment_batches_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignmentBatchList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_port_vlan_assignment_batches_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/ports/{id}/vlan-assignments/batches', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_port_vlan_assignment_by_port_id_and_assignment_id( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + assignment_id: Annotated[StrictStr, Field(description="Assignment ID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PortVlanAssignment: + """Show a particular Port VLAN assignment's details + + Show the details of a specific Port-VLAN assignment, including the current state and if the VLAN is set as native. + + :param id: Port UUID (required) + :type id: str + :param assignment_id: Assignment ID (required) + :type assignment_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignment_by_port_id_and_assignment_id_serialize( + id=id, + assignment_id=assignment_id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignment", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_port_vlan_assignment_by_port_id_and_assignment_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + assignment_id: Annotated[StrictStr, Field(description="Assignment ID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PortVlanAssignment]: + """Show a particular Port VLAN assignment's details + + Show the details of a specific Port-VLAN assignment, including the current state and if the VLAN is set as native. + + :param id: Port UUID (required) + :type id: str + :param assignment_id: Assignment ID (required) + :type assignment_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignment_by_port_id_and_assignment_id_serialize( + id=id, + assignment_id=assignment_id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignment", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_port_vlan_assignment_by_port_id_and_assignment_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + assignment_id: Annotated[StrictStr, Field(description="Assignment ID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Show a particular Port VLAN assignment's details + + Show the details of a specific Port-VLAN assignment, including the current state and if the VLAN is set as native. + + :param id: Port UUID (required) + :type id: str + :param assignment_id: Assignment ID (required) + :type assignment_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignment_by_port_id_and_assignment_id_serialize( + id=id, + assignment_id=assignment_id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignment", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_port_vlan_assignment_by_port_id_and_assignment_id_serialize( + self, + id, + assignment_id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if assignment_id is not None: + _path_params['assignment_id'] = assignment_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/ports/{id}/vlan-assignments/{assignment_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_port_vlan_assignments( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PortVlanAssignmentList: + """List Current VLAN assignments for a port + + Show the port's current VLAN assignments, including if this VLAN is set as native, and the current state of the assignment (ex. 'assigned' or 'unassigning') + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignments_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignmentList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_port_vlan_assignments_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PortVlanAssignmentList]: + """List Current VLAN assignments for a port + + Show the port's current VLAN assignments, including if this VLAN is set as native, and the current state of the assignment (ex. 'assigned' or 'unassigning') + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignments_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignmentList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_port_vlan_assignments_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Current VLAN assignments for a port + + Show the port's current VLAN assignments, including if this VLAN is set as native, and the current state of the assignment (ex. 'assigned' or 'unassigning') + + :param id: Port UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_port_vlan_assignments_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PortVlanAssignmentList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_port_vlan_assignments_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/ports/{id}/vlan-assignments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def unassign_port( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_assign_input: Annotated[PortAssignInput, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Port: + """Unassign a port + + Unassign a port for a hardware. + + :param id: Port UUID (required) + :type id: str + :param port_assign_input: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type port_assign_input: PortAssignInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_port_serialize( + id=id, + port_assign_input=port_assign_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def unassign_port_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_assign_input: Annotated[PortAssignInput, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Port]: + """Unassign a port + + Unassign a port for a hardware. + + :param id: Port UUID (required) + :type id: str + :param port_assign_input: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type port_assign_input: PortAssignInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_port_serialize( + id=id, + port_assign_input=port_assign_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def unassign_port_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Port UUID")], + port_assign_input: Annotated[PortAssignInput, Field(description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001').")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Unassign a port + + Unassign a port for a hardware. + + :param id: Port UUID (required) + :type id: str + :param port_assign_input: Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). (required) + :type port_assign_input: PortAssignInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_port_serialize( + id=id, + port_assign_input=port_assign_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Port", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unassign_port_serialize( + self, + id, + port_assign_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if port_assign_input is not None: + _body_params = port_assign_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/ports/{id}/unassign', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/projects_api.py b/equinix/services/metalv1/api/projects_api.py new file mode 100644 index 00000000..76fec546 --- /dev/null +++ b/equinix/services/metalv1/api/projects_api.py @@ -0,0 +1,3469 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.invitation import Invitation +from equinix.services.metalv1.models.invitation_input import InvitationInput +from equinix.services.metalv1.models.invitation_list import InvitationList +from equinix.services.metalv1.models.membership_list import MembershipList +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.project_create_from_root_input import ProjectCreateFromRootInput +from equinix.services.metalv1.models.project_list import ProjectList +from equinix.services.metalv1.models.project_update_input import ProjectUpdateInput +from equinix.services.metalv1.models.transfer_request import TransferRequest +from equinix.services.metalv1.models.transfer_request_input import TransferRequestInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class ProjectsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_project( + self, + project_create_from_root_input: Annotated[ProjectCreateFromRootInput, Field(description="Project to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Create a project + + Creates a new project for the user's default organization. If the user does not have a default organization, the API will look for a personal organization belonging to the user with the name \"{User's Full Name} Projects\" to associate the project with. If that organization does not exist a new organization named \"{User's Full Name} Projects\" will be created and the new project will be tied to that organization. + + :param project_create_from_root_input: Project to create (required) + :type project_create_from_root_input: ProjectCreateFromRootInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_serialize( + project_create_from_root_input=project_create_from_root_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_project_with_http_info( + self, + project_create_from_root_input: Annotated[ProjectCreateFromRootInput, Field(description="Project to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Create a project + + Creates a new project for the user's default organization. If the user does not have a default organization, the API will look for a personal organization belonging to the user with the name \"{User's Full Name} Projects\" to associate the project with. If that organization does not exist a new organization named \"{User's Full Name} Projects\" will be created and the new project will be tied to that organization. + + :param project_create_from_root_input: Project to create (required) + :type project_create_from_root_input: ProjectCreateFromRootInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_serialize( + project_create_from_root_input=project_create_from_root_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_project_without_preload_content( + self, + project_create_from_root_input: Annotated[ProjectCreateFromRootInput, Field(description="Project to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a project + + Creates a new project for the user's default organization. If the user does not have a default organization, the API will look for a personal organization belonging to the user with the name \"{User's Full Name} Projects\" to associate the project with. If that organization does not exist a new organization named \"{User's Full Name} Projects\" will be created and the new project will be tied to that organization. + + :param project_create_from_root_input: Project to create (required) + :type project_create_from_root_input: ProjectCreateFromRootInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_serialize( + project_create_from_root_input=project_create_from_root_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_project_serialize( + self, + project_create_from_root_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if project_create_from_root_input is not None: + _body_params = project_create_from_root_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_project_invitation( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + invitation_input: Annotated[InvitationInput, Field(description="Invitation to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Invitation: + """Create an invitation for a project + + In order to add a user to a project, they must first be invited. + + :param project_id: Project UUID (required) + :type project_id: str + :param invitation_input: Invitation to create (required) + :type invitation_input: InvitationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_invitation_serialize( + project_id=project_id, + invitation_input=invitation_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Invitation", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_project_invitation_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + invitation_input: Annotated[InvitationInput, Field(description="Invitation to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Invitation]: + """Create an invitation for a project + + In order to add a user to a project, they must first be invited. + + :param project_id: Project UUID (required) + :type project_id: str + :param invitation_input: Invitation to create (required) + :type invitation_input: InvitationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_invitation_serialize( + project_id=project_id, + invitation_input=invitation_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Invitation", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_project_invitation_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + invitation_input: Annotated[InvitationInput, Field(description="Invitation to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an invitation for a project + + In order to add a user to a project, they must first be invited. + + :param project_id: Project UUID (required) + :type project_id: str + :param invitation_input: Invitation to create (required) + :type invitation_input: InvitationInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_invitation_serialize( + project_id=project_id, + invitation_input=invitation_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Invitation", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_project_invitation_serialize( + self, + project_id, + invitation_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if invitation_input is not None: + _body_params = invitation_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{project_id}/invitations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_transfer_request( + self, + id: Annotated[StrictStr, Field(description="UUID of the project to be transferred")], + transfer_request_input: Annotated[TransferRequestInput, Field(description="Transfer Request to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TransferRequest: + """(Deprecated) Create a transfer request + + Organization owners can transfer their projects to other organizations. + + :param id: UUID of the project to be transferred (required) + :type id: str + :param transfer_request_input: Transfer Request to create (required) + :type transfer_request_input: TransferRequestInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /projects/{id}/transfers is deprecated.", DeprecationWarning) + + _param = self._create_transfer_request_serialize( + id=id, + transfer_request_input=transfer_request_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TransferRequest", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_transfer_request_with_http_info( + self, + id: Annotated[StrictStr, Field(description="UUID of the project to be transferred")], + transfer_request_input: Annotated[TransferRequestInput, Field(description="Transfer Request to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TransferRequest]: + """(Deprecated) Create a transfer request + + Organization owners can transfer their projects to other organizations. + + :param id: UUID of the project to be transferred (required) + :type id: str + :param transfer_request_input: Transfer Request to create (required) + :type transfer_request_input: TransferRequestInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /projects/{id}/transfers is deprecated.", DeprecationWarning) + + _param = self._create_transfer_request_serialize( + id=id, + transfer_request_input=transfer_request_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TransferRequest", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_transfer_request_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="UUID of the project to be transferred")], + transfer_request_input: Annotated[TransferRequestInput, Field(description="Transfer Request to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Create a transfer request + + Organization owners can transfer their projects to other organizations. + + :param id: UUID of the project to be transferred (required) + :type id: str + :param transfer_request_input: Transfer Request to create (required) + :type transfer_request_input: TransferRequestInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /projects/{id}/transfers is deprecated.", DeprecationWarning) + + _param = self._create_transfer_request_serialize( + id=id, + transfer_request_input=transfer_request_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TransferRequest", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_transfer_request_serialize( + self, + id, + transfer_request_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if transfer_request_input is not None: + _body_params = transfer_request_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/transfers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_project( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the project + + Deletes the project. + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_project_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the project + + Deletes the project. + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_project_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the project + + Deletes the project. + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_project_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_ip_reservation_customdata( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + id: Annotated[StrictStr, Field(description="Ip Reservation UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Retrieve the custom metadata of an IP Reservation + + Provides the custom metadata stored for this IP Reservation in json format + + :param project_id: Project UUID (required) + :type project_id: str + :param id: Ip Reservation UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_reservation_customdata_serialize( + project_id=project_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_ip_reservation_customdata_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + id: Annotated[StrictStr, Field(description="Ip Reservation UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Retrieve the custom metadata of an IP Reservation + + Provides the custom metadata stored for this IP Reservation in json format + + :param project_id: Project UUID (required) + :type project_id: str + :param id: Ip Reservation UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_reservation_customdata_serialize( + project_id=project_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_ip_reservation_customdata_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + id: Annotated[StrictStr, Field(description="Ip Reservation UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the custom metadata of an IP Reservation + + Provides the custom metadata stored for this IP Reservation in json format + + :param project_id: Project UUID (required) + :type project_id: str + :param id: Ip Reservation UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ip_reservation_customdata_serialize( + project_id=project_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_ip_reservation_customdata_serialize( + self, + project_id, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{project_id}/ips/{id}/customdata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_by_id( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Retrieve a project + + Returns a single project if the user has access + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Retrieve a project + + Returns a single project if the user has access + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a project + + Returns a single project if the user has access + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_customdata( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Retrieve the custom metadata of a project + + Provides the custom metadata stored for this project in json format + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_customdata_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Retrieve the custom metadata of a project + + Provides the custom metadata stored for this project in json format + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_customdata_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the custom metadata of a project + + Provides the custom metadata stored for this project in json format + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_customdata_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/customdata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_invitations( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InvitationList: + """Retrieve project invitations + + Returns all invitations in a project. + + :param project_id: Project UUID (required) + :type project_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_invitations_serialize( + project_id=project_id, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvitationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_invitations_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InvitationList]: + """Retrieve project invitations + + Returns all invitations in a project. + + :param project_id: Project UUID (required) + :type project_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_invitations_serialize( + project_id=project_id, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvitationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_invitations_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve project invitations + + Returns all invitations in a project. + + :param project_id: Project UUID (required) + :type project_id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_invitations_serialize( + project_id=project_id, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvitationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_invitations_serialize( + self, + project_id, + include, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{project_id}/invitations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_memberships( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + search: Annotated[Optional[StrictStr], Field(description="Search by member full name, id and email.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MembershipList: + """Retrieve project memberships + + Returns all memberships in a project. + + :param project_id: Project UUID (required) + :type project_id: str + :param search: Search by member full name, id and email. + :type search: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_memberships_serialize( + project_id=project_id, + search=search, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MembershipList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_memberships_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + search: Annotated[Optional[StrictStr], Field(description="Search by member full name, id and email.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MembershipList]: + """Retrieve project memberships + + Returns all memberships in a project. + + :param project_id: Project UUID (required) + :type project_id: str + :param search: Search by member full name, id and email. + :type search: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_memberships_serialize( + project_id=project_id, + search=search, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MembershipList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_memberships_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + search: Annotated[Optional[StrictStr], Field(description="Search by member full name, id and email.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve project memberships + + Returns all memberships in a project. + + :param project_id: Project UUID (required) + :type project_id: str + :param search: Search by member full name, id and email. + :type search: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_memberships_serialize( + project_id=project_id, + search=search, + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MembershipList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_memberships_serialize( + self, + project_id, + search, + include, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if include is not None: + + _query_params.append(('include', include)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{project_id}/memberships', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_projects_all_pages(self, name : Annotated[Optional[StrictStr], Field(description="Filter results by name.")] = None, include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> ProjectList: # noqa: E501 + """Retrieve all projects # noqa: E501 + + This method is the same as find_projects, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_projects(}name, , }include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param name: Filter results by name. + :type name: str + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ProjectList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_projects(name, include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.projects.extend(page_response.projects) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_projects( + self, + name: Annotated[Optional[StrictStr], Field(description="Filter results by name.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectList: + """Retrieve all projects + + Returns a collection of projects that the current user is a member of. + + :param name: Filter results by name. + :type name: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_projects_serialize( + name=name, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_projects_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="Filter results by name.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectList]: + """Retrieve all projects + + Returns a collection of projects that the current user is a member of. + + :param name: Filter results by name. + :type name: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_projects_serialize( + name=name, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_projects_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="Filter results by name.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all projects + + Returns a collection of projects that the current user is a member of. + + :param name: Filter results by name. + :type name: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_projects_serialize( + name=name, + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_projects_serialize( + self, + name, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(('name', name)) + + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_project( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + project_update_input: Annotated[ProjectUpdateInput, Field(description="Project to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Update the project + + Updates the project. + + :param id: Project UUID (required) + :type id: str + :param project_update_input: Project to update (required) + :type project_update_input: ProjectUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_serialize( + id=id, + project_update_input=project_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_project_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + project_update_input: Annotated[ProjectUpdateInput, Field(description="Project to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Update the project + + Updates the project. + + :param id: Project UUID (required) + :type id: str + :param project_update_input: Project to update (required) + :type project_update_input: ProjectUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_serialize( + id=id, + project_update_input=project_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_project_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + project_update_input: Annotated[ProjectUpdateInput, Field(description="Project to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the project + + Updates the project. + + :param id: Project UUID (required) + :type id: str + :param project_update_input: Project to update (required) + :type project_update_input: ProjectUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_serialize( + id=id, + project_update_input=project_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_project_serialize( + self, + id, + project_update_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if project_update_input is not None: + _body_params = project_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/self_service_reservations_api.py b/equinix/services/metalv1/api/self_service_reservations_api.py new file mode 100644 index 00000000..d9428dcd --- /dev/null +++ b/equinix/services/metalv1/api/self_service_reservations_api.py @@ -0,0 +1,918 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.create_self_service_reservation_request import CreateSelfServiceReservationRequest +from equinix.services.metalv1.models.self_service_reservation_list import SelfServiceReservationList +from equinix.services.metalv1.models.self_service_reservation_response import SelfServiceReservationResponse + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class SelfServiceReservationsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_self_service_reservation( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + create_self_service_reservation_request: Annotated[CreateSelfServiceReservationRequest, Field(description="reservation to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SelfServiceReservationResponse: + """Create a reservation + + Creates a reservation. + + :param project_id: Project UUID (required) + :type project_id: str + :param create_self_service_reservation_request: reservation to create (required) + :type create_self_service_reservation_request: CreateSelfServiceReservationRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_self_service_reservation_serialize( + project_id=project_id, + create_self_service_reservation_request=create_self_service_reservation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SelfServiceReservationResponse", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_self_service_reservation_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + create_self_service_reservation_request: Annotated[CreateSelfServiceReservationRequest, Field(description="reservation to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SelfServiceReservationResponse]: + """Create a reservation + + Creates a reservation. + + :param project_id: Project UUID (required) + :type project_id: str + :param create_self_service_reservation_request: reservation to create (required) + :type create_self_service_reservation_request: CreateSelfServiceReservationRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_self_service_reservation_serialize( + project_id=project_id, + create_self_service_reservation_request=create_self_service_reservation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SelfServiceReservationResponse", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_self_service_reservation_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + create_self_service_reservation_request: Annotated[CreateSelfServiceReservationRequest, Field(description="reservation to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a reservation + + Creates a reservation. + + :param project_id: Project UUID (required) + :type project_id: str + :param create_self_service_reservation_request: reservation to create (required) + :type create_self_service_reservation_request: CreateSelfServiceReservationRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_self_service_reservation_serialize( + project_id=project_id, + create_self_service_reservation_request=create_self_service_reservation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SelfServiceReservationResponse", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_self_service_reservation_serialize( + self, + project_id, + create_self_service_reservation_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_self_service_reservation_request is not None: + _body_params = create_self_service_reservation_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{project_id}/self-service/reservations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_self_service_reservation( + self, + id: Annotated[StrictStr, Field(description="Reservation short_id")], + project_id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SelfServiceReservationResponse: + """Retrieve a reservation + + Returns a reservation + + :param id: Reservation short_id (required) + :type id: str + :param project_id: Project UUID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_self_service_reservation_serialize( + id=id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SelfServiceReservationResponse", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_self_service_reservation_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Reservation short_id")], + project_id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SelfServiceReservationResponse]: + """Retrieve a reservation + + Returns a reservation + + :param id: Reservation short_id (required) + :type id: str + :param project_id: Project UUID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_self_service_reservation_serialize( + id=id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SelfServiceReservationResponse", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_self_service_reservation_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Reservation short_id")], + project_id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a reservation + + Returns a reservation + + :param id: Reservation short_id (required) + :type id: str + :param project_id: Project UUID (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_self_service_reservation_serialize( + id=id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SelfServiceReservationResponse", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_self_service_reservation_serialize( + self, + id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if project_id is not None: + _path_params['project_id'] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{project_id}/self-service/reservations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_self_service_reservations( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter reservations by items category")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SelfServiceReservationList: + """Retrieve all reservations + + Returns all reservations. + + :param project_id: Project UUID (required) + :type project_id: str + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param categories: Filter reservations by items category + :type categories: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_self_service_reservations_serialize( + project_id=project_id, + page=page, + per_page=per_page, + categories=categories, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SelfServiceReservationList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_self_service_reservations_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter reservations by items category")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SelfServiceReservationList]: + """Retrieve all reservations + + Returns all reservations. + + :param project_id: Project UUID (required) + :type project_id: str + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param categories: Filter reservations by items category + :type categories: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_self_service_reservations_serialize( + project_id=project_id, + page=page, + per_page=per_page, + categories=categories, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SelfServiceReservationList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_self_service_reservations_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project UUID")], + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + categories: Annotated[Optional[List[StrictStr]], Field(description="Filter reservations by items category")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all reservations + + Returns all reservations. + + :param project_id: Project UUID (required) + :type project_id: str + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param categories: Filter reservations by items category + :type categories: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_self_service_reservations_serialize( + project_id=project_id, + page=page, + per_page=per_page, + categories=categories, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SelfServiceReservationList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_self_service_reservations_serialize( + self, + project_id, + page, + per_page, + categories, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'categories': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + if categories is not None: + + _query_params.append(('categories', categories)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{project_id}/self-service/reservations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/spot_market_api.py b/equinix/services/metalv1/api/spot_market_api.py new file mode 100644 index 00000000..6e532c5d --- /dev/null +++ b/equinix/services/metalv1/api/spot_market_api.py @@ -0,0 +1,2057 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.spot_market_prices_list import SpotMarketPricesList +from equinix.services.metalv1.models.spot_market_prices_per_metro_list import SpotMarketPricesPerMetroList +from equinix.services.metalv1.models.spot_market_request import SpotMarketRequest +from equinix.services.metalv1.models.spot_market_request_create_input import SpotMarketRequestCreateInput +from equinix.services.metalv1.models.spot_market_request_list import SpotMarketRequestList +from equinix.services.metalv1.models.spot_prices_history_report import SpotPricesHistoryReport + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class SpotMarketApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_spot_market_request( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + spot_market_request_create_input: Annotated[SpotMarketRequestCreateInput, Field(description="Spot Market Request to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SpotMarketRequest: + """Create a spot market request + + Creates a new spot market request. Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan. The features attribute allows you to optionally specify what features your server should have. For example, if you require a server with a TPM chip, you may specify `{ \"features\": { \"tpm\": \"required\" } }` (or `{ \"features\": [\"tpm\"] }` in shorthand). The request will fail if there are no available servers matching your criteria. 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 (see the example request below). The request will not fail if we have no servers with that feature in our inventory. + + :param id: Project UUID (required) + :type id: str + :param spot_market_request_create_input: Spot Market Request to create (required) + :type spot_market_request_create_input: SpotMarketRequestCreateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_spot_market_request_serialize( + id=id, + spot_market_request_create_input=spot_market_request_create_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SpotMarketRequest", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_spot_market_request_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + spot_market_request_create_input: Annotated[SpotMarketRequestCreateInput, Field(description="Spot Market Request to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SpotMarketRequest]: + """Create a spot market request + + Creates a new spot market request. Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan. The features attribute allows you to optionally specify what features your server should have. For example, if you require a server with a TPM chip, you may specify `{ \"features\": { \"tpm\": \"required\" } }` (or `{ \"features\": [\"tpm\"] }` in shorthand). The request will fail if there are no available servers matching your criteria. 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 (see the example request below). The request will not fail if we have no servers with that feature in our inventory. + + :param id: Project UUID (required) + :type id: str + :param spot_market_request_create_input: Spot Market Request to create (required) + :type spot_market_request_create_input: SpotMarketRequestCreateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_spot_market_request_serialize( + id=id, + spot_market_request_create_input=spot_market_request_create_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SpotMarketRequest", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_spot_market_request_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + spot_market_request_create_input: Annotated[SpotMarketRequestCreateInput, Field(description="Spot Market Request to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a spot market request + + Creates a new spot market request. Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan. The features attribute allows you to optionally specify what features your server should have. For example, if you require a server with a TPM chip, you may specify `{ \"features\": { \"tpm\": \"required\" } }` (or `{ \"features\": [\"tpm\"] }` in shorthand). The request will fail if there are no available servers matching your criteria. 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 (see the example request below). The request will not fail if we have no servers with that feature in our inventory. + + :param id: Project UUID (required) + :type id: str + :param spot_market_request_create_input: Spot Market Request to create (required) + :type spot_market_request_create_input: SpotMarketRequestCreateInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_spot_market_request_serialize( + id=id, + spot_market_request_create_input=spot_market_request_create_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SpotMarketRequest", + '401': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_spot_market_request_serialize( + self, + id, + spot_market_request_create_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if spot_market_request_create_input is not None: + _body_params = spot_market_request_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/spot-market-requests', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_spot_market_request( + self, + id: Annotated[StrictStr, Field(description="SpotMarketRequest UUID")], + force_termination: Annotated[Optional[StrictBool], Field(description="Terminate associated spot instances")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the spot market request + + Deletes the spot market request. + + :param id: SpotMarketRequest UUID (required) + :type id: str + :param force_termination: Terminate associated spot instances + :type force_termination: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_spot_market_request_serialize( + id=id, + force_termination=force_termination, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_spot_market_request_with_http_info( + self, + id: Annotated[StrictStr, Field(description="SpotMarketRequest UUID")], + force_termination: Annotated[Optional[StrictBool], Field(description="Terminate associated spot instances")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the spot market request + + Deletes the spot market request. + + :param id: SpotMarketRequest UUID (required) + :type id: str + :param force_termination: Terminate associated spot instances + :type force_termination: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_spot_market_request_serialize( + id=id, + force_termination=force_termination, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_spot_market_request_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="SpotMarketRequest UUID")], + force_termination: Annotated[Optional[StrictBool], Field(description="Terminate associated spot instances")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the spot market request + + Deletes the spot market request. + + :param id: SpotMarketRequest UUID (required) + :type id: str + :param force_termination: Terminate associated spot instances + :type force_termination: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_spot_market_request_serialize( + id=id, + force_termination=force_termination, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_spot_market_request_serialize( + self, + id, + force_termination, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if force_termination is not None: + + _query_params.append(('force_termination', force_termination)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/spot-market-requests/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_metro_spot_market_prices( + self, + metro: Annotated[Optional[StrictStr], Field(description="Metro to filter spot market prices")] = None, + plan: Annotated[Optional[StrictStr], Field(description="Plan to filter spot market prices")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SpotMarketPricesPerMetroList: + """Get current spot market prices for metros + + Get Equinix Metal current spot market prices for all metros. + + :param metro: Metro to filter spot market prices + :type metro: str + :param plan: Plan to filter spot market prices + :type plan: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metro_spot_market_prices_serialize( + metro=metro, + plan=plan, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketPricesPerMetroList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_metro_spot_market_prices_with_http_info( + self, + metro: Annotated[Optional[StrictStr], Field(description="Metro to filter spot market prices")] = None, + plan: Annotated[Optional[StrictStr], Field(description="Plan to filter spot market prices")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SpotMarketPricesPerMetroList]: + """Get current spot market prices for metros + + Get Equinix Metal current spot market prices for all metros. + + :param metro: Metro to filter spot market prices + :type metro: str + :param plan: Plan to filter spot market prices + :type plan: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metro_spot_market_prices_serialize( + metro=metro, + plan=plan, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketPricesPerMetroList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_metro_spot_market_prices_without_preload_content( + self, + metro: Annotated[Optional[StrictStr], Field(description="Metro to filter spot market prices")] = None, + plan: Annotated[Optional[StrictStr], Field(description="Plan to filter spot market prices")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get current spot market prices for metros + + Get Equinix Metal current spot market prices for all metros. + + :param metro: Metro to filter spot market prices + :type metro: str + :param plan: Plan to filter spot market prices + :type plan: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_metro_spot_market_prices_serialize( + metro=metro, + plan=plan, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketPricesPerMetroList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_metro_spot_market_prices_serialize( + self, + metro, + plan, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if metro is not None: + + _query_params.append(('metro', metro)) + + if plan is not None: + + _query_params.append(('plan', plan)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/market/spot/prices/metros', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_spot_market_prices( + self, + facility: Annotated[Optional[StrictStr], Field(description="Facility to check spot market prices")] = None, + plan: Annotated[Optional[StrictStr], Field(description="Plan to check spot market prices")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SpotMarketPricesList: + """Get current spot market prices + + Get Equinix Metal current spot market prices. + + :param facility: Facility to check spot market prices + :type facility: str + :param plan: Plan to check spot market prices + :type plan: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_spot_market_prices_serialize( + facility=facility, + plan=plan, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketPricesList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_spot_market_prices_with_http_info( + self, + facility: Annotated[Optional[StrictStr], Field(description="Facility to check spot market prices")] = None, + plan: Annotated[Optional[StrictStr], Field(description="Plan to check spot market prices")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SpotMarketPricesList]: + """Get current spot market prices + + Get Equinix Metal current spot market prices. + + :param facility: Facility to check spot market prices + :type facility: str + :param plan: Plan to check spot market prices + :type plan: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_spot_market_prices_serialize( + facility=facility, + plan=plan, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketPricesList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_spot_market_prices_without_preload_content( + self, + facility: Annotated[Optional[StrictStr], Field(description="Facility to check spot market prices")] = None, + plan: Annotated[Optional[StrictStr], Field(description="Plan to check spot market prices")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get current spot market prices + + Get Equinix Metal current spot market prices. + + :param facility: Facility to check spot market prices + :type facility: str + :param plan: Plan to check spot market prices + :type plan: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_spot_market_prices_serialize( + facility=facility, + plan=plan, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketPricesList", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_spot_market_prices_serialize( + self, + facility, + plan, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if facility is not None: + + _query_params.append(('facility', facility)) + + if plan is not None: + + _query_params.append(('plan', plan)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/market/spot/prices', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_spot_market_prices_history( + self, + facility: Annotated[StrictStr, Field(description="Facility to check spot market prices")], + plan: Annotated[StrictStr, Field(description="Plan to check spot market prices")], + var_from: Annotated[StrictStr, Field(description="Timestamp from range")], + until: Annotated[StrictStr, Field(description="Timestamp to range")], + metro: Annotated[Optional[StrictStr], Field(description="Metro to check spot market price history")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SpotPricesHistoryReport: + """Get spot market prices for a given period of time + + Get spot market prices for a given plan and facility in a fixed period of time *Note: In the `200` response, the property `datapoints` contains arrays of `[float, integer]`.* + + :param facility: Facility to check spot market prices (required) + :type facility: str + :param plan: Plan to check spot market prices (required) + :type plan: str + :param var_from: Timestamp from range (required) + :type var_from: str + :param until: Timestamp to range (required) + :type until: str + :param metro: Metro to check spot market price history + :type metro: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_spot_market_prices_history_serialize( + facility=facility, + plan=plan, + var_from=var_from, + until=until, + metro=metro, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotPricesHistoryReport", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_spot_market_prices_history_with_http_info( + self, + facility: Annotated[StrictStr, Field(description="Facility to check spot market prices")], + plan: Annotated[StrictStr, Field(description="Plan to check spot market prices")], + var_from: Annotated[StrictStr, Field(description="Timestamp from range")], + until: Annotated[StrictStr, Field(description="Timestamp to range")], + metro: Annotated[Optional[StrictStr], Field(description="Metro to check spot market price history")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SpotPricesHistoryReport]: + """Get spot market prices for a given period of time + + Get spot market prices for a given plan and facility in a fixed period of time *Note: In the `200` response, the property `datapoints` contains arrays of `[float, integer]`.* + + :param facility: Facility to check spot market prices (required) + :type facility: str + :param plan: Plan to check spot market prices (required) + :type plan: str + :param var_from: Timestamp from range (required) + :type var_from: str + :param until: Timestamp to range (required) + :type until: str + :param metro: Metro to check spot market price history + :type metro: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_spot_market_prices_history_serialize( + facility=facility, + plan=plan, + var_from=var_from, + until=until, + metro=metro, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotPricesHistoryReport", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_spot_market_prices_history_without_preload_content( + self, + facility: Annotated[StrictStr, Field(description="Facility to check spot market prices")], + plan: Annotated[StrictStr, Field(description="Plan to check spot market prices")], + var_from: Annotated[StrictStr, Field(description="Timestamp from range")], + until: Annotated[StrictStr, Field(description="Timestamp to range")], + metro: Annotated[Optional[StrictStr], Field(description="Metro to check spot market price history")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get spot market prices for a given period of time + + Get spot market prices for a given plan and facility in a fixed period of time *Note: In the `200` response, the property `datapoints` contains arrays of `[float, integer]`.* + + :param facility: Facility to check spot market prices (required) + :type facility: str + :param plan: Plan to check spot market prices (required) + :type plan: str + :param var_from: Timestamp from range (required) + :type var_from: str + :param until: Timestamp to range (required) + :type until: str + :param metro: Metro to check spot market price history + :type metro: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_spot_market_prices_history_serialize( + facility=facility, + plan=plan, + var_from=var_from, + until=until, + metro=metro, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotPricesHistoryReport", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_spot_market_prices_history_serialize( + self, + facility, + plan, + var_from, + until, + metro, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if facility is not None: + + _query_params.append(('facility', facility)) + + if plan is not None: + + _query_params.append(('plan', plan)) + + if metro is not None: + + _query_params.append(('metro', metro)) + + if var_from is not None: + + _query_params.append(('from', var_from)) + + if until is not None: + + _query_params.append(('until', until)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/market/spot/prices/history', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_spot_market_request_by_id( + self, + id: Annotated[StrictStr, Field(description="SpotMarketRequest UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SpotMarketRequest: + """Retrieve a spot market request + + Returns a single spot market request + + :param id: SpotMarketRequest UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_spot_market_request_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketRequest", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_spot_market_request_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="SpotMarketRequest UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SpotMarketRequest]: + """Retrieve a spot market request + + Returns a single spot market request + + :param id: SpotMarketRequest UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_spot_market_request_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketRequest", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_spot_market_request_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="SpotMarketRequest UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a spot market request + + Returns a single spot market request + + :param id: SpotMarketRequest UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_spot_market_request_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketRequest", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_spot_market_request_by_id_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/spot-market-requests/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def list_spot_market_requests( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SpotMarketRequestList: + """List spot market requests + + View all spot market requests for a given project. + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_spot_market_requests_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketRequestList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_spot_market_requests_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SpotMarketRequestList]: + """List spot market requests + + View all spot market requests for a given project. + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_spot_market_requests_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketRequestList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_spot_market_requests_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List spot market requests + + View all spot market requests for a given project. + + :param id: Project UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_spot_market_requests_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpotMarketRequestList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_spot_market_requests_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/spot-market-requests', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/ssh_keys_api.py b/equinix/services/metalv1/api/ssh_keys_api.py new file mode 100644 index 00000000..e0843d86 --- /dev/null +++ b/equinix/services/metalv1/api/ssh_keys_api.py @@ -0,0 +1,2371 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.ssh_key import SSHKey +from equinix.services.metalv1.models.ssh_key_create_input import SSHKeyCreateInput +from equinix.services.metalv1.models.ssh_key_input import SSHKeyInput +from equinix.services.metalv1.models.ssh_key_list import SSHKeyList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class SSHKeysApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_project_ssh_key( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + ssh_key_create_input: Annotated[SSHKeyCreateInput, Field(description="ssh key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SSHKey: + """Create a ssh key for the given project + + Creates a ssh key. + + :param id: Project UUID (required) + :type id: str + :param ssh_key_create_input: ssh key to create (required) + :type ssh_key_create_input: SSHKeyCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_ssh_key_serialize( + id=id, + ssh_key_create_input=ssh_key_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SSHKey", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_project_ssh_key_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + ssh_key_create_input: Annotated[SSHKeyCreateInput, Field(description="ssh key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SSHKey]: + """Create a ssh key for the given project + + Creates a ssh key. + + :param id: Project UUID (required) + :type id: str + :param ssh_key_create_input: ssh key to create (required) + :type ssh_key_create_input: SSHKeyCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_ssh_key_serialize( + id=id, + ssh_key_create_input=ssh_key_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SSHKey", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_project_ssh_key_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + ssh_key_create_input: Annotated[SSHKeyCreateInput, Field(description="ssh key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a ssh key for the given project + + Creates a ssh key. + + :param id: Project UUID (required) + :type id: str + :param ssh_key_create_input: ssh key to create (required) + :type ssh_key_create_input: SSHKeyCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_ssh_key_serialize( + id=id, + ssh_key_create_input=ssh_key_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SSHKey", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_project_ssh_key_serialize( + self, + id, + ssh_key_create_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if ssh_key_create_input is not None: + _body_params = ssh_key_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/ssh-keys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_ssh_key( + self, + ssh_key_create_input: Annotated[SSHKeyCreateInput, Field(description="ssh key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SSHKey: + """Create a ssh key for the current user + + Creates a ssh key. + + :param ssh_key_create_input: ssh key to create (required) + :type ssh_key_create_input: SSHKeyCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ssh_key_serialize( + ssh_key_create_input=ssh_key_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SSHKey", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_ssh_key_with_http_info( + self, + ssh_key_create_input: Annotated[SSHKeyCreateInput, Field(description="ssh key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SSHKey]: + """Create a ssh key for the current user + + Creates a ssh key. + + :param ssh_key_create_input: ssh key to create (required) + :type ssh_key_create_input: SSHKeyCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ssh_key_serialize( + ssh_key_create_input=ssh_key_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SSHKey", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_ssh_key_without_preload_content( + self, + ssh_key_create_input: Annotated[SSHKeyCreateInput, Field(description="ssh key to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a ssh key for the current user + + Creates a ssh key. + + :param ssh_key_create_input: ssh key to create (required) + :type ssh_key_create_input: SSHKeyCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ssh_key_serialize( + ssh_key_create_input=ssh_key_create_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SSHKey", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_ssh_key_serialize( + self, + ssh_key_create_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if ssh_key_create_input is not None: + _body_params = ssh_key_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/ssh-keys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_ssh_key( + self, + id: Annotated[StrictStr, Field(description="ssh key UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the ssh key + + Deletes the ssh key. + + :param id: ssh key UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_ssh_key_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_ssh_key_with_http_info( + self, + id: Annotated[StrictStr, Field(description="ssh key UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the ssh key + + Deletes the ssh key. + + :param id: ssh key UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_ssh_key_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_ssh_key_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="ssh key UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the ssh key + + Deletes the ssh key. + + :param id: ssh key UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_ssh_key_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_ssh_key_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/ssh-keys/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_device_ssh_keys( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + search_string: Annotated[Optional[StrictStr], Field(description="Search by key, label, or fingerprint")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SSHKeyList: + """Retrieve a device's ssh keys + + Returns a collection of the device's ssh keys. + + :param id: Project UUID (required) + :type id: str + :param search_string: Search by key, label, or fingerprint + :type search_string: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_ssh_keys_serialize( + id=id, + search_string=search_string, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKeyList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_device_ssh_keys_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + search_string: Annotated[Optional[StrictStr], Field(description="Search by key, label, or fingerprint")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SSHKeyList]: + """Retrieve a device's ssh keys + + Returns a collection of the device's ssh keys. + + :param id: Project UUID (required) + :type id: str + :param search_string: Search by key, label, or fingerprint + :type search_string: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_ssh_keys_serialize( + id=id, + search_string=search_string, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKeyList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_device_ssh_keys_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + search_string: Annotated[Optional[StrictStr], Field(description="Search by key, label, or fingerprint")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a device's ssh keys + + Returns a collection of the device's ssh keys. + + :param id: Project UUID (required) + :type id: str + :param search_string: Search by key, label, or fingerprint + :type search_string: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_ssh_keys_serialize( + id=id, + search_string=search_string, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKeyList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_device_ssh_keys_serialize( + self, + id, + search_string, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if search_string is not None: + + _query_params.append(('Search string', search_string)) + + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/ssh-keys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_ssh_keys( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + query: Annotated[Optional[StrictStr], Field(description="Search by key, label, or fingerprint")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SSHKeyList: + """Retrieve a project's ssh keys + + Returns a collection of the project's ssh keys. + + :param id: Project UUID (required) + :type id: str + :param query: Search by key, label, or fingerprint + :type query: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_ssh_keys_serialize( + id=id, + query=query, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKeyList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_ssh_keys_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + query: Annotated[Optional[StrictStr], Field(description="Search by key, label, or fingerprint")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SSHKeyList]: + """Retrieve a project's ssh keys + + Returns a collection of the project's ssh keys. + + :param id: Project UUID (required) + :type id: str + :param query: Search by key, label, or fingerprint + :type query: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_ssh_keys_serialize( + id=id, + query=query, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKeyList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_ssh_keys_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + query: Annotated[Optional[StrictStr], Field(description="Search by key, label, or fingerprint")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a project's ssh keys + + Returns a collection of the project's ssh keys. + + :param id: Project UUID (required) + :type id: str + :param query: Search by key, label, or fingerprint + :type query: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_ssh_keys_serialize( + id=id, + query=query, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKeyList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_ssh_keys_serialize( + self, + id, + query, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if query is not None: + + _query_params.append(('query', query)) + + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/ssh-keys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_ssh_key_by_id( + self, + id: Annotated[StrictStr, Field(description="SSH Key UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SSHKey: + """Retrieve a ssh key + + Returns a single ssh key if the user has access + + :param id: SSH Key UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ssh_key_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKey", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_ssh_key_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="SSH Key UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SSHKey]: + """Retrieve a ssh key + + Returns a single ssh key if the user has access + + :param id: SSH Key UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ssh_key_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKey", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_ssh_key_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="SSH Key UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a ssh key + + Returns a single ssh key if the user has access + + :param id: SSH Key UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ssh_key_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKey", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_ssh_key_by_id_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/ssh-keys/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_ssh_keys( + self, + search: Annotated[Optional[StrictStr], Field(description="Search by key, label, or fingerprint")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SSHKeyList: + """Retrieve all ssh keys + + Returns a collection of the user’s ssh keys. + + :param search: Search by key, label, or fingerprint + :type search: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ssh_keys_serialize( + search=search, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKeyList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_ssh_keys_with_http_info( + self, + search: Annotated[Optional[StrictStr], Field(description="Search by key, label, or fingerprint")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SSHKeyList]: + """Retrieve all ssh keys + + Returns a collection of the user’s ssh keys. + + :param search: Search by key, label, or fingerprint + :type search: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ssh_keys_serialize( + search=search, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKeyList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_ssh_keys_without_preload_content( + self, + search: Annotated[Optional[StrictStr], Field(description="Search by key, label, or fingerprint")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all ssh keys + + Returns a collection of the user’s ssh keys. + + :param search: Search by key, label, or fingerprint + :type search: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_ssh_keys_serialize( + search=search, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKeyList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_ssh_keys_serialize( + self, + search, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/ssh-keys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_ssh_key( + self, + id: Annotated[StrictStr, Field(description="SSH Key UUID")], + ssh_key_input: Annotated[SSHKeyInput, Field(description="ssh key to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SSHKey: + """Update the ssh key + + Updates the ssh key. + + :param id: SSH Key UUID (required) + :type id: str + :param ssh_key_input: ssh key to update (required) + :type ssh_key_input: SSHKeyInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ssh_key_serialize( + id=id, + ssh_key_input=ssh_key_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKey", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_ssh_key_with_http_info( + self, + id: Annotated[StrictStr, Field(description="SSH Key UUID")], + ssh_key_input: Annotated[SSHKeyInput, Field(description="ssh key to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SSHKey]: + """Update the ssh key + + Updates the ssh key. + + :param id: SSH Key UUID (required) + :type id: str + :param ssh_key_input: ssh key to update (required) + :type ssh_key_input: SSHKeyInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ssh_key_serialize( + id=id, + ssh_key_input=ssh_key_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKey", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_ssh_key_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="SSH Key UUID")], + ssh_key_input: Annotated[SSHKeyInput, Field(description="ssh key to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the ssh key + + Updates the ssh key. + + :param id: SSH Key UUID (required) + :type id: str + :param ssh_key_input: ssh key to update (required) + :type ssh_key_input: SSHKeyInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_ssh_key_serialize( + id=id, + ssh_key_input=ssh_key_input, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SSHKey", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_ssh_key_serialize( + self, + id, + ssh_key_input, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if ssh_key_input is not None: + _body_params = ssh_key_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/ssh-keys/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/support_request_api.py b/equinix/services/metalv1/api/support_request_api.py new file mode 100644 index 00000000..6167ba61 --- /dev/null +++ b/equinix/services/metalv1/api/support_request_api.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from equinix.services.metalv1.models.support_request_input import SupportRequestInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class SupportRequestApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def request_support( + self, + support_request_input: Annotated[SupportRequestInput, Field(description="Support Request to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Create a support ticket + + Support Ticket. + + :param support_request_input: Support Request to create (required) + :type support_request_input: SupportRequestInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._request_support_serialize( + support_request_input=support_request_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def request_support_with_http_info( + self, + support_request_input: Annotated[SupportRequestInput, Field(description="Support Request to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Create a support ticket + + Support Ticket. + + :param support_request_input: Support Request to create (required) + :type support_request_input: SupportRequestInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._request_support_serialize( + support_request_input=support_request_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def request_support_without_preload_content( + self, + support_request_input: Annotated[SupportRequestInput, Field(description="Support Request to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a support ticket + + Support Ticket. + + :param support_request_input: Support Request to create (required) + :type support_request_input: SupportRequestInput + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._request_support_serialize( + support_request_input=support_request_input, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _request_support_serialize( + self, + support_request_input, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if support_request_input is not None: + _body_params = support_request_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/support-requests', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/transfer_requests_api.py b/equinix/services/metalv1/api/transfer_requests_api.py new file mode 100644 index 00000000..e101f7ff --- /dev/null +++ b/equinix/services/metalv1/api/transfer_requests_api.py @@ -0,0 +1,851 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.transfer_request import TransferRequest + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class TransferRequestsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def accept_transfer_request( + self, + id: Annotated[StrictStr, Field(description="Transfer request UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Accept a transfer request + + Accept a transfer request. + + :param id: Transfer request UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._accept_transfer_request_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def accept_transfer_request_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Transfer request UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Accept a transfer request + + Accept a transfer request. + + :param id: Transfer request UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._accept_transfer_request_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def accept_transfer_request_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Transfer request UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Accept a transfer request + + Accept a transfer request. + + :param id: Transfer request UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._accept_transfer_request_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _accept_transfer_request_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/transfers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def decline_transfer_request( + self, + id: Annotated[StrictStr, Field(description="Transfer request UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Decline a transfer request + + Decline a transfer request. + + :param id: Transfer request UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._decline_transfer_request_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def decline_transfer_request_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Transfer request UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Decline a transfer request + + Decline a transfer request. + + :param id: Transfer request UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._decline_transfer_request_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def decline_transfer_request_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Transfer request UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Decline a transfer request + + Decline a transfer request. + + :param id: Transfer request UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._decline_transfer_request_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _decline_transfer_request_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/transfers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_transfer_request_by_id( + self, + id: Annotated[StrictStr, Field(description="Transfer request UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TransferRequest: + """View a transfer request + + Returns a single transfer request. + + :param id: Transfer request UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_transfer_request_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferRequest", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_transfer_request_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Transfer request UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TransferRequest]: + """View a transfer request + + Returns a single transfer request. + + :param id: Transfer request UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_transfer_request_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferRequest", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_transfer_request_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Transfer request UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """View a transfer request + + Returns a single transfer request. + + :param id: Transfer request UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_transfer_request_by_id_serialize( + id=id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferRequest", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_transfer_request_by_id_serialize( + self, + id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/transfers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/two_factor_auth_api.py b/equinix/services/metalv1/api/two_factor_auth_api.py new file mode 100644 index 00000000..e69c12d2 --- /dev/null +++ b/equinix/services/metalv1/api/two_factor_auth_api.py @@ -0,0 +1,1016 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class TwoFactorAuthApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def disable_tfa_app( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Disable two factor authentication + + Disables two factor authentication. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disable_tfa_app_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def disable_tfa_app_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Disable two factor authentication + + Disables two factor authentication. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disable_tfa_app_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def disable_tfa_app_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Disable two factor authentication + + Disables two factor authentication. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disable_tfa_app_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _disable_tfa_app_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/user/otp/app', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def disable_tfa_sms( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Disable two factor authentication + + Disables two factor authentication. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disable_tfa_sms_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def disable_tfa_sms_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Disable two factor authentication + + Disables two factor authentication. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disable_tfa_sms_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def disable_tfa_sms_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Disable two factor authentication + + Disables two factor authentication. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._disable_tfa_sms_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _disable_tfa_sms_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/user/otp/sms', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def enable_tfa_app( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Enable two factor auth using app + + Enables two factor authentication using authenticator app. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enable_tfa_app_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def enable_tfa_app_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Enable two factor auth using app + + Enables two factor authentication using authenticator app. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enable_tfa_app_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def enable_tfa_app_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Enable two factor auth using app + + Enables two factor authentication using authenticator app. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enable_tfa_app_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _enable_tfa_app_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/user/otp/app', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def enable_tfa_sms( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Enable two factor auth using sms + + Enables two factor authentication with sms. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enable_tfa_sms_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def enable_tfa_sms_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Enable two factor auth using sms + + Enables two factor authentication with sms. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enable_tfa_sms_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def enable_tfa_sms_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Enable two factor auth using sms + + Enables two factor authentication with sms. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enable_tfa_sms_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _enable_tfa_sms_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/user/otp/sms', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/usages_api.py b/equinix/services/metalv1/api/usages_api.py new file mode 100644 index 00000000..7cf14862 --- /dev/null +++ b/equinix/services/metalv1/api/usages_api.py @@ -0,0 +1,631 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.device_usage_list import DeviceUsageList +from equinix.services.metalv1.models.project_usage_list import ProjectUsageList + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class UsagesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def find_device_usages( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + created_after: Annotated[Optional[StrictStr], Field(description="Filter usages created after this date")] = None, + created_before: Annotated[Optional[StrictStr], Field(description="Filter usages created before this date")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DeviceUsageList: + """Retrieve all usages for device + + Returns all usages for a device. + + :param id: Device UUID (required) + :type id: str + :param created_after: Filter usages created after this date + :type created_after: str + :param created_before: Filter usages created before this date + :type created_before: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_usages_serialize( + id=id, + created_after=created_after, + created_before=created_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceUsageList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_device_usages_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + created_after: Annotated[Optional[StrictStr], Field(description="Filter usages created after this date")] = None, + created_before: Annotated[Optional[StrictStr], Field(description="Filter usages created before this date")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DeviceUsageList]: + """Retrieve all usages for device + + Returns all usages for a device. + + :param id: Device UUID (required) + :type id: str + :param created_after: Filter usages created after this date + :type created_after: str + :param created_before: Filter usages created before this date + :type created_before: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_usages_serialize( + id=id, + created_after=created_after, + created_before=created_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceUsageList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_device_usages_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Device UUID")], + created_after: Annotated[Optional[StrictStr], Field(description="Filter usages created after this date")] = None, + created_before: Annotated[Optional[StrictStr], Field(description="Filter usages created before this date")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all usages for device + + Returns all usages for a device. + + :param id: Device UUID (required) + :type id: str + :param created_after: Filter usages created after this date + :type created_after: str + :param created_before: Filter usages created before this date + :type created_before: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_device_usages_serialize( + id=id, + created_after=created_after, + created_before=created_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeviceUsageList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_device_usages_serialize( + self, + id, + created_after, + created_before, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if created_after is not None: + + _query_params.append(('created[after]', created_after)) + + if created_before is not None: + + _query_params.append(('created[before]', created_before)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}/usages', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_project_usage( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + created_after: Annotated[Optional[StrictStr], Field(description="Filter usages created after this date")] = None, + created_before: Annotated[Optional[StrictStr], Field(description="Filter usages created before this date")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectUsageList: + """Retrieve all usages for project + + Returns all usages for a project. + + :param id: Project UUID (required) + :type id: str + :param created_after: Filter usages created after this date + :type created_after: str + :param created_before: Filter usages created before this date + :type created_before: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_usage_serialize( + id=id, + created_after=created_after, + created_before=created_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectUsageList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_project_usage_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + created_after: Annotated[Optional[StrictStr], Field(description="Filter usages created after this date")] = None, + created_before: Annotated[Optional[StrictStr], Field(description="Filter usages created before this date")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectUsageList]: + """Retrieve all usages for project + + Returns all usages for a project. + + :param id: Project UUID (required) + :type id: str + :param created_after: Filter usages created after this date + :type created_after: str + :param created_before: Filter usages created before this date + :type created_before: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_usage_serialize( + id=id, + created_after=created_after, + created_before=created_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectUsageList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_project_usage_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + created_after: Annotated[Optional[StrictStr], Field(description="Filter usages created after this date")] = None, + created_before: Annotated[Optional[StrictStr], Field(description="Filter usages created before this date")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all usages for project + + Returns all usages for a project. + + :param id: Project UUID (required) + :type id: str + :param created_after: Filter usages created after this date + :type created_after: str + :param created_before: Filter usages created before this date + :type created_before: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_project_usage_serialize( + id=id, + created_after=created_after, + created_before=created_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectUsageList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_project_usage_serialize( + self, + id, + created_after, + created_before, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if created_after is not None: + + _query_params.append(('created[after]', created_after)) + + if created_before is not None: + + _query_params.append(('created[before]', created_before)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/usages', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/user_verification_tokens_api.py b/equinix/services/metalv1/api/user_verification_tokens_api.py new file mode 100644 index 00000000..5d47106e --- /dev/null +++ b/equinix/services/metalv1/api/user_verification_tokens_api.py @@ -0,0 +1,613 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.verify_email import VerifyEmail + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class UserVerificationTokensApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def consume_verification_request( + self, + verify_email: Annotated[VerifyEmail, Field(description="Email to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Verify a user using an email verification token + + Consumes an email verification token and verifies the user associated with it. + + :param verify_email: Email to create (required) + :type verify_email: VerifyEmail + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._consume_verification_request_serialize( + verify_email=verify_email, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def consume_verification_request_with_http_info( + self, + verify_email: Annotated[VerifyEmail, Field(description="Email to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Verify a user using an email verification token + + Consumes an email verification token and verifies the user associated with it. + + :param verify_email: Email to create (required) + :type verify_email: VerifyEmail + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._consume_verification_request_serialize( + verify_email=verify_email, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def consume_verification_request_without_preload_content( + self, + verify_email: Annotated[VerifyEmail, Field(description="Email to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Verify a user using an email verification token + + Consumes an email verification token and verifies the user associated with it. + + :param verify_email: Email to create (required) + :type verify_email: VerifyEmail + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._consume_verification_request_serialize( + verify_email=verify_email, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _consume_verification_request_serialize( + self, + verify_email, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if verify_email is not None: + _body_params = verify_email + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/verify-email', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_validation_request( + self, + login: Annotated[StrictStr, Field(description="Email for verification request")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Create an email verification request + + Creates an email verification request + + :param login: Email for verification request (required) + :type login: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_validation_request_serialize( + login=login, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_validation_request_with_http_info( + self, + login: Annotated[StrictStr, Field(description="Email for verification request")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Create an email verification request + + Creates an email verification request + + :param login: Email for verification request (required) + :type login: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_validation_request_serialize( + login=login, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_validation_request_without_preload_content( + self, + login: Annotated[StrictStr, Field(description="Email for verification request")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an email verification request + + Creates an email verification request + + :param login: Email for verification request (required) + :type login: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_validation_request_serialize( + login=login, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_validation_request_serialize( + self, + login, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if login is not None: + + _query_params.append(('login', login)) + + if include is not None: + + _query_params.append(('include', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/verify-email', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/userdata_api.py b/equinix/services/metalv1/api/userdata_api.py new file mode 100644 index 00000000..19496743 --- /dev/null +++ b/equinix/services/metalv1/api/userdata_api.py @@ -0,0 +1,301 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class UserdataApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def validate_userdata( + self, + userdata: Annotated[Optional[StrictStr], Field(description="Userdata to validate")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Validate user data + + Validates user data (Userdata) + + :param userdata: Userdata to validate + :type userdata: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._validate_userdata_serialize( + userdata=userdata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def validate_userdata_with_http_info( + self, + userdata: Annotated[Optional[StrictStr], Field(description="Userdata to validate")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Validate user data + + Validates user data (Userdata) + + :param userdata: Userdata to validate + :type userdata: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._validate_userdata_serialize( + userdata=userdata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def validate_userdata_without_preload_content( + self, + userdata: Annotated[Optional[StrictStr], Field(description="Userdata to validate")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Validate user data + + Validates user data (Userdata) + + :param userdata: Userdata to validate + :type userdata: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._validate_userdata_serialize( + userdata=userdata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _validate_userdata_serialize( + self, + userdata, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if userdata is not None: + + _query_params.append(('userdata', userdata)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/userdata/validate', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/users_api.py b/equinix/services/metalv1/api/users_api.py new file mode 100644 index 00000000..d1f040ef --- /dev/null +++ b/equinix/services/metalv1/api/users_api.py @@ -0,0 +1,2178 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.invitation_list import InvitationList +from equinix.services.metalv1.models.user import User +from equinix.services.metalv1.models.user_create_input import UserCreateInput +from equinix.services.metalv1.models.user_list import UserList +from equinix.services.metalv1.models.user_update_input import UserUpdateInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class UsersApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_user( + self, + user_create_input: Annotated[UserCreateInput, Field(description="User to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Create a user + + Creates a user. + + :param user_create_input: User to create (required) + :type user_create_input: UserCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + user_create_input=user_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_user_with_http_info( + self, + user_create_input: Annotated[UserCreateInput, Field(description="User to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Create a user + + Creates a user. + + :param user_create_input: User to create (required) + :type user_create_input: UserCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + user_create_input=user_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_user_without_preload_content( + self, + user_create_input: Annotated[UserCreateInput, Field(description="User to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a user + + Creates a user. + + :param user_create_input: User to create (required) + :type user_create_input: UserCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + user_create_input=user_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_user_serialize( + self, + user_create_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if user_create_input is not None: + _body_params = user_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_current_user( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """Retrieve the current user + + Returns the user object for the currently logged-in user. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_current_user_serialize( + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_current_user_with_http_info( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """Retrieve the current user + + Returns the user object for the currently logged-in user. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_current_user_serialize( + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_current_user_without_preload_content( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the current user + + Returns the user object for the currently logged-in user. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_current_user_serialize( + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_current_user_serialize( + self, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/user', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_invitations( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InvitationList: + """Retrieve current user invitations + + Returns all invitations in current user. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_invitations_serialize( + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvitationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_invitations_with_http_info( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InvitationList]: + """Retrieve current user invitations + + Returns all invitations in current user. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_invitations_serialize( + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvitationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_invitations_without_preload_content( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve current user invitations + + Returns all invitations in current user. + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_invitations_serialize( + include=include, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InvitationList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_invitations_serialize( + self, + include, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/invitations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_user_by_id( + self, + id: Annotated[StrictStr, Field(description="User UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """Retrieve a user + + Returns a single user if the user has access + + :param id: User UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_user_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_user_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="User UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """Retrieve a user + + Returns a single user if the user has access + + :param id: User UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_user_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_user_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="User UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a user + + Returns a single user if the user has access + + :param id: User UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_user_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_user_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/users/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_user_customdata( + self, + id: Annotated[StrictStr, Field(description="User UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Retrieve the custom metadata of a user + + Provides the custom metadata stored for this user in json format + + :param id: User UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_user_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_user_customdata_with_http_info( + self, + id: Annotated[StrictStr, Field(description="User UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Retrieve the custom metadata of a user + + Provides the custom metadata stored for this user in json format + + :param id: User UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_user_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_user_customdata_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="User UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the custom metadata of a user + + Provides the custom metadata stored for this user in json format + + :param id: User UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_user_customdata_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_user_customdata_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/users/{id}/customdata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_users_all_pages(self, include : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, exclude : Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, per_page : Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, **kwargs) -> UserList: # noqa: E501 + """Retrieve all users # noqa: E501 + + This method is the same as find_users, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.find_users(}include, , }exclude, , }, }per_page, , async_req=True) + >>> result = thread.get() + + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + + :param per_page: Items returned per page + :type per_page: int + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: UserList + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.find_users(include, exclude, page, per_page, **kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.users.extend(page_response.users) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + + @validate_call + def find_users( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserList: + """Retrieve all users + + Returns a list of users that the are accessible to the current user (all users in the current user’s projects, essentially). + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_users_serialize( + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_users_with_http_info( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserList]: + """Retrieve all users + + Returns a list of users that the are accessible to the current user (all users in the current user’s projects, essentially). + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_users_serialize( + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_users_without_preload_content( + self, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + page: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=1)]], Field(description="Page to return")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Items returned per page")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all users + + Returns a list of users that the are accessible to the current user (all users in the current user’s projects, essentially). + + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param page: Page to return + :type page: int + :param per_page: Items returned per page + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_users_serialize( + include=include, + exclude=exclude, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + '401': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_users_serialize( + self, + include, + exclude, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_current_user( + self, + user_update_input: Annotated[UserUpdateInput, Field(description="User to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """Update the current user + + Updates the currently logged-in user. + + :param user_update_input: User to update (required) + :type user_update_input: UserUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_current_user_serialize( + user_update_input=user_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_current_user_with_http_info( + self, + user_update_input: Annotated[UserUpdateInput, Field(description="User to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """Update the current user + + Updates the currently logged-in user. + + :param user_update_input: User to update (required) + :type user_update_input: UserUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_current_user_serialize( + user_update_input=user_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_current_user_without_preload_content( + self, + user_update_input: Annotated[UserUpdateInput, Field(description="User to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the current user + + Updates the currently logged-in user. + + :param user_update_input: User to update (required) + :type user_update_input: UserUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_current_user_serialize( + user_update_input=user_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + '401': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_current_user_serialize( + self, + user_update_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if user_update_input is not None: + _body_params = user_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/user', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/vlans_api.py b/equinix/services/metalv1/api/vlans_api.py new file mode 100644 index 00000000..3bbe4d7f --- /dev/null +++ b/equinix/services/metalv1/api/vlans_api.py @@ -0,0 +1,1651 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.virtual_network import VirtualNetwork +from equinix.services.metalv1.models.virtual_network_create_input import VirtualNetworkCreateInput +from equinix.services.metalv1.models.virtual_network_list import VirtualNetworkList +from equinix.services.metalv1.models.virtual_network_update_input import VirtualNetworkUpdateInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class VLANsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def create_virtual_network( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + virtual_network_create_input: Annotated[VirtualNetworkCreateInput, Field(description="Virtual Network to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VirtualNetwork: + """Create a virtual network + + Creates an virtual network. + + :param id: Project UUID (required) + :type id: str + :param virtual_network_create_input: Virtual Network to create (required) + :type virtual_network_create_input: VirtualNetworkCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_virtual_network_serialize( + id=id, + virtual_network_create_input=virtual_network_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VirtualNetwork", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_virtual_network_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + virtual_network_create_input: Annotated[VirtualNetworkCreateInput, Field(description="Virtual Network to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VirtualNetwork]: + """Create a virtual network + + Creates an virtual network. + + :param id: Project UUID (required) + :type id: str + :param virtual_network_create_input: Virtual Network to create (required) + :type virtual_network_create_input: VirtualNetworkCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_virtual_network_serialize( + id=id, + virtual_network_create_input=virtual_network_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VirtualNetwork", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_virtual_network_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + virtual_network_create_input: Annotated[VirtualNetworkCreateInput, Field(description="Virtual Network to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a virtual network + + Creates an virtual network. + + :param id: Project UUID (required) + :type id: str + :param virtual_network_create_input: Virtual Network to create (required) + :type virtual_network_create_input: VirtualNetworkCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_virtual_network_serialize( + id=id, + virtual_network_create_input=virtual_network_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "VirtualNetwork", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_virtual_network_serialize( + self, + id, + virtual_network_create_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if virtual_network_create_input is not None: + _body_params = virtual_network_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/virtual-networks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_virtual_network( + self, + id: Annotated[StrictStr, Field(description="Virtual Network UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a virtual network + + Deletes a virtual network. + + :param id: Virtual Network UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_virtual_network_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_virtual_network_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Virtual Network UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a virtual network + + Deletes a virtual network. + + :param id: Virtual Network UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_virtual_network_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_virtual_network_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Virtual Network UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a virtual network + + Deletes a virtual network. + + :param id: Virtual Network UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_virtual_network_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_virtual_network_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/virtual-networks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_virtual_networks( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + facility: Annotated[Optional[StrictStr], Field(description="Filter by Facility ID (uuid) or Facility Code")] = None, + metro: Annotated[Optional[StrictStr], Field(description="Filter by Metro ID (uuid) or Metro Code")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VirtualNetworkList: + """Retrieve all virtual networks + + Provides a list of virtual networks for a single project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param facility: Filter by Facility ID (uuid) or Facility Code + :type facility: str + :param metro: Filter by Metro ID (uuid) or Metro Code + :type metro: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_virtual_networks_serialize( + id=id, + include=include, + exclude=exclude, + facility=facility, + metro=metro, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualNetworkList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_virtual_networks_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + facility: Annotated[Optional[StrictStr], Field(description="Filter by Facility ID (uuid) or Facility Code")] = None, + metro: Annotated[Optional[StrictStr], Field(description="Filter by Metro ID (uuid) or Metro Code")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VirtualNetworkList]: + """Retrieve all virtual networks + + Provides a list of virtual networks for a single project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param facility: Filter by Facility ID (uuid) or Facility Code + :type facility: str + :param metro: Filter by Metro ID (uuid) or Metro Code + :type metro: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_virtual_networks_serialize( + id=id, + include=include, + exclude=exclude, + facility=facility, + metro=metro, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualNetworkList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_virtual_networks_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + facility: Annotated[Optional[StrictStr], Field(description="Filter by Facility ID (uuid) or Facility Code")] = None, + metro: Annotated[Optional[StrictStr], Field(description="Filter by Metro ID (uuid) or Metro Code")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all virtual networks + + Provides a list of virtual networks for a single project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param facility: Filter by Facility ID (uuid) or Facility Code + :type facility: str + :param metro: Filter by Metro ID (uuid) or Metro Code + :type metro: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_virtual_networks_serialize( + id=id, + include=include, + exclude=exclude, + facility=facility, + metro=metro, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualNetworkList", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_virtual_networks_serialize( + self, + id, + include, + exclude, + facility, + metro, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if facility is not None: + + _query_params.append(('facility', facility)) + + if metro is not None: + + _query_params.append(('metro', metro)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/virtual-networks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_virtual_network( + self, + id: Annotated[StrictStr, Field(description="Virtual Network UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VirtualNetwork: + """Get a virtual network + + Get a virtual network. + + :param id: Virtual Network UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_virtual_network_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualNetwork", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_virtual_network_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Virtual Network UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VirtualNetwork]: + """Get a virtual network + + Get a virtual network. + + :param id: Virtual Network UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_virtual_network_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualNetwork", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_virtual_network_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Virtual Network UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a virtual network + + Get a virtual network. + + :param id: Virtual Network UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_virtual_network_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualNetwork", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_virtual_network_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/virtual-networks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_virtual_network( + self, + id: Annotated[StrictStr, Field(description="Virtual Network UUID")], + virtual_network_update_input: Annotated[VirtualNetworkUpdateInput, Field(description="Virtual network to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VirtualNetwork: + """Updates the virtual network + + Updates the virtual network. + + :param id: Virtual Network UUID (required) + :type id: str + :param virtual_network_update_input: Virtual network to update (required) + :type virtual_network_update_input: VirtualNetworkUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_virtual_network_serialize( + id=id, + virtual_network_update_input=virtual_network_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualNetwork", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_virtual_network_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Virtual Network UUID")], + virtual_network_update_input: Annotated[VirtualNetworkUpdateInput, Field(description="Virtual network to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VirtualNetwork]: + """Updates the virtual network + + Updates the virtual network. + + :param id: Virtual Network UUID (required) + :type id: str + :param virtual_network_update_input: Virtual network to update (required) + :type virtual_network_update_input: VirtualNetworkUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_virtual_network_serialize( + id=id, + virtual_network_update_input=virtual_network_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualNetwork", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_virtual_network_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Virtual Network UUID")], + virtual_network_update_input: Annotated[VirtualNetworkUpdateInput, Field(description="Virtual network to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Updates the virtual network + + Updates the virtual network. + + :param id: Virtual Network UUID (required) + :type id: str + :param virtual_network_update_input: Virtual network to update (required) + :type virtual_network_update_input: VirtualNetworkUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_virtual_network_serialize( + id=id, + virtual_network_update_input=virtual_network_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VirtualNetwork", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_virtual_network_serialize( + self, + id, + virtual_network_update_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if virtual_network_update_input is not None: + _body_params = virtual_network_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/virtual-networks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api/vrfs_api.py b/equinix/services/metalv1/api/vrfs_api.py new file mode 100644 index 00000000..f10be738 --- /dev/null +++ b/equinix/services/metalv1/api/vrfs_api.py @@ -0,0 +1,4890 @@ +# coding: utf-8 + +""" + Metal API + + 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.bgp_dynamic_neighbor import BgpDynamicNeighbor +from equinix.services.metalv1.models.vrf import Vrf +from equinix.services.metalv1.models.vrf_bgp_neighbors_list import VrfBGPNeighborsList +from equinix.services.metalv1.models.vrf_create_input import VrfCreateInput +from equinix.services.metalv1.models.vrf_ip_reservation import VrfIpReservation +from equinix.services.metalv1.models.vrf_ip_reservation_list import VrfIpReservationList +from equinix.services.metalv1.models.vrf_learned_routes_list import VrfLearnedRoutesList +from equinix.services.metalv1.models.vrf_list import VrfList +from equinix.services.metalv1.models.vrf_route import VrfRoute +from equinix.services.metalv1.models.vrf_route_create_input import VrfRouteCreateInput +from equinix.services.metalv1.models.vrf_route_list import VrfRouteList +from equinix.services.metalv1.models.vrf_route_update_input import VrfRouteUpdateInput +from equinix.services.metalv1.models.vrf_update_input import VrfUpdateInput + +from equinix.services.metalv1.api_client import ApiClient, RequestSerialized +from equinix.services.metalv1.api_response import ApiResponse +from equinix.services.metalv1.rest import RESTResponseType + + +class VRFsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + @validate_call + def bgp_dynamic_neighbors_id_get( + self, + id: Annotated[StrictStr, Field(description="BGP Dynamic Neighbor UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpDynamicNeighbor: + """Retrieve a BGP Dynamic Neighbor + + Return a single BGP Dynamic Neighbor resource + + :param id: BGP Dynamic Neighbor UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bgp_dynamic_neighbors_id_get_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpDynamicNeighbor", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def bgp_dynamic_neighbors_id_get_with_http_info( + self, + id: Annotated[StrictStr, Field(description="BGP Dynamic Neighbor UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpDynamicNeighbor]: + """Retrieve a BGP Dynamic Neighbor + + Return a single BGP Dynamic Neighbor resource + + :param id: BGP Dynamic Neighbor UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bgp_dynamic_neighbors_id_get_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpDynamicNeighbor", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def bgp_dynamic_neighbors_id_get_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="BGP Dynamic Neighbor UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a BGP Dynamic Neighbor + + Return a single BGP Dynamic Neighbor resource + + :param id: BGP Dynamic Neighbor UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bgp_dynamic_neighbors_id_get_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpDynamicNeighbor", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _bgp_dynamic_neighbors_id_get_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/bgp-dynamic-neighbors/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_vrf( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + vrf_create_input: Annotated[VrfCreateInput, Field(description="VRF to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Vrf: + """Create a new VRF in the specified project + + Creates a new VRF in the specified project + + :param id: Project UUID (required) + :type id: str + :param vrf_create_input: VRF to create (required) + :type vrf_create_input: VrfCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_vrf_serialize( + id=id, + vrf_create_input=vrf_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Vrf", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_vrf_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + vrf_create_input: Annotated[VrfCreateInput, Field(description="VRF to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Vrf]: + """Create a new VRF in the specified project + + Creates a new VRF in the specified project + + :param id: Project UUID (required) + :type id: str + :param vrf_create_input: VRF to create (required) + :type vrf_create_input: VrfCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_vrf_serialize( + id=id, + vrf_create_input=vrf_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Vrf", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_vrf_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + vrf_create_input: Annotated[VrfCreateInput, Field(description="VRF to create")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new VRF in the specified project + + Creates a new VRF in the specified project + + :param id: Project UUID (required) + :type id: str + :param vrf_create_input: VRF to create (required) + :type vrf_create_input: VrfCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_vrf_serialize( + id=id, + vrf_create_input=vrf_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Vrf", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_vrf_serialize( + self, + id, + vrf_create_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if vrf_create_input is not None: + _body_params = vrf_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects/{id}/vrfs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def create_vrf_route( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + vrf_route_create_input: VrfRouteCreateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfRoute: + """Create a VRF route + + Create a route in a VRF. Currently only static default routes are supported. + + :param id: VRF UUID (required) + :type id: str + :param vrf_route_create_input: (required) + :type vrf_route_create_input: VrfRouteCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_vrf_route_serialize( + id=id, + vrf_route_create_input=vrf_route_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfRoute", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_vrf_route_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + vrf_route_create_input: VrfRouteCreateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfRoute]: + """Create a VRF route + + Create a route in a VRF. Currently only static default routes are supported. + + :param id: VRF UUID (required) + :type id: str + :param vrf_route_create_input: (required) + :type vrf_route_create_input: VrfRouteCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_vrf_route_serialize( + id=id, + vrf_route_create_input=vrf_route_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfRoute", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_vrf_route_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + vrf_route_create_input: VrfRouteCreateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a VRF route + + Create a route in a VRF. Currently only static default routes are supported. + + :param id: VRF UUID (required) + :type id: str + :param vrf_route_create_input: (required) + :type vrf_route_create_input: VrfRouteCreateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_vrf_route_serialize( + id=id, + vrf_route_create_input=vrf_route_create_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfRoute", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_vrf_route_serialize( + self, + id, + vrf_route_create_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if vrf_route_create_input is not None: + _body_params = vrf_route_create_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/vrfs/{id}/routes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_bgp_dynamic_neighbor_by_id( + self, + id: Annotated[StrictStr, Field(description="BGP Dynamic Neighbor UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpDynamicNeighbor: + """Delete a VRF BGP Dynamic Neighbor + + Trigger the removal of a BGP Neighbor range from a VRF + + :param id: BGP Dynamic Neighbor UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bgp_dynamic_neighbor_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "BgpDynamicNeighbor", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_bgp_dynamic_neighbor_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="BGP Dynamic Neighbor UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BgpDynamicNeighbor]: + """Delete a VRF BGP Dynamic Neighbor + + Trigger the removal of a BGP Neighbor range from a VRF + + :param id: BGP Dynamic Neighbor UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bgp_dynamic_neighbor_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "BgpDynamicNeighbor", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_bgp_dynamic_neighbor_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="BGP Dynamic Neighbor UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a VRF BGP Dynamic Neighbor + + Trigger the removal of a BGP Neighbor range from a VRF + + :param id: BGP Dynamic Neighbor UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_bgp_dynamic_neighbor_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "BgpDynamicNeighbor", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_bgp_dynamic_neighbor_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/bgp-dynamic-neighbors/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_vrf( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the VRF + + Deletes the VRF + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_vrf_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_vrf_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the VRF + + Deletes the VRF + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_vrf_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_vrf_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the VRF + + Deletes the VRF + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_vrf_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_vrf_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/vrfs/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def delete_vrf_route_by_id( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfRoute: + """Delete a VRF Route + + Trigger the deletion of a VRF Route resource. The status of the route will update to 'deleting', and the route resource will remain accessible while background operations remove the route from the network. Once the route has been removed from the network, the resource will be fully deleted. + + :param id: VRF Route UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_vrf_route_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "VrfRoute", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_vrf_route_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfRoute]: + """Delete a VRF Route + + Trigger the deletion of a VRF Route resource. The status of the route will update to 'deleting', and the route resource will remain accessible while background operations remove the route from the network. Once the route has been removed from the network, the resource will be fully deleted. + + :param id: VRF Route UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_vrf_route_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "VrfRoute", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_vrf_route_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a VRF Route + + Trigger the deletion of a VRF Route resource. The status of the route will update to 'deleting', and the route resource will remain accessible while background operations remove the route from the network. Once the route has been removed from the network, the resource will be fully deleted. + + :param id: VRF Route UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_vrf_route_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "VrfRoute", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_vrf_route_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/routes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_vrf_by_id( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Vrf: + """Retrieve a VRF + + Returns a single VRF resource + + :param id: VRF UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Vrf", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_vrf_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Vrf]: + """Retrieve a VRF + + Returns a single VRF resource + + :param id: VRF UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Vrf", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_vrf_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a VRF + + Returns a single VRF resource + + :param id: VRF UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Vrf", + '401': "Error", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_vrf_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/vrfs/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_vrf_ip_reservation( + self, + vrf_id: Annotated[StrictStr, Field(description="VRF UUID")], + id: Annotated[StrictStr, Field(description="IP UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfIpReservation: + """Retrieve the Specified VRF IP Reservation + + Returns the specified IP Reservation for the VRF. + + :param vrf_id: VRF UUID (required) + :type vrf_id: str + :param id: IP UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_ip_reservation_serialize( + vrf_id=vrf_id, + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfIpReservation", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_vrf_ip_reservation_with_http_info( + self, + vrf_id: Annotated[StrictStr, Field(description="VRF UUID")], + id: Annotated[StrictStr, Field(description="IP UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfIpReservation]: + """Retrieve the Specified VRF IP Reservation + + Returns the specified IP Reservation for the VRF. + + :param vrf_id: VRF UUID (required) + :type vrf_id: str + :param id: IP UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_ip_reservation_serialize( + vrf_id=vrf_id, + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfIpReservation", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_vrf_ip_reservation_without_preload_content( + self, + vrf_id: Annotated[StrictStr, Field(description="VRF UUID")], + id: Annotated[StrictStr, Field(description="IP UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the Specified VRF IP Reservation + + Returns the specified IP Reservation for the VRF. + + :param vrf_id: VRF UUID (required) + :type vrf_id: str + :param id: IP UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_ip_reservation_serialize( + vrf_id=vrf_id, + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfIpReservation", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_vrf_ip_reservation_serialize( + self, + vrf_id, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'multi', + 'exclude': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if vrf_id is not None: + _path_params['vrf_id'] = vrf_id + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/vrfs/{vrf_id}/ips/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_vrf_ip_reservations( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfIpReservationList: + """Retrieve all VRF IP Reservations in the VRF + + Returns the list of VRF IP Reservations for the VRF. + + :param id: VRF UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_ip_reservations_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfIpReservationList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_vrf_ip_reservations_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfIpReservationList]: + """Retrieve all VRF IP Reservations in the VRF + + Returns the list of VRF IP Reservations for the VRF. + + :param id: VRF UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_ip_reservations_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfIpReservationList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_vrf_ip_reservations_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all VRF IP Reservations in the VRF + + Returns the list of VRF IP Reservations for the VRF. + + :param id: VRF UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_ip_reservations_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfIpReservationList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_vrf_ip_reservations_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'multi', + 'exclude': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/vrfs/{id}/ips', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_vrf_route_by_id( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfRoute: + """Retrieve a VRF Route + + Returns a single VRF Route resource + + :param id: VRF Route UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_route_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfRoute", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_vrf_route_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfRoute]: + """Retrieve a VRF Route + + Returns a single VRF Route resource + + :param id: VRF Route UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_route_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfRoute", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_vrf_route_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a VRF Route + + Returns a single VRF Route resource + + :param id: VRF Route UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrf_route_by_id_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfRoute", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_vrf_route_by_id_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/routes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def find_vrfs( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + metro: Annotated[Optional[StrictStr], Field(description="Filter by Metro ID (uuid) or Metro Code")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfList: + """Retrieve all VRFs in the project + + Returns the list of VRFs for a single project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param metro: Filter by Metro ID (uuid) or Metro Code + :type metro: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrfs_serialize( + id=id, + include=include, + exclude=exclude, + metro=metro, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def find_vrfs_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + metro: Annotated[Optional[StrictStr], Field(description="Filter by Metro ID (uuid) or Metro Code")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfList]: + """Retrieve all VRFs in the project + + Returns the list of VRFs for a single project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param metro: Filter by Metro ID (uuid) or Metro Code + :type metro: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrfs_serialize( + id=id, + include=include, + exclude=exclude, + metro=metro, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def find_vrfs_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Project UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + metro: Annotated[Optional[StrictStr], Field(description="Filter by Metro ID (uuid) or Metro Code")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all VRFs in the project + + Returns the list of VRFs for a single project. + + :param id: Project UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param metro: Filter by Metro ID (uuid) or Metro Code + :type metro: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._find_vrfs_serialize( + id=id, + include=include, + exclude=exclude, + metro=metro, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _find_vrfs_serialize( + self, + id, + include, + exclude, + metro, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + if metro is not None: + + _query_params.append(('metro', metro)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}/vrfs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_vrf_bgp_neighbors( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfBGPNeighborsList: + """Retrieve BGP neighbor states for the VRF + + Provides BGP peering information such as the IP and state of the neighbor. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_bgp_neighbors_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfBGPNeighborsList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_vrf_bgp_neighbors_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfBGPNeighborsList]: + """Retrieve BGP neighbor states for the VRF + + Provides BGP peering information such as the IP and state of the neighbor. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_bgp_neighbors_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfBGPNeighborsList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_vrf_bgp_neighbors_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve BGP neighbor states for the VRF + + Provides BGP peering information such as the IP and state of the neighbor. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_bgp_neighbors_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfBGPNeighborsList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_vrf_bgp_neighbors_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/vrfs/{id}/bgp-neighbors', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_vrf_learned_routes( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfLearnedRoutesList: + """Retrieve learned L3 routes within the VRF + + Provides information about learned routes for the VRF. The VRF builds this information dynamically though BGP from other routers in the network. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_learned_routes_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfLearnedRoutesList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_vrf_learned_routes_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfLearnedRoutesList]: + """Retrieve learned L3 routes within the VRF + + Provides information about learned routes for the VRF. The VRF builds this information dynamically though BGP from other routers in the network. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_learned_routes_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfLearnedRoutesList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_vrf_learned_routes_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve learned L3 routes within the VRF + + Provides information about learned routes for the VRF. The VRF builds this information dynamically though BGP from other routers in the network. + + :param id: VRF UUID (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_learned_routes_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfLearnedRoutesList", + '403': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_vrf_learned_routes_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/vrfs/{id}/learned-routes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def get_vrf_routes( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfRouteList: + """Retrieve all routes in the VRF + + Returns the list of routes for the VRF + + :param id: VRF UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_routes_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfRouteList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_vrf_routes_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfRouteList]: + """Retrieve all routes in the VRF + + Returns the list of routes for the VRF + + :param id: VRF UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_routes_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfRouteList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_vrf_routes_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve all routes in the VRF + + Returns the list of routes for the VRF + + :param id: VRF UUID (required) + :type id: str + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_vrf_routes_serialize( + id=id, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "VrfRouteList", + '401': "Error", + '404': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_vrf_routes_serialize( + self, + id, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/vrfs/{id}/routes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_vrf( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + vrf_update_input: Annotated[VrfUpdateInput, Field(description="VRF to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Vrf: + """Update the VRF + + Updates the VRF. + + :param id: VRF UUID (required) + :type id: str + :param vrf_update_input: VRF to update (required) + :type vrf_update_input: VrfUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_vrf_serialize( + id=id, + vrf_update_input=vrf_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Vrf", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_vrf_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + vrf_update_input: Annotated[VrfUpdateInput, Field(description="VRF to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Vrf]: + """Update the VRF + + Updates the VRF. + + :param id: VRF UUID (required) + :type id: str + :param vrf_update_input: VRF to update (required) + :type vrf_update_input: VrfUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_vrf_serialize( + id=id, + vrf_update_input=vrf_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Vrf", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_vrf_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF UUID")], + vrf_update_input: Annotated[VrfUpdateInput, Field(description="VRF to update")], + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the VRF + + Updates the VRF. + + :param id: VRF UUID (required) + :type id: str + :param vrf_update_input: VRF to update (required) + :type vrf_update_input: VrfUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_vrf_serialize( + id=id, + vrf_update_input=vrf_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Vrf", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_vrf_serialize( + self, + id, + vrf_update_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if vrf_update_input is not None: + _body_params = vrf_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/vrfs/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + @validate_call + def update_vrf_route_by_id( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + vrf_route_update_input: VrfRouteUpdateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> VrfRoute: + """Update a VRF Route + + Requests a VRF Route be redeployed across the network. Updating the prefix or next-hop address on a route is not currently supported. + + :param id: VRF Route UUID (required) + :type id: str + :param vrf_route_update_input: (required) + :type vrf_route_update_input: VrfRouteUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_vrf_route_by_id_serialize( + id=id, + vrf_route_update_input=vrf_route_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "VrfRoute", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_vrf_route_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + vrf_route_update_input: VrfRouteUpdateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[VrfRoute]: + """Update a VRF Route + + Requests a VRF Route be redeployed across the network. Updating the prefix or next-hop address on a route is not currently supported. + + :param id: VRF Route UUID (required) + :type id: str + :param vrf_route_update_input: (required) + :type vrf_route_update_input: VrfRouteUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_vrf_route_by_id_serialize( + id=id, + vrf_route_update_input=vrf_route_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "VrfRoute", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_vrf_route_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="VRF Route UUID")], + vrf_route_update_input: VrfRouteUpdateInput, + include: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.")] = None, + exclude: Annotated[Optional[List[StrictStr]], Field(description="Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a VRF Route + + Requests a VRF Route be redeployed across the network. Updating the prefix or next-hop address on a route is not currently supported. + + :param id: VRF Route UUID (required) + :type id: str + :param vrf_route_update_input: (required) + :type vrf_route_update_input: VrfRouteUpdateInput + :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. + :type include: List[str] + :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. + :type exclude: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_vrf_route_by_id_serialize( + id=id, + vrf_route_update_input=vrf_route_update_input, + include=include, + exclude=exclude, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "VrfRoute", + '401': "Error", + '403': "Error", + '404': "Error", + '422': "Error", + '429': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_vrf_route_by_id_serialize( + self, + id, + vrf_route_update_input, + include, + exclude, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include': 'csv', + 'exclude': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if include is not None: + + _query_params.append(('include', include)) + + if exclude is not None: + + _query_params.append(('exclude', exclude)) + + # process the header parameters + # process the form parameters + # process the body parameter + if vrf_route_update_input is not None: + _body_params = vrf_route_update_input + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'x_auth_token' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/routes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/equinix/services/metalv1/api_client.py b/equinix/services/metalv1/api_client.py new file mode 100644 index 00000000..0a9f48f6 --- /dev/null +++ b/equinix/services/metalv1/api_client.py @@ -0,0 +1,757 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime +from dateutil.parser import parse +from enum import Enum +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict + +from equinix.services.metalv1.configuration import Configuration +from equinix.services.metalv1.api_response import ApiResponse, T as ApiResponseT +import equinix.services.metalv1.models +from equinix.services.metalv1 import rest +from equinix.services.metalv1.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'equinix-sdk-python/0.3.0' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = obj.to_dict() + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + + # fetch data from response object + try: + data = json.loads(response_text) + except ValueError: + data = response_text + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(equinix.services.metalv1.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in files.items(): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/equinix/services/metalv1/api_response.py b/equinix/services/metalv1/api_response.py new file mode 100644 index 00000000..9bc7c11f --- /dev/null +++ b/equinix/services/metalv1/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/equinix/services/metalv1/configuration.py b/equinix/services/metalv1/configuration.py new file mode 100644 index 00000000..4ae3f849 --- /dev/null +++ b/equinix/services/metalv1/configuration.py @@ -0,0 +1,464 @@ +# coding: utf-8 + +""" + Metal API + + 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 copy +import logging +from logging import FileHandler +import multiprocessing +import sys +from typing import Optional +import urllib3 + +import http.client as httplib + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = equinix.services.metalv1.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + access_token=None, + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ) -> None: + """Constructor + """ + self._base_path = "https://api.equinix.com/metal/v1" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("equinix.services.metalv1") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls): + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = Configuration() + return cls._default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if 'x_auth_token' in self.api_key: + auth['x_auth_token'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'X-Auth-Token', + 'value': self.get_api_key_with_prefix( + 'x_auth_token', + ), + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 0.3.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://api.equinix.com/metal/v1", + 'description': "No description provided", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/equinix/services/metalv1/docs/AWSFabricProvider.md b/equinix/services/metalv1/docs/AWSFabricProvider.md new file mode 100644 index 00000000..e3b5d041 --- /dev/null +++ b/equinix/services/metalv1/docs/AWSFabricProvider.md @@ -0,0 +1,32 @@ +# AWSFabricProvider + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_id** | **str** | AWS Account ID | +**href** | **str** | | [optional] +**location** | **str** | | [optional] +**type** | **str** | | + +## Example + +```python +from equinix.services.metalv1.models.aws_fabric_provider import AWSFabricProvider + +# TODO update the JSON string below +json = "{}" +# create an instance of AWSFabricProvider from a JSON string +aws_fabric_provider_instance = AWSFabricProvider.from_json(json) +# print the JSON string representation of the object +print(AWSFabricProvider.to_json()) + +# convert the object into a dict +aws_fabric_provider_dict = aws_fabric_provider_instance.to_dict() +# create an instance of AWSFabricProvider from a dict +aws_fabric_provider_form_dict = aws_fabric_provider.from_dict(aws_fabric_provider_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/ActivateHardwareReservationRequest.md b/equinix/services/metalv1/docs/ActivateHardwareReservationRequest.md new file mode 100644 index 00000000..c76dd5a1 --- /dev/null +++ b/equinix/services/metalv1/docs/ActivateHardwareReservationRequest.md @@ -0,0 +1,30 @@ +# ActivateHardwareReservationRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.activate_hardware_reservation_request import ActivateHardwareReservationRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ActivateHardwareReservationRequest from a JSON string +activate_hardware_reservation_request_instance = ActivateHardwareReservationRequest.from_json(json) +# print the JSON string representation of the object +print(ActivateHardwareReservationRequest.to_json()) + +# convert the object into a dict +activate_hardware_reservation_request_dict = activate_hardware_reservation_request_instance.to_dict() +# create an instance of ActivateHardwareReservationRequest from a dict +activate_hardware_reservation_request_form_dict = activate_hardware_reservation_request.from_dict(activate_hardware_reservation_request_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/Address.md b/equinix/services/metalv1/docs/Address.md new file mode 100644 index 00000000..343e579b --- /dev/null +++ b/equinix/services/metalv1/docs/Address.md @@ -0,0 +1,36 @@ +# Address + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | [optional] +**address2** | **str** | | [optional] +**city** | **str** | | [optional] +**coordinates** | [**Coordinates**](Coordinates.md) | | [optional] +**country** | **str** | | [optional] +**href** | **str** | | [optional] +**state** | **str** | | [optional] +**zip_code** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.address import Address + +# TODO update the JSON string below +json = "{}" +# create an instance of Address from a JSON string +address_instance = Address.from_json(json) +# print the JSON string representation of the object +print(Address.to_json()) + +# convert the object into a dict +address_dict = address_instance.to_dict() +# create an instance of Address from a dict +address_form_dict = address.from_dict(address_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/Attribute.md b/equinix/services/metalv1/docs/Attribute.md new file mode 100644 index 00000000..3f06246b --- /dev/null +++ b/equinix/services/metalv1/docs/Attribute.md @@ -0,0 +1,33 @@ +# Attribute + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | Datetime when the block was created. | [optional] [readonly] +**data** | [**AttributeData**](AttributeData.md) | | [optional] +**href** | **str** | | [optional] +**namespace** | **str** | Attribute namespace | [optional] [readonly] +**updated_at** | **datetime** | Datetime when the block was updated. | [optional] [readonly] + +## Example + +```python +from equinix.services.metalv1.models.attribute import Attribute + +# TODO update the JSON string below +json = "{}" +# create an instance of Attribute from a JSON string +attribute_instance = Attribute.from_json(json) +# print the JSON string representation of the object +print(Attribute.to_json()) + +# convert the object into a dict +attribute_dict = attribute_instance.to_dict() +# create an instance of Attribute from a dict +attribute_form_dict = attribute.from_dict(attribute_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/AttributeData.md b/equinix/services/metalv1/docs/AttributeData.md new file mode 100644 index 00000000..3ab3019a --- /dev/null +++ b/equinix/services/metalv1/docs/AttributeData.md @@ -0,0 +1,33 @@ +# AttributeData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**latest** | **bool** | Boolean flag to know if the firmware set is the latest for the model and vendor | [optional] [readonly] +**model** | **str** | Model on which this firmware set can be applied | [optional] [readonly] +**plan** | **str** | Plan where the firmware set can be applied | [optional] [readonly] +**vendor** | **str** | Vendor on which this firmware set can be applied | [optional] [readonly] + +## Example + +```python +from equinix.services.metalv1.models.attribute_data import AttributeData + +# TODO update the JSON string below +json = "{}" +# create an instance of AttributeData from a JSON string +attribute_data_instance = AttributeData.from_json(json) +# print the JSON string representation of the object +print(AttributeData.to_json()) + +# convert the object into a dict +attribute_data_dict = attribute_data_instance.to_dict() +# create an instance of AttributeData from a dict +attribute_data_form_dict = attribute_data.from_dict(attribute_data_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/AuthToken.md b/equinix/services/metalv1/docs/AuthToken.md new file mode 100644 index 00000000..ad792f9f --- /dev/null +++ b/equinix/services/metalv1/docs/AuthToken.md @@ -0,0 +1,37 @@ +# AuthToken + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**description** | **str** | Available only for API keys | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**project** | [**AuthTokenProject**](AuthTokenProject.md) | | [optional] +**read_only** | **bool** | | [optional] +**token** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] +**user** | [**AuthTokenUser**](AuthTokenUser.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.auth_token import AuthToken + +# TODO update the JSON string below +json = "{}" +# create an instance of AuthToken from a JSON string +auth_token_instance = AuthToken.from_json(json) +# print the JSON string representation of the object +print(AuthToken.to_json()) + +# convert the object into a dict +auth_token_dict = auth_token_instance.to_dict() +# create an instance of AuthToken from a dict +auth_token_form_dict = auth_token.from_dict(auth_token_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/AuthTokenInput.md b/equinix/services/metalv1/docs/AuthTokenInput.md new file mode 100644 index 00000000..4e77daca --- /dev/null +++ b/equinix/services/metalv1/docs/AuthTokenInput.md @@ -0,0 +1,31 @@ +# AuthTokenInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**read_only** | **bool** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.auth_token_input import AuthTokenInput + +# TODO update the JSON string below +json = "{}" +# create an instance of AuthTokenInput from a JSON string +auth_token_input_instance = AuthTokenInput.from_json(json) +# print the JSON string representation of the object +print(AuthTokenInput.to_json()) + +# convert the object into a dict +auth_token_input_dict = auth_token_input_instance.to_dict() +# create an instance of AuthTokenInput from a dict +auth_token_input_form_dict = auth_token_input.from_dict(auth_token_input_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/AuthTokenList.md b/equinix/services/metalv1/docs/AuthTokenList.md new file mode 100644 index 00000000..46daae99 --- /dev/null +++ b/equinix/services/metalv1/docs/AuthTokenList.md @@ -0,0 +1,30 @@ +# AuthTokenList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_keys** | [**List[AuthToken]**](AuthToken.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.auth_token_list import AuthTokenList + +# TODO update the JSON string below +json = "{}" +# create an instance of AuthTokenList from a JSON string +auth_token_list_instance = AuthTokenList.from_json(json) +# print the JSON string representation of the object +print(AuthTokenList.to_json()) + +# convert the object into a dict +auth_token_list_dict = auth_token_list_instance.to_dict() +# create an instance of AuthTokenList from a dict +auth_token_list_form_dict = auth_token_list.from_dict(auth_token_list_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/AuthTokenProject.md b/equinix/services/metalv1/docs/AuthTokenProject.md new file mode 100644 index 00000000..e274fba7 --- /dev/null +++ b/equinix/services/metalv1/docs/AuthTokenProject.md @@ -0,0 +1,49 @@ +# AuthTokenProject + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**backend_transfer_enabled** | **bool** | | [optional] +**bgp_config** | [**Href**](Href.md) | | [optional] +**created_at** | **datetime** | | [optional] +**customdata** | **object** | | [optional] +**devices** | [**List[Href]**](Href.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**invitations** | [**List[Href]**](Href.md) | | [optional] +**max_devices** | **object** | | [optional] +**members** | [**List[Href]**](Href.md) | | [optional] +**memberships** | [**List[Href]**](Href.md) | | [optional] +**name** | **str** | The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. | [optional] +**network_status** | **object** | | [optional] +**organization** | [**Href**](Href.md) | | [optional] +**payment_method** | [**Href**](Href.md) | | [optional] +**ssh_keys** | [**List[Href]**](Href.md) | | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers. | [optional] +**updated_at** | **datetime** | | [optional] +**url** | **str** | | [optional] +**volumes** | [**List[Href]**](Href.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.auth_token_project import AuthTokenProject + +# TODO update the JSON string below +json = "{}" +# create an instance of AuthTokenProject from a JSON string +auth_token_project_instance = AuthTokenProject.from_json(json) +# print the JSON string representation of the object +print(AuthTokenProject.to_json()) + +# convert the object into a dict +auth_token_project_dict = auth_token_project_instance.to_dict() +# create an instance of AuthTokenProject from a dict +auth_token_project_form_dict = auth_token_project.from_dict(auth_token_project_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/AuthTokenUser.md b/equinix/services/metalv1/docs/AuthTokenUser.md new file mode 100644 index 00000000..f4978f56 --- /dev/null +++ b/equinix/services/metalv1/docs/AuthTokenUser.md @@ -0,0 +1,50 @@ +# AuthTokenUser + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avatar_thumb_url** | **str** | | [optional] +**avatar_url** | **str** | | [optional] +**created_at** | **datetime** | | [optional] +**customdata** | **object** | | [optional] +**default_organization_id** | **str** | | [optional] +**default_project_id** | **str** | | [optional] +**email** | **str** | | [optional] +**emails** | [**List[Href]**](Href.md) | | [optional] +**first_name** | **str** | | [optional] +**fraud_score** | **str** | | [optional] +**full_name** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**last_login_at** | **datetime** | | [optional] +**last_name** | **str** | | [optional] +**max_organizations** | **int** | | [optional] +**max_projects** | **int** | | [optional] +**phone_number** | **str** | | [optional] +**short_id** | **str** | | [optional] +**timezone** | **str** | | [optional] +**two_factor_auth** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.auth_token_user import AuthTokenUser + +# TODO update the JSON string below +json = "{}" +# create an instance of AuthTokenUser from a JSON string +auth_token_user_instance = AuthTokenUser.from_json(json) +# print the JSON string representation of the object +print(AuthTokenUser.to_json()) + +# convert the object into a dict +auth_token_user_dict = auth_token_user_instance.to_dict() +# create an instance of AuthTokenUser from a dict +auth_token_user_form_dict = auth_token_user.from_dict(auth_token_user_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/AuthenticationApi.md b/equinix/services/metalv1/docs/AuthenticationApi.md new file mode 100644 index 00000000..dd2e9777 --- /dev/null +++ b/equinix/services/metalv1/docs/AuthenticationApi.md @@ -0,0 +1,502 @@ +# equinix.services.metalv1.AuthenticationApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_api_key**](AuthenticationApi.md#create_api_key) | **POST** /user/api-keys | Create an API key +[**create_project_api_key**](AuthenticationApi.md#create_project_api_key) | **POST** /projects/{id}/api-keys | Create an API key for a project. +[**delete_api_key**](AuthenticationApi.md#delete_api_key) | **DELETE** /api-keys/{id} | Delete the API key +[**delete_user_api_key**](AuthenticationApi.md#delete_user_api_key) | **DELETE** /user/api-keys/{id} | Delete the API key +[**find_api_keys**](AuthenticationApi.md#find_api_keys) | **GET** /user/api-keys | Retrieve all user API keys +[**find_project_api_keys**](AuthenticationApi.md#find_project_api_keys) | **GET** /projects/{id}/api-keys | Retrieve all API keys for the project. + + +# **create_api_key** +> AuthToken create_api_key(auth_token_input, include=include) + +Create an API key + +Creates a API key for the current user. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.auth_token import AuthToken +from equinix.services.metalv1.models.auth_token_input import AuthTokenInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.AuthenticationApi(api_client) + auth_token_input = equinix.services.metalv1.AuthTokenInput() # AuthTokenInput | API key to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create an API key + api_response = api_instance.create_api_key(auth_token_input, include=include) + print("The response of AuthenticationApi->create_api_key:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AuthenticationApi->create_api_key: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **auth_token_input** | [**AuthTokenInput**](AuthTokenInput.md)| API key to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**AuthToken**](AuthToken.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_project_api_key** +> AuthToken create_project_api_key(id, auth_token_input, include=include) + +Create an API key for a project. + +Creates an API key for a project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.auth_token import AuthToken +from equinix.services.metalv1.models.auth_token_input import AuthTokenInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.AuthenticationApi(api_client) + id = 'id_example' # str | Project UUID + auth_token_input = equinix.services.metalv1.AuthTokenInput() # AuthTokenInput | API Key to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create an API key for a project. + api_response = api_instance.create_project_api_key(id, auth_token_input, include=include) + print("The response of AuthenticationApi->create_project_api_key:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AuthenticationApi->create_project_api_key: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **auth_token_input** | [**AuthTokenInput**](AuthTokenInput.md)| API Key to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**AuthToken**](AuthToken.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_api_key** +> delete_api_key(id) + +Delete the API key + +Deletes the API key. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.AuthenticationApi(api_client) + id = 'id_example' # str | API Key UUID + + try: + # Delete the API key + api_instance.delete_api_key(id) + except Exception as e: + print("Exception when calling AuthenticationApi->delete_api_key: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| API Key UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_user_api_key** +> delete_user_api_key(id) + +Delete the API key + +Deletes the current user API key. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.AuthenticationApi(api_client) + id = 'id_example' # str | API Key UUID + + try: + # Delete the API key + api_instance.delete_user_api_key(id) + except Exception as e: + print("Exception when calling AuthenticationApi->delete_user_api_key: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| API Key UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_api_keys** +> AuthTokenList find_api_keys(search=search, include=include) + +Retrieve all user API keys + +Returns all API keys for the current user. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.auth_token_list import AuthTokenList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.AuthenticationApi(api_client) + search = 'search_example' # str | Search by description (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve all user API keys + api_response = api_instance.find_api_keys(search=search, include=include) + print("The response of AuthenticationApi->find_api_keys:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AuthenticationApi->find_api_keys: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **search** | **str**| Search by description | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**AuthTokenList**](AuthTokenList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_api_keys** +> AuthTokenList find_project_api_keys(id, include=include) + +Retrieve all API keys for the project. + +Returns all API keys for a specific project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.auth_token_list import AuthTokenList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.AuthenticationApi(api_client) + id = 'id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve all API keys for the project. + api_response = api_instance.find_project_api_keys(id, include=include) + print("The response of AuthenticationApi->find_project_api_keys:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AuthenticationApi->find_project_api_keys: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**AuthTokenList**](AuthTokenList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/BGPApi.md b/equinix/services/metalv1/docs/BGPApi.md new file mode 100644 index 00000000..09cb1926 --- /dev/null +++ b/equinix/services/metalv1/docs/BGPApi.md @@ -0,0 +1,585 @@ +# equinix.services.metalv1.BGPApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_bgp_session**](BGPApi.md#delete_bgp_session) | **DELETE** /bgp/sessions/{id} | Delete the BGP session +[**find_bgp_config_by_project**](BGPApi.md#find_bgp_config_by_project) | **GET** /projects/{id}/bgp-config | Retrieve a bgp config +[**find_bgp_session_by_id**](BGPApi.md#find_bgp_session_by_id) | **GET** /bgp/sessions/{id} | Retrieve a BGP session +[**find_global_bgp_ranges**](BGPApi.md#find_global_bgp_ranges) | **GET** /projects/{id}/global-bgp-ranges | Retrieve all global bgp ranges +[**find_project_bgp_sessions**](BGPApi.md#find_project_bgp_sessions) | **GET** /projects/{id}/bgp/sessions | Retrieve all BGP sessions for project +[**request_bgp_config**](BGPApi.md#request_bgp_config) | **POST** /projects/{id}/bgp-configs | Requesting bgp config +[**update_bgp_session**](BGPApi.md#update_bgp_session) | **PUT** /bgp/sessions/{id} | Update the BGP session + + +# **delete_bgp_session** +> delete_bgp_session(id) + +Delete the BGP session + +Deletes the BGP session. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BGPApi(api_client) + id = 'id_example' # str | BGP session UUID + + try: + # Delete the BGP session + api_instance.delete_bgp_session(id) + except Exception as e: + print("Exception when calling BGPApi->delete_bgp_session: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| BGP session UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_bgp_config_by_project** +> BgpConfig find_bgp_config_by_project(id, include=include) + +Retrieve a bgp config + +Returns a bgp config + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_config import BgpConfig +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BGPApi(api_client) + id = 'id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a bgp config + api_response = api_instance.find_bgp_config_by_project(id, include=include) + print("The response of BGPApi->find_bgp_config_by_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPApi->find_bgp_config_by_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**BgpConfig**](BgpConfig.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok When BGP configuration is not enabled empty structure is returned. When BGP configuration is disabled after being enabled BGP configuration data is returned with status disabled. | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found The project was not found. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_bgp_session_by_id** +> BgpSession find_bgp_session_by_id(id, include=include) + +Retrieve a BGP session + +Returns a BGP session + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_session import BgpSession +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BGPApi(api_client) + id = 'id_example' # str | BGP session UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a BGP session + api_response = api_instance.find_bgp_session_by_id(id, include=include) + print("The response of BGPApi->find_bgp_session_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPApi->find_bgp_session_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| BGP session UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**BgpSession**](BgpSession.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_global_bgp_ranges** +> GlobalBgpRangeList find_global_bgp_ranges(id) + +Retrieve all global bgp ranges + +Returns all global bgp ranges for a project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.global_bgp_range_list import GlobalBgpRangeList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BGPApi(api_client) + id = 'id_example' # str | Project UUID + + try: + # Retrieve all global bgp ranges + api_response = api_instance.find_global_bgp_ranges(id) + print("The response of BGPApi->find_global_bgp_ranges:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPApi->find_global_bgp_ranges: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + +### Return type + +[**GlobalBgpRangeList**](GlobalBgpRangeList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_bgp_sessions** +> BgpSessionList find_project_bgp_sessions(id) + +Retrieve all BGP sessions for project + +Provides a listing of available BGP sessions for the project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_session_list import BgpSessionList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BGPApi(api_client) + id = 'id_example' # str | Project UUID + + try: + # Retrieve all BGP sessions for project + api_response = api_instance.find_project_bgp_sessions(id) + print("The response of BGPApi->find_project_bgp_sessions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPApi->find_project_bgp_sessions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + +### Return type + +[**BgpSessionList**](BgpSessionList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **request_bgp_config** +> request_bgp_config(id, bgp_config_request_input, include=include) + +Requesting bgp config + +Requests to enable bgp configuration for a project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_config_request_input import BgpConfigRequestInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BGPApi(api_client) + id = 'id_example' # str | Project UUID + bgp_config_request_input = equinix.services.metalv1.BgpConfigRequestInput() # BgpConfigRequestInput | BGP config Request to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Requesting bgp config + api_instance.request_bgp_config(id, bgp_config_request_input, include=include) + except Exception as e: + print("Exception when calling BGPApi->request_bgp_config: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **bgp_config_request_input** | [**BgpConfigRequestInput**](BgpConfigRequestInput.md)| BGP config Request to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_bgp_session** +> update_bgp_session(id, body) + +Update the BGP session + +Updates the BGP session by either enabling or disabling the default route functionality. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BGPApi(api_client) + id = 'id_example' # str | BGP session UUID + body = True # bool | Default route + + try: + # Update the BGP session + api_instance.update_bgp_session(id, body) + except Exception as e: + print("Exception when calling BGPApi->update_bgp_session: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| BGP session UUID | + **body** | **bool**| Default route | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/BGPSessionInput.md b/equinix/services/metalv1/docs/BGPSessionInput.md new file mode 100644 index 00000000..790350bb --- /dev/null +++ b/equinix/services/metalv1/docs/BGPSessionInput.md @@ -0,0 +1,31 @@ +# BGPSessionInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_family** | **str** | Address family for BGP session. | [optional] +**default_route** | **bool** | Set the default route policy. | [optional] [default to False] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bgp_session_input import BGPSessionInput + +# TODO update the JSON string below +json = "{}" +# create an instance of BGPSessionInput from a JSON string +bgp_session_input_instance = BGPSessionInput.from_json(json) +# print the JSON string representation of the object +print(BGPSessionInput.to_json()) + +# convert the object into a dict +bgp_session_input_dict = bgp_session_input_instance.to_dict() +# create an instance of BGPSessionInput from a dict +bgp_session_input_form_dict = bgp_session_input.from_dict(bgp_session_input_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/Batch.md b/equinix/services/metalv1/docs/Batch.md new file mode 100644 index 00000000..1a6fd95f --- /dev/null +++ b/equinix/services/metalv1/docs/Batch.md @@ -0,0 +1,37 @@ +# Batch + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**devices** | [**List[Href]**](Href.md) | | [optional] +**error_messages** | **List[str]** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**project** | [**Href**](Href.md) | | [optional] +**quantity** | **int** | | [optional] +**state** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.batch import Batch + +# TODO update the JSON string below +json = "{}" +# create an instance of Batch from a JSON string +batch_instance = Batch.from_json(json) +# print the JSON string representation of the object +print(Batch.to_json()) + +# convert the object into a dict +batch_dict = batch_instance.to_dict() +# create an instance of Batch from a dict +batch_form_dict = batch.from_dict(batch_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/BatchesApi.md b/equinix/services/metalv1/docs/BatchesApi.md new file mode 100644 index 00000000..aaa4dbd5 --- /dev/null +++ b/equinix/services/metalv1/docs/BatchesApi.md @@ -0,0 +1,341 @@ +# equinix.services.metalv1.BatchesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_device_batch**](BatchesApi.md#create_device_batch) | **POST** /projects/{id}/devices/batch | Create a devices batch +[**delete_batch**](BatchesApi.md#delete_batch) | **DELETE** /batches/{id} | Delete the Batch +[**find_batch_by_id**](BatchesApi.md#find_batch_by_id) | **GET** /batches/{id} | Retrieve a Batch +[**find_batches_by_project**](BatchesApi.md#find_batches_by_project) | **GET** /projects/{id}/batches | Retrieve all batches by project + + +# **create_device_batch** +> BatchesList create_device_batch(id, instances_batch_create_input) + +Create a devices batch + +Creates new devices in batch and provisions them in our datacenter. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.batches_list import BatchesList +from equinix.services.metalv1.models.instances_batch_create_input import InstancesBatchCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BatchesApi(api_client) + id = 'id_example' # str | Project UUID + instances_batch_create_input = equinix.services.metalv1.InstancesBatchCreateInput() # InstancesBatchCreateInput | Batches to create + + try: + # Create a devices batch + api_response = api_instance.create_device_batch(id, instances_batch_create_input) + print("The response of BatchesApi->create_device_batch:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BatchesApi->create_device_batch: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **instances_batch_create_input** | [**InstancesBatchCreateInput**](InstancesBatchCreateInput.md)| Batches to create | + +### Return type + +[**BatchesList**](BatchesList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_batch** +> delete_batch(id, remove_associated_instances=remove_associated_instances) + +Delete the Batch + +Deletes the Batch. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BatchesApi(api_client) + id = 'id_example' # str | Batch UUID + remove_associated_instances = False # bool | Delete all instances created from this batch (optional) (default to False) + + try: + # Delete the Batch + api_instance.delete_batch(id, remove_associated_instances=remove_associated_instances) + except Exception as e: + print("Exception when calling BatchesApi->delete_batch: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Batch UUID | + **remove_associated_instances** | **bool**| Delete all instances created from this batch | [optional] [default to False] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_batch_by_id** +> Batch find_batch_by_id(id, include=include) + +Retrieve a Batch + +Returns a Batch + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.batch import Batch +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BatchesApi(api_client) + id = 'id_example' # str | Batch UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a Batch + api_response = api_instance.find_batch_by_id(id, include=include) + print("The response of BatchesApi->find_batch_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BatchesApi->find_batch_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Batch UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Batch**](Batch.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_batches_by_project** +> BatchesList find_batches_by_project(id, include=include) + +Retrieve all batches by project + +Returns all batches for the given project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.batches_list import BatchesList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.BatchesApi(api_client) + id = 'id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve all batches by project + api_response = api_instance.find_batches_by_project(id, include=include) + print("The response of BatchesApi->find_batches_by_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BatchesApi->find_batches_by_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**BatchesList**](BatchesList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/BatchesList.md b/equinix/services/metalv1/docs/BatchesList.md new file mode 100644 index 00000000..933af7d6 --- /dev/null +++ b/equinix/services/metalv1/docs/BatchesList.md @@ -0,0 +1,30 @@ +# BatchesList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**batches** | [**List[Batch]**](Batch.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.batches_list import BatchesList + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchesList from a JSON string +batches_list_instance = BatchesList.from_json(json) +# print the JSON string representation of the object +print(BatchesList.to_json()) + +# convert the object into a dict +batches_list_dict = batches_list_instance.to_dict() +# create an instance of BatchesList from a dict +batches_list_form_dict = batches_list.from_dict(batches_list_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/BgpConfig.md b/equinix/services/metalv1/docs/BgpConfig.md new file mode 100644 index 00000000..c030d707 --- /dev/null +++ b/equinix/services/metalv1/docs/BgpConfig.md @@ -0,0 +1,41 @@ +# BgpConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asn** | **int** | Autonomous System Number. ASN is required with Global BGP. With Local BGP the private ASN, 65000, is assigned. | [optional] +**created_at** | **datetime** | | [optional] +**deployment_type** | **str** | In a Local BGP deployment, a customer uses an internal ASN to control routes within a single Equinix Metal datacenter. This means that the routes are never advertised to the global Internet. Global BGP, on the other hand, requires a customer to have a registered ASN and IP space. | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**max_prefix** | **int** | The maximum number of route filters allowed per server | [optional] [default to 10] +**md5** | **str** | (Optional) Password for BGP session in plaintext (not a checksum) | [optional] +**project** | [**Href**](Href.md) | | [optional] +**ranges** | [**List[GlobalBgpRange]**](GlobalBgpRange.md) | The IP block ranges associated to the ASN (Populated in Global BGP only) | [optional] +**requested_at** | **datetime** | | [optional] +**route_object** | **str** | Specifies AS-MACRO (aka AS-SET) to use when building client route filters | [optional] +**sessions** | [**List[BgpSession]**](BgpSession.md) | The direct connections between neighboring routers that want to exchange routing information. | [optional] +**status** | **str** | Status of the BGP Config. Status \"requested\" is valid only with the \"global\" deployment_type. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bgp_config import BgpConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpConfig from a JSON string +bgp_config_instance = BgpConfig.from_json(json) +# print the JSON string representation of the object +print(BgpConfig.to_json()) + +# convert the object into a dict +bgp_config_dict = bgp_config_instance.to_dict() +# create an instance of BgpConfig from a dict +bgp_config_form_dict = bgp_config.from_dict(bgp_config_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/BgpConfigRequestInput.md b/equinix/services/metalv1/docs/BgpConfigRequestInput.md new file mode 100644 index 00000000..9eac11b7 --- /dev/null +++ b/equinix/services/metalv1/docs/BgpConfigRequestInput.md @@ -0,0 +1,33 @@ +# BgpConfigRequestInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asn** | **int** | Autonomous System Number for local BGP deployment. | +**deployment_type** | **str** | Wether the BGP deployment is local or global. Local deployments are configured immediately. Global deployments will need to be reviewed by Equinix Metal engineers. | +**href** | **str** | | [optional] +**md5** | **str** | The plaintext password to share between BGP neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character | [optional] +**use_case** | **str** | A use case explanation (necessary for global BGP request review). | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bgp_config_request_input import BgpConfigRequestInput + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpConfigRequestInput from a JSON string +bgp_config_request_input_instance = BgpConfigRequestInput.from_json(json) +# print the JSON string representation of the object +print(BgpConfigRequestInput.to_json()) + +# convert the object into a dict +bgp_config_request_input_dict = bgp_config_request_input_instance.to_dict() +# create an instance of BgpConfigRequestInput from a dict +bgp_config_request_input_form_dict = bgp_config_request_input.from_dict(bgp_config_request_input_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/BgpDynamicNeighbor.md b/equinix/services/metalv1/docs/BgpDynamicNeighbor.md new file mode 100644 index 00000000..66e4e418 --- /dev/null +++ b/equinix/services/metalv1/docs/BgpDynamicNeighbor.md @@ -0,0 +1,38 @@ +# BgpDynamicNeighbor + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bgp_neighbor_asn** | **int** | The ASN of the dynamic BGP neighbor | [optional] +**bgp_neighbor_range** | **str** | Network range of the dynamic BGP neighbor in CIDR format | [optional] +**created_at** | **datetime** | | [optional] [readonly] +**created_by** | [**UserLimited**](UserLimited.md) | | [optional] +**href** | **str** | | [optional] [readonly] +**id** | **str** | The unique identifier for the resource | [optional] [readonly] +**metal_gateway** | [**VrfMetalGateway**](VrfMetalGateway.md) | | [optional] +**state** | **str** | | [optional] [readonly] +**tags** | **List[str]** | | [optional] +**updated_at** | **datetime** | | [optional] [readonly] + +## Example + +```python +from equinix.services.metalv1.models.bgp_dynamic_neighbor import BgpDynamicNeighbor + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpDynamicNeighbor from a JSON string +bgp_dynamic_neighbor_instance = BgpDynamicNeighbor.from_json(json) +# print the JSON string representation of the object +print(BgpDynamicNeighbor.to_json()) + +# convert the object into a dict +bgp_dynamic_neighbor_dict = bgp_dynamic_neighbor_instance.to_dict() +# create an instance of BgpDynamicNeighbor from a dict +bgp_dynamic_neighbor_form_dict = bgp_dynamic_neighbor.from_dict(bgp_dynamic_neighbor_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/BgpDynamicNeighborCreateInput.md b/equinix/services/metalv1/docs/BgpDynamicNeighborCreateInput.md new file mode 100644 index 00000000..da1c73d2 --- /dev/null +++ b/equinix/services/metalv1/docs/BgpDynamicNeighborCreateInput.md @@ -0,0 +1,32 @@ +# BgpDynamicNeighborCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bgp_neighbor_asn** | **int** | The ASN of the dynamic BGP neighbor | +**bgp_neighbor_range** | **str** | Network range of the dynamic BGP neighbor in CIDR format | +**href** | **str** | | [optional] +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bgp_dynamic_neighbor_create_input import BgpDynamicNeighborCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpDynamicNeighborCreateInput from a JSON string +bgp_dynamic_neighbor_create_input_instance = BgpDynamicNeighborCreateInput.from_json(json) +# print the JSON string representation of the object +print(BgpDynamicNeighborCreateInput.to_json()) + +# convert the object into a dict +bgp_dynamic_neighbor_create_input_dict = bgp_dynamic_neighbor_create_input_instance.to_dict() +# create an instance of BgpDynamicNeighborCreateInput from a dict +bgp_dynamic_neighbor_create_input_form_dict = bgp_dynamic_neighbor_create_input.from_dict(bgp_dynamic_neighbor_create_input_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/BgpDynamicNeighborList.md b/equinix/services/metalv1/docs/BgpDynamicNeighborList.md new file mode 100644 index 00000000..9099ff54 --- /dev/null +++ b/equinix/services/metalv1/docs/BgpDynamicNeighborList.md @@ -0,0 +1,31 @@ +# BgpDynamicNeighborList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bgp_dynamic_neighbors** | [**List[BgpDynamicNeighbor]**](BgpDynamicNeighbor.md) | | [optional] +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bgp_dynamic_neighbor_list import BgpDynamicNeighborList + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpDynamicNeighborList from a JSON string +bgp_dynamic_neighbor_list_instance = BgpDynamicNeighborList.from_json(json) +# print the JSON string representation of the object +print(BgpDynamicNeighborList.to_json()) + +# convert the object into a dict +bgp_dynamic_neighbor_list_dict = bgp_dynamic_neighbor_list_instance.to_dict() +# create an instance of BgpDynamicNeighborList from a dict +bgp_dynamic_neighbor_list_form_dict = bgp_dynamic_neighbor_list.from_dict(bgp_dynamic_neighbor_list_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/BgpNeighborData.md b/equinix/services/metalv1/docs/BgpNeighborData.md new file mode 100644 index 00000000..96c8aac8 --- /dev/null +++ b/equinix/services/metalv1/docs/BgpNeighborData.md @@ -0,0 +1,39 @@ +# BgpNeighborData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_family** | **int** | Address Family for IP Address. Accepted values are 4 or 6 | [optional] +**customer_as** | **int** | The customer's ASN. In a local BGP deployment, this will be an internal ASN used to route within the data center. For a global BGP deployment, this will be the your own ASN, configured when you set up BGP for your project. | [optional] +**customer_ip** | **str** | The device's IP address. For an IPv4 BGP session, this is typically the private bond0 address for the device. | [optional] +**href** | **str** | | [optional] +**md5_enabled** | **bool** | True if an MD5 password is configured for the project. | [optional] +**md5_password** | **str** | The MD5 password configured for the project, if set. | [optional] +**multihop** | **bool** | True when the BGP session should be configured as multihop. | [optional] +**peer_as** | **int** | The Peer ASN to use when configuring BGP on your device. | [optional] +**peer_ips** | **List[str]** | A list of one or more IP addresses to use for the Peer IP section of your BGP configuration. For non-multihop sessions, this will typically be a single gateway address for the device. For multihop sessions, it will be a list of IPs. | [optional] +**routes_in** | [**List[BgpRoute]**](BgpRoute.md) | A list of project subnets | [optional] +**routes_out** | [**List[BgpRoute]**](BgpRoute.md) | A list of outgoing routes. Only populated if the BGP session has default route enabled. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bgp_neighbor_data import BgpNeighborData + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpNeighborData from a JSON string +bgp_neighbor_data_instance = BgpNeighborData.from_json(json) +# print the JSON string representation of the object +print(BgpNeighborData.to_json()) + +# convert the object into a dict +bgp_neighbor_data_dict = bgp_neighbor_data_instance.to_dict() +# create an instance of BgpNeighborData from a dict +bgp_neighbor_data_form_dict = bgp_neighbor_data.from_dict(bgp_neighbor_data_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/BgpRoute.md b/equinix/services/metalv1/docs/BgpRoute.md new file mode 100644 index 00000000..c56c6682 --- /dev/null +++ b/equinix/services/metalv1/docs/BgpRoute.md @@ -0,0 +1,31 @@ +# BgpRoute + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exact** | **bool** | | [optional] +**href** | **str** | | [optional] +**route** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bgp_route import BgpRoute + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpRoute from a JSON string +bgp_route_instance = BgpRoute.from_json(json) +# print the JSON string representation of the object +print(BgpRoute.to_json()) + +# convert the object into a dict +bgp_route_dict = bgp_route_instance.to_dict() +# create an instance of BgpRoute from a dict +bgp_route_form_dict = bgp_route.from_dict(bgp_route_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/BgpSession.md b/equinix/services/metalv1/docs/BgpSession.md new file mode 100644 index 00000000..458840e8 --- /dev/null +++ b/equinix/services/metalv1/docs/BgpSession.md @@ -0,0 +1,37 @@ +# BgpSession + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_family** | **str** | | +**created_at** | **datetime** | | [optional] +**default_route** | **bool** | | [optional] +**device** | [**Href**](Href.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**learned_routes** | **List[str]** | | [optional] +**status** | **str** | The status of the BGP Session. Multiple status values may be reported when the device is connected to multiple switches, one value per switch. Each status will start with \"unknown\" and progress to \"up\" or \"down\" depending on the connected device. Subsequent \"unknown\" values indicate a problem acquiring status from the switch. | [optional] +**updated_at** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bgp_session import BgpSession + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpSession from a JSON string +bgp_session_instance = BgpSession.from_json(json) +# print the JSON string representation of the object +print(BgpSession.to_json()) + +# convert the object into a dict +bgp_session_dict = bgp_session_instance.to_dict() +# create an instance of BgpSession from a dict +bgp_session_form_dict = bgp_session.from_dict(bgp_session_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/BgpSessionList.md b/equinix/services/metalv1/docs/BgpSessionList.md new file mode 100644 index 00000000..90965e6f --- /dev/null +++ b/equinix/services/metalv1/docs/BgpSessionList.md @@ -0,0 +1,30 @@ +# BgpSessionList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bgp_sessions** | [**List[BgpSession]**](BgpSession.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bgp_session_list import BgpSessionList + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpSessionList from a JSON string +bgp_session_list_instance = BgpSessionList.from_json(json) +# print the JSON string representation of the object +print(BgpSessionList.to_json()) + +# convert the object into a dict +bgp_session_list_dict = bgp_session_list_instance.to_dict() +# create an instance of BgpSessionList from a dict +bgp_session_list_form_dict = bgp_session_list.from_dict(bgp_session_list_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/BgpSessionNeighbors.md b/equinix/services/metalv1/docs/BgpSessionNeighbors.md new file mode 100644 index 00000000..9716350d --- /dev/null +++ b/equinix/services/metalv1/docs/BgpSessionNeighbors.md @@ -0,0 +1,30 @@ +# BgpSessionNeighbors + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bgp_neighbors** | [**List[BgpNeighborData]**](BgpNeighborData.md) | A list of BGP session neighbor data | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bgp_session_neighbors import BgpSessionNeighbors + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpSessionNeighbors from a JSON string +bgp_session_neighbors_instance = BgpSessionNeighbors.from_json(json) +# print the JSON string representation of the object +print(BgpSessionNeighbors.to_json()) + +# convert the object into a dict +bgp_session_neighbors_dict = bgp_session_neighbors_instance.to_dict() +# create an instance of BgpSessionNeighbors from a dict +bgp_session_neighbors_form_dict = bgp_session_neighbors.from_dict(bgp_session_neighbors_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/BondPortData.md b/equinix/services/metalv1/docs/BondPortData.md new file mode 100644 index 00000000..0f48161e --- /dev/null +++ b/equinix/services/metalv1/docs/BondPortData.md @@ -0,0 +1,31 @@ +# BondPortData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**id** | **str** | ID of the bonding port | [optional] +**name** | **str** | Name of the port interface for the bond (\"bond0\") | [optional] + +## Example + +```python +from equinix.services.metalv1.models.bond_port_data import BondPortData + +# TODO update the JSON string below +json = "{}" +# create an instance of BondPortData from a JSON string +bond_port_data_instance = BondPortData.from_json(json) +# print the JSON string representation of the object +print(BondPortData.to_json()) + +# convert the object into a dict +bond_port_data_dict = bond_port_data_instance.to_dict() +# create an instance of BondPortData from a dict +bond_port_data_form_dict = bond_port_data.from_dict(bond_port_data_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/CapacityApi.md b/equinix/services/metalv1/docs/CapacityApi.md new file mode 100644 index 00000000..da1b9a2a --- /dev/null +++ b/equinix/services/metalv1/docs/CapacityApi.md @@ -0,0 +1,486 @@ +# equinix.services.metalv1.CapacityApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**check_capacity_for_facility**](CapacityApi.md#check_capacity_for_facility) | **POST** /capacity | Check capacity +[**check_capacity_for_metro**](CapacityApi.md#check_capacity_for_metro) | **POST** /capacity/metros | Check capacity for a metro +[**find_capacity_for_facility**](CapacityApi.md#find_capacity_for_facility) | **GET** /capacity | View capacity +[**find_capacity_for_metro**](CapacityApi.md#find_capacity_for_metro) | **GET** /capacity/metros | View capacity for metros +[**find_organization_capacity_per_facility**](CapacityApi.md#find_organization_capacity_per_facility) | **GET** /organizations/{id}/capacity | View available hardware plans per Facility for given organization +[**find_organization_capacity_per_metro**](CapacityApi.md#find_organization_capacity_per_metro) | **GET** /organizations/{id}/capacity/metros | View available hardware plans per Metro for given organization + + +# **check_capacity_for_facility** +> CapacityCheckPerFacilityList check_capacity_for_facility(capacity_input) + +Check capacity + +Validates if a deploy can be fulfilled. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.capacity_check_per_facility_list import CapacityCheckPerFacilityList +from equinix.services.metalv1.models.capacity_input import CapacityInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.CapacityApi(api_client) + capacity_input = equinix.services.metalv1.CapacityInput() # CapacityInput | Facility to check capacity in + + try: + # Check capacity + api_response = api_instance.check_capacity_for_facility(capacity_input) + print("The response of CapacityApi->check_capacity_for_facility:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CapacityApi->check_capacity_for_facility: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **capacity_input** | [**CapacityInput**](CapacityInput.md)| Facility to check capacity in | + +### Return type + +[**CapacityCheckPerFacilityList**](CapacityCheckPerFacilityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **check_capacity_for_metro** +> CapacityCheckPerMetroList check_capacity_for_metro(capacity_input) + +Check capacity for a metro + +Validates if a deploy can be fulfilled in a metro. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.capacity_check_per_metro_list import CapacityCheckPerMetroList +from equinix.services.metalv1.models.capacity_input import CapacityInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.CapacityApi(api_client) + capacity_input = equinix.services.metalv1.CapacityInput() # CapacityInput | Metro to check capacity in + + try: + # Check capacity for a metro + api_response = api_instance.check_capacity_for_metro(capacity_input) + print("The response of CapacityApi->check_capacity_for_metro:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CapacityApi->check_capacity_for_metro: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **capacity_input** | [**CapacityInput**](CapacityInput.md)| Metro to check capacity in | + +### Return type + +[**CapacityCheckPerMetroList**](CapacityCheckPerMetroList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_capacity_for_facility** +> CapacityList find_capacity_for_facility() + +View capacity + +Returns a list of facilities and plans with their current capacity. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.capacity_list import CapacityList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.CapacityApi(api_client) + + try: + # View capacity + api_response = api_instance.find_capacity_for_facility() + print("The response of CapacityApi->find_capacity_for_facility:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CapacityApi->find_capacity_for_facility: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**CapacityList**](CapacityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_capacity_for_metro** +> CapacityList find_capacity_for_metro() + +View capacity for metros + +Returns a list of metros and plans with their current capacity. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.capacity_list import CapacityList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.CapacityApi(api_client) + + try: + # View capacity for metros + api_response = api_instance.find_capacity_for_metro() + print("The response of CapacityApi->find_capacity_for_metro:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CapacityApi->find_capacity_for_metro: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**CapacityList**](CapacityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_capacity_per_facility** +> CapacityList find_organization_capacity_per_facility(id) + +View available hardware plans per Facility for given organization + +Returns a list of facilities and plans with their current capacity. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.capacity_list import CapacityList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.CapacityApi(api_client) + id = 'id_example' # str | Organization UUID + + try: + # View available hardware plans per Facility for given organization + api_response = api_instance.find_organization_capacity_per_facility(id) + print("The response of CapacityApi->find_organization_capacity_per_facility:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CapacityApi->find_organization_capacity_per_facility: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + +### Return type + +[**CapacityList**](CapacityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_capacity_per_metro** +> CapacityList find_organization_capacity_per_metro(id) + +View available hardware plans per Metro for given organization + +Returns a list of metros and plans with their current capacity. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.capacity_list import CapacityList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.CapacityApi(api_client) + id = 'id_example' # str | Organization UUID + + try: + # View available hardware plans per Metro for given organization + api_response = api_instance.find_organization_capacity_per_metro(id) + print("The response of CapacityApi->find_organization_capacity_per_metro:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CapacityApi->find_organization_capacity_per_metro: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + +### Return type + +[**CapacityList**](CapacityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/CapacityCheckPerFacilityInfo.md b/equinix/services/metalv1/docs/CapacityCheckPerFacilityInfo.md new file mode 100644 index 00000000..4bbb07e9 --- /dev/null +++ b/equinix/services/metalv1/docs/CapacityCheckPerFacilityInfo.md @@ -0,0 +1,33 @@ +# CapacityCheckPerFacilityInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available** | **bool** | | [optional] +**facility** | **str** | | [optional] +**href** | **str** | | [optional] +**plan** | **str** | | [optional] +**quantity** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.capacity_check_per_facility_info import CapacityCheckPerFacilityInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of CapacityCheckPerFacilityInfo from a JSON string +capacity_check_per_facility_info_instance = CapacityCheckPerFacilityInfo.from_json(json) +# print the JSON string representation of the object +print(CapacityCheckPerFacilityInfo.to_json()) + +# convert the object into a dict +capacity_check_per_facility_info_dict = capacity_check_per_facility_info_instance.to_dict() +# create an instance of CapacityCheckPerFacilityInfo from a dict +capacity_check_per_facility_info_form_dict = capacity_check_per_facility_info.from_dict(capacity_check_per_facility_info_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/CapacityCheckPerFacilityList.md b/equinix/services/metalv1/docs/CapacityCheckPerFacilityList.md new file mode 100644 index 00000000..22534bb9 --- /dev/null +++ b/equinix/services/metalv1/docs/CapacityCheckPerFacilityList.md @@ -0,0 +1,30 @@ +# CapacityCheckPerFacilityList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**servers** | [**List[CapacityCheckPerFacilityInfo]**](CapacityCheckPerFacilityInfo.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.capacity_check_per_facility_list import CapacityCheckPerFacilityList + +# TODO update the JSON string below +json = "{}" +# create an instance of CapacityCheckPerFacilityList from a JSON string +capacity_check_per_facility_list_instance = CapacityCheckPerFacilityList.from_json(json) +# print the JSON string representation of the object +print(CapacityCheckPerFacilityList.to_json()) + +# convert the object into a dict +capacity_check_per_facility_list_dict = capacity_check_per_facility_list_instance.to_dict() +# create an instance of CapacityCheckPerFacilityList from a dict +capacity_check_per_facility_list_form_dict = capacity_check_per_facility_list.from_dict(capacity_check_per_facility_list_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/CapacityCheckPerMetroInfo.md b/equinix/services/metalv1/docs/CapacityCheckPerMetroInfo.md new file mode 100644 index 00000000..2be05228 --- /dev/null +++ b/equinix/services/metalv1/docs/CapacityCheckPerMetroInfo.md @@ -0,0 +1,33 @@ +# CapacityCheckPerMetroInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available** | **bool** | Returns true if there is enough capacity in the metro to fulfill the quantity set. Returns false if there is not enough. | [optional] +**href** | **str** | | [optional] +**metro** | **str** | The metro ID or code sent to check capacity. | [optional] +**plan** | **str** | The plan ID or slug sent to check capacity. | [optional] +**quantity** | **str** | The number of servers sent to check capacity. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.capacity_check_per_metro_info import CapacityCheckPerMetroInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of CapacityCheckPerMetroInfo from a JSON string +capacity_check_per_metro_info_instance = CapacityCheckPerMetroInfo.from_json(json) +# print the JSON string representation of the object +print(CapacityCheckPerMetroInfo.to_json()) + +# convert the object into a dict +capacity_check_per_metro_info_dict = capacity_check_per_metro_info_instance.to_dict() +# create an instance of CapacityCheckPerMetroInfo from a dict +capacity_check_per_metro_info_form_dict = capacity_check_per_metro_info.from_dict(capacity_check_per_metro_info_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/CapacityCheckPerMetroList.md b/equinix/services/metalv1/docs/CapacityCheckPerMetroList.md new file mode 100644 index 00000000..90f4fad1 --- /dev/null +++ b/equinix/services/metalv1/docs/CapacityCheckPerMetroList.md @@ -0,0 +1,30 @@ +# CapacityCheckPerMetroList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**servers** | [**List[CapacityCheckPerMetroInfo]**](CapacityCheckPerMetroInfo.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.capacity_check_per_metro_list import CapacityCheckPerMetroList + +# TODO update the JSON string below +json = "{}" +# create an instance of CapacityCheckPerMetroList from a JSON string +capacity_check_per_metro_list_instance = CapacityCheckPerMetroList.from_json(json) +# print the JSON string representation of the object +print(CapacityCheckPerMetroList.to_json()) + +# convert the object into a dict +capacity_check_per_metro_list_dict = capacity_check_per_metro_list_instance.to_dict() +# create an instance of CapacityCheckPerMetroList from a dict +capacity_check_per_metro_list_form_dict = capacity_check_per_metro_list.from_dict(capacity_check_per_metro_list_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/CapacityInput.md b/equinix/services/metalv1/docs/CapacityInput.md new file mode 100644 index 00000000..9c666d85 --- /dev/null +++ b/equinix/services/metalv1/docs/CapacityInput.md @@ -0,0 +1,30 @@ +# CapacityInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**servers** | [**List[ServerInfo]**](ServerInfo.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.capacity_input import CapacityInput + +# TODO update the JSON string below +json = "{}" +# create an instance of CapacityInput from a JSON string +capacity_input_instance = CapacityInput.from_json(json) +# print the JSON string representation of the object +print(CapacityInput.to_json()) + +# convert the object into a dict +capacity_input_dict = capacity_input_instance.to_dict() +# create an instance of CapacityInput from a dict +capacity_input_form_dict = capacity_input.from_dict(capacity_input_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/CapacityLevelPerBaremetal.md b/equinix/services/metalv1/docs/CapacityLevelPerBaremetal.md new file mode 100644 index 00000000..ce9da274 --- /dev/null +++ b/equinix/services/metalv1/docs/CapacityLevelPerBaremetal.md @@ -0,0 +1,30 @@ +# CapacityLevelPerBaremetal + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**level** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.capacity_level_per_baremetal import CapacityLevelPerBaremetal + +# TODO update the JSON string below +json = "{}" +# create an instance of CapacityLevelPerBaremetal from a JSON string +capacity_level_per_baremetal_instance = CapacityLevelPerBaremetal.from_json(json) +# print the JSON string representation of the object +print(CapacityLevelPerBaremetal.to_json()) + +# convert the object into a dict +capacity_level_per_baremetal_dict = capacity_level_per_baremetal_instance.to_dict() +# create an instance of CapacityLevelPerBaremetal from a dict +capacity_level_per_baremetal_form_dict = capacity_level_per_baremetal.from_dict(capacity_level_per_baremetal_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/CapacityList.md b/equinix/services/metalv1/docs/CapacityList.md new file mode 100644 index 00000000..61e0c2d0 --- /dev/null +++ b/equinix/services/metalv1/docs/CapacityList.md @@ -0,0 +1,30 @@ +# CapacityList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capacity** | **Dict[str, Dict[str, CapacityLevelPerBaremetal]]** | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.capacity_list import CapacityList + +# TODO update the JSON string below +json = "{}" +# create an instance of CapacityList from a JSON string +capacity_list_instance = CapacityList.from_json(json) +# print the JSON string representation of the object +print(CapacityList.to_json()) + +# convert the object into a dict +capacity_list_dict = capacity_list_instance.to_dict() +# create an instance of CapacityList from a dict +capacity_list_form_dict = capacity_list.from_dict(capacity_list_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/Component.md b/equinix/services/metalv1/docs/Component.md new file mode 100644 index 00000000..2f1fa04d --- /dev/null +++ b/equinix/services/metalv1/docs/Component.md @@ -0,0 +1,40 @@ +# Component + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**checksum** | **str** | File checksum | [optional] [readonly] +**component** | **str** | Component type | [optional] [readonly] +**created_at** | **datetime** | Datetime when the block was created. | [optional] [readonly] +**filename** | **str** | name of the file | [optional] [readonly] +**href** | **str** | | [optional] +**model** | **List[str]** | List of models where this component version can be applied | [optional] [readonly] +**repository_url** | **str** | Location of the file in the repository | [optional] [readonly] +**updated_at** | **datetime** | Datetime when the block was updated. | [optional] [readonly] +**upstream_url** | **str** | Location of the file | [optional] [readonly] +**uuid** | **str** | Component UUID | [optional] [readonly] +**vendor** | **str** | Component vendor | [optional] [readonly] +**version** | **str** | Version of the component | [optional] [readonly] + +## Example + +```python +from equinix.services.metalv1.models.component import Component + +# TODO update the JSON string below +json = "{}" +# create an instance of Component from a JSON string +component_instance = Component.from_json(json) +# print the JSON string representation of the object +print(Component.to_json()) + +# convert the object into a dict +component_dict = component_instance.to_dict() +# create an instance of Component from a dict +component_form_dict = component.from_dict(component_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/ConsoleLogDetailsApi.md b/equinix/services/metalv1/docs/ConsoleLogDetailsApi.md new file mode 100644 index 00000000..e43647a0 --- /dev/null +++ b/equinix/services/metalv1/docs/ConsoleLogDetailsApi.md @@ -0,0 +1,88 @@ +# equinix.services.metalv1.ConsoleLogDetailsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**capture_screenshot**](ConsoleLogDetailsApi.md#capture_screenshot) | **GET** /devices/{id}/diagnostics/screenshot | + + +# **capture_screenshot** +> bytearray capture_screenshot(id) + + + +Capture a screenshot from the device, if supported, via the BMC. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ConsoleLogDetailsApi(api_client) + id = 'id_example' # str | Device UUID + + try: + api_response = api_instance.capture_screenshot(id) + print("The response of ConsoleLogDetailsApi->capture_screenshot:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConsoleLogDetailsApi->capture_screenshot: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + +### Return type + +**bytearray** + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/jpeg, application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | An image file | - | +**403** | forbidden | - | +**404** | not found | - | +**501** | not implemented for device | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Coordinates.md b/equinix/services/metalv1/docs/Coordinates.md new file mode 100644 index 00000000..8f4c07a7 --- /dev/null +++ b/equinix/services/metalv1/docs/Coordinates.md @@ -0,0 +1,31 @@ +# Coordinates + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**latitude** | **str** | | [optional] +**longitude** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.coordinates import Coordinates + +# TODO update the JSON string below +json = "{}" +# create an instance of Coordinates from a JSON string +coordinates_instance = Coordinates.from_json(json) +# print the JSON string representation of the object +print(Coordinates.to_json()) + +# convert the object into a dict +coordinates_dict = coordinates_instance.to_dict() +# create an instance of Coordinates from a dict +coordinates_form_dict = coordinates.from_dict(coordinates_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/CreateDeviceRequest.md b/equinix/services/metalv1/docs/CreateDeviceRequest.md new file mode 100644 index 00000000..4ce9e16d --- /dev/null +++ b/equinix/services/metalv1/docs/CreateDeviceRequest.md @@ -0,0 +1,56 @@ +# CreateDeviceRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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] +**customdata** | **Dict[str, object]** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] +**description** | **str** | Any description of the device or how it will be used. This may be used to inform other API consumers with project access. | [optional] +**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}]] +**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] +**no_ssh_keys** | **bool** | Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified | [optional] [default to False] +**operating_system** | **str** | The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. | +**plan** | **str** | The slug of the device plan to provision. | +**private_ipv4_subnet_size** | **int** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. | [optional] +**project_ssh_keys** | **List[str]** | A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**public_ipv4_subnet_size** | **int** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. | [optional] +**spot_instance** | **bool** | Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. | [optional] +**spot_price_max** | **float** | The maximum amount to bid for a spot instance. | [optional] +**ssh_keys** | [**List[SSHKeyInput]**](SSHKeyInput.md) | A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. | [optional] +**storage** | [**Storage**](Storage.md) | | [optional] +**tags** | **List[str]** | | [optional] +**termination_time** | **datetime** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**user_ssh_keys** | **List[str]** | A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**userdata** | **str** | 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. | [optional] +**facility** | [**FacilityInputFacility**](FacilityInputFacility.md) | | + +## Example + +```python +from equinix.services.metalv1.models.create_device_request import CreateDeviceRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateDeviceRequest from a JSON string +create_device_request_instance = CreateDeviceRequest.from_json(json) +# print the JSON string representation of the object +print(CreateDeviceRequest.to_json()) + +# convert the object into a dict +create_device_request_dict = create_device_request_instance.to_dict() +# create an instance of CreateDeviceRequest from a dict +create_device_request_form_dict = create_device_request.from_dict(create_device_request_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/CreateEmailInput.md b/equinix/services/metalv1/docs/CreateEmailInput.md new file mode 100644 index 00000000..acdf3818 --- /dev/null +++ b/equinix/services/metalv1/docs/CreateEmailInput.md @@ -0,0 +1,30 @@ +# CreateEmailInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.create_email_input import CreateEmailInput + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateEmailInput from a JSON string +create_email_input_instance = CreateEmailInput.from_json(json) +# print the JSON string representation of the object +print(CreateEmailInput.to_json()) + +# convert the object into a dict +create_email_input_dict = create_email_input_instance.to_dict() +# create an instance of CreateEmailInput from a dict +create_email_input_form_dict = create_email_input.from_dict(create_email_input_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/CreateMetalGatewayRequest.md b/equinix/services/metalv1/docs/CreateMetalGatewayRequest.md new file mode 100644 index 00000000..9790fb27 --- /dev/null +++ b/equinix/services/metalv1/docs/CreateMetalGatewayRequest.md @@ -0,0 +1,32 @@ +# CreateMetalGatewayRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**ip_reservation_id** | **str** | The UUID an a VRF IP Reservation that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the VRF IP Reservation and the Virtual Network must reside in the same Metro. | +**private_ipv4_subnet_size** | **int** | The subnet size (8, 16, 32, 64, or 128) of the private IPv4 reservation that will be created for the metal gateway. This field is required unless a project IP reservation was specified. Please keep in mind that the number of private metal gateway ranges are limited per project. If you would like to increase the limit per project, please contact support for assistance. | [optional] +**virtual_network_id** | **str** | The UUID of a Metro Virtual Network that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the Virtual Network and the VRF IP Reservation must reside in the same metro. In the case of the IP reservation being an IPv6 based VRF IP Reservation, the Virtual Network must not already have an associated IPv6 based VRF IP Reservation. There can be exactly one IPv6 based VRF IP Reservation associated to a Virtual Network. | + +## Example + +```python +from equinix.services.metalv1.models.create_metal_gateway_request import CreateMetalGatewayRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateMetalGatewayRequest from a JSON string +create_metal_gateway_request_instance = CreateMetalGatewayRequest.from_json(json) +# print the JSON string representation of the object +print(CreateMetalGatewayRequest.to_json()) + +# convert the object into a dict +create_metal_gateway_request_dict = create_metal_gateway_request_instance.to_dict() +# create an instance of CreateMetalGatewayRequest from a dict +create_metal_gateway_request_form_dict = create_metal_gateway_request.from_dict(create_metal_gateway_request_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/CreateOrganizationInterconnectionRequest.md b/equinix/services/metalv1/docs/CreateOrganizationInterconnectionRequest.md new file mode 100644 index 00000000..ee340919 --- /dev/null +++ b/equinix/services/metalv1/docs/CreateOrganizationInterconnectionRequest.md @@ -0,0 +1,46 @@ +# CreateOrganizationInterconnectionRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**billing_account_name** | **str** | The billing account name of the Equinix Fabric account. | [optional] +**contact_email** | **str** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. | [optional] +**description** | **str** | | [optional] +**facility_id** | **str** | | [optional] +**href** | **str** | | [optional] +**metro** | **str** | A Metro ID or code. When creating 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), or shared connections, 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** | **str** | The mode of the interconnection (only relevant to Dedicated Ports). Fabric VCs 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** | | +**project** | **str** | | +**redundancy** | **str** | Either 'primary' or 'redundant'. | +**speed** | **str** | A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | When requesting for a dedicated port, the value of this field should be 'dedicated'. | +**use_case** | **str** | The intended use case of the dedicated port. | [optional] +**service_token_type** | **str** | Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. | +**vlans** | **List[int]** | A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. | +**vrfs** | **List[str]** | This field holds a list of VRF UUIDs that will be set automatically on the virtual circuits of Fabric VCs on creation, and can hold up to two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. The first UUID will be set on the primary virtual circuit, while the second UUID will be set on the secondary. The two UUIDs can be the same if both the primary and secondary virtual circuits will be in the same VRF. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. | +**fabric_provider** | [**VlanCSPConnectionCreateInputFabricProvider**](VlanCSPConnectionCreateInputFabricProvider.md) | | + +## Example + +```python +from equinix.services.metalv1.models.create_organization_interconnection_request import CreateOrganizationInterconnectionRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateOrganizationInterconnectionRequest from a JSON string +create_organization_interconnection_request_instance = CreateOrganizationInterconnectionRequest.from_json(json) +# print the JSON string representation of the object +print(CreateOrganizationInterconnectionRequest.to_json()) + +# convert the object into a dict +create_organization_interconnection_request_dict = create_organization_interconnection_request_instance.to_dict() +# create an instance of CreateOrganizationInterconnectionRequest from a dict +create_organization_interconnection_request_form_dict = create_organization_interconnection_request.from_dict(create_organization_interconnection_request_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/CreateSelfServiceReservationRequest.md b/equinix/services/metalv1/docs/CreateSelfServiceReservationRequest.md new file mode 100644 index 00000000..f55ecef1 --- /dev/null +++ b/equinix/services/metalv1/docs/CreateSelfServiceReservationRequest.md @@ -0,0 +1,33 @@ +# CreateSelfServiceReservationRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**item** | [**List[SelfServiceReservationItemRequest]**](SelfServiceReservationItemRequest.md) | | [optional] +**notes** | **str** | | [optional] +**period** | [**CreateSelfServiceReservationRequestPeriod**](CreateSelfServiceReservationRequestPeriod.md) | | [optional] +**start_date** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.create_self_service_reservation_request import CreateSelfServiceReservationRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSelfServiceReservationRequest from a JSON string +create_self_service_reservation_request_instance = CreateSelfServiceReservationRequest.from_json(json) +# print the JSON string representation of the object +print(CreateSelfServiceReservationRequest.to_json()) + +# convert the object into a dict +create_self_service_reservation_request_dict = create_self_service_reservation_request_instance.to_dict() +# create an instance of CreateSelfServiceReservationRequest from a dict +create_self_service_reservation_request_form_dict = create_self_service_reservation_request.from_dict(create_self_service_reservation_request_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/CreateSelfServiceReservationRequestPeriod.md b/equinix/services/metalv1/docs/CreateSelfServiceReservationRequestPeriod.md new file mode 100644 index 00000000..dd8297b9 --- /dev/null +++ b/equinix/services/metalv1/docs/CreateSelfServiceReservationRequestPeriod.md @@ -0,0 +1,31 @@ +# CreateSelfServiceReservationRequestPeriod + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | | [optional] +**href** | **str** | | [optional] +**unit** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.create_self_service_reservation_request_period import CreateSelfServiceReservationRequestPeriod + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSelfServiceReservationRequestPeriod from a JSON string +create_self_service_reservation_request_period_instance = CreateSelfServiceReservationRequestPeriod.from_json(json) +# print the JSON string representation of the object +print(CreateSelfServiceReservationRequestPeriod.to_json()) + +# convert the object into a dict +create_self_service_reservation_request_period_dict = create_self_service_reservation_request_period_instance.to_dict() +# create an instance of CreateSelfServiceReservationRequestPeriod from a dict +create_self_service_reservation_request_period_form_dict = create_self_service_reservation_request_period.from_dict(create_self_service_reservation_request_period_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/DedicatedPortCreateInput.md b/equinix/services/metalv1/docs/DedicatedPortCreateInput.md new file mode 100644 index 00000000..d4428c7b --- /dev/null +++ b/equinix/services/metalv1/docs/DedicatedPortCreateInput.md @@ -0,0 +1,42 @@ +# DedicatedPortCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**billing_account_name** | **str** | The billing account name of the Equinix Fabric account. | [optional] +**contact_email** | **str** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. | [optional] +**description** | **str** | | [optional] +**facility_id** | **str** | | [optional] +**href** | **str** | | [optional] +**metro** | **str** | A Metro ID or code. For interconnections with Dedicated Ports, this will be the location of the issued Dedicated Ports. | +**mode** | **str** | The mode of the interconnection (only relevant to Dedicated Ports). Fabric VCs 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** | | +**project** | **str** | | [optional] +**redundancy** | **str** | Either 'primary' or 'redundant'. | +**speed** | **str** | A interconnection speed, in bps, mbps, or gbps. For Dedicated Ports, this can be 10Gbps or 100Gbps. | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | When requesting for a dedicated port, the value of this field should be 'dedicated'. | +**use_case** | **str** | The intended use case of the dedicated port. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.dedicated_port_create_input import DedicatedPortCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of DedicatedPortCreateInput from a JSON string +dedicated_port_create_input_instance = DedicatedPortCreateInput.from_json(json) +# print the JSON string representation of the object +print(DedicatedPortCreateInput.to_json()) + +# convert the object into a dict +dedicated_port_create_input_dict = dedicated_port_create_input_instance.to_dict() +# create an instance of DedicatedPortCreateInput from a dict +dedicated_port_create_input_form_dict = dedicated_port_create_input.from_dict(dedicated_port_create_input_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/Device.md b/equinix/services/metalv1/docs/Device.md new file mode 100644 index 00000000..ac230c9d --- /dev/null +++ b/equinix/services/metalv1/docs/Device.md @@ -0,0 +1,71 @@ +# Device + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**actions** | [**List[DeviceActionsInner]**](DeviceActionsInner.md) | Actions supported by the device instance. | [optional] +**always_pxe** | **bool** | | [optional] +**billing_cycle** | **str** | | [optional] +**bonding_mode** | **int** | | [optional] +**created_at** | **datetime** | | [optional] +**created_by** | [**DeviceCreatedBy**](DeviceCreatedBy.md) | | [optional] +**customdata** | **Dict[str, object]** | | [optional] +**description** | **str** | | [optional] +**facility** | [**Facility**](Facility.md) | | [optional] +**firmware_set_id** | **str** | The UUID of the firmware set to associate with the device. | [optional] +**hardware_reservation** | [**HardwareReservation**](HardwareReservation.md) | | [optional] +**hostname** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**image_url** | **str** | | [optional] +**ip_addresses** | [**List[IPAssignment]**](IPAssignment.md) | | [optional] +**ipxe_script_url** | **str** | | [optional] +**iqn** | **str** | | [optional] +**locked** | **bool** | Prevents accidental deletion of this resource when set to true. | [optional] +**metro** | [**DeviceMetro**](DeviceMetro.md) | | [optional] +**network_frozen** | **bool** | Whether network mode changes such as converting to/from Layer2 or Layer3 networking, bonding or disbonding network interfaces are permitted for the device. | [optional] +**network_ports** | [**List[Port]**](Port.md) | By default, servers at Equinix Metal are configured in a “bonded” mode using LACP (Link Aggregation Control Protocol). Each 2-NIC server is configured with a single bond (namely bond0) with both interfaces eth0 and eth1 as members of the bond in a default Layer 3 mode. Some device plans may have a different number of ports and bonds available. | [optional] +**operating_system** | [**OperatingSystem**](OperatingSystem.md) | | [optional] +**plan** | [**Plan**](Plan.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**project_lite** | [**DeviceProjectLite**](DeviceProjectLite.md) | | [optional] +**provisioning_events** | [**List[Event]**](Event.md) | | [optional] +**provisioning_percentage** | **float** | Only visible while device provisioning | [optional] +**root_password** | **str** | Root password is automatically generated when server is provisioned and it is removed after 24 hours | [optional] +**short_id** | **str** | | [optional] +**sos** | **str** | Hostname used to connect to the instance via the SOS (Serial over SSH) out-of-band console. | [optional] +**spot_instance** | **bool** | Whether or not the device is a spot instance. | [optional] +**spot_price_max** | **float** | The maximum price per hour you are willing to pay to keep this spot instance. If you are outbid, the termination will be set allowing two minutes before shutdown. | [optional] +**ssh_keys** | [**List[Href]**](Href.md) | | [optional] +**state** | **str** | The current state the instance is in. * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. * Once provisioning has begun on the instance it's state will move to `provisioning`. * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. * If an instance fails to provision or deprovision it will move to `failed` state. * Once an instance has completed provisioning it will move to `active` state. * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. * When the instance is powered off completely it will move to the `inactive` state. * When an instance is powered on completely it will move to the `active` state. * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. * When the reinstall action is complete the instance will move to `active` state. | [optional] +**storage** | [**Storage**](Storage.md) | | [optional] +**switch_uuid** | **str** | Switch short id. This can be used to determine if two devices are connected to the same switch, for example. | [optional] +**tags** | **List[str]** | | [optional] +**termination_time** | **datetime** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**updated_at** | **datetime** | | [optional] +**user** | **str** | | [optional] +**userdata** | **str** | | [optional] +**volumes** | [**List[Href]**](Href.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.device import Device + +# TODO update the JSON string below +json = "{}" +# create an instance of Device from a JSON string +device_instance = Device.from_json(json) +# print the JSON string representation of the object +print(Device.to_json()) + +# convert the object into a dict +device_dict = device_instance.to_dict() +# create an instance of Device from a dict +device_form_dict = device.from_dict(device_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/DeviceActionInput.md b/equinix/services/metalv1/docs/DeviceActionInput.md new file mode 100644 index 00000000..b45fb2a8 --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceActionInput.md @@ -0,0 +1,35 @@ +# DeviceActionInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deprovision_fast** | **bool** | When type is `reinstall`, enabling fast deprovisioning will bypass full disk wiping. | [optional] +**force_delete** | **bool** | May be required to perform actions under certain conditions | [optional] +**href** | **str** | | [optional] +**ipxe_script_url** | **str** | When type is `reinstall`, use this `ipxe_script_url` (`operating_system` must be `custom_ipxe`, defaults to the current `ipxe_script_url`) | [optional] +**operating_system** | **str** | When type is `reinstall`, use this `operating_system` (defaults to the current `operating system`) | [optional] +**preserve_data** | **bool** | When type is `reinstall`, preserve the existing data on all disks except the operating-system disk. | [optional] +**type** | **str** | Action to perform. See Device.actions for possible actions. | + +## Example + +```python +from equinix.services.metalv1.models.device_action_input import DeviceActionInput + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceActionInput from a JSON string +device_action_input_instance = DeviceActionInput.from_json(json) +# print the JSON string representation of the object +print(DeviceActionInput.to_json()) + +# convert the object into a dict +device_action_input_dict = device_action_input_instance.to_dict() +# create an instance of DeviceActionInput from a dict +device_action_input_form_dict = device_action_input.from_dict(device_action_input_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/DeviceActionsInner.md b/equinix/services/metalv1/docs/DeviceActionsInner.md new file mode 100644 index 00000000..ad8dfc3b --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceActionsInner.md @@ -0,0 +1,31 @@ +# DeviceActionsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**name** | **str** | | [optional] +**type** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.device_actions_inner import DeviceActionsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceActionsInner from a JSON string +device_actions_inner_instance = DeviceActionsInner.from_json(json) +# print the JSON string representation of the object +print(DeviceActionsInner.to_json()) + +# convert the object into a dict +device_actions_inner_dict = device_actions_inner_instance.to_dict() +# create an instance of DeviceActionsInner from a dict +device_actions_inner_form_dict = device_actions_inner.from_dict(device_actions_inner_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/DeviceCreateInFacilityInput.md b/equinix/services/metalv1/docs/DeviceCreateInFacilityInput.md new file mode 100644 index 00000000..0eacc8d9 --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceCreateInFacilityInput.md @@ -0,0 +1,55 @@ +# DeviceCreateInFacilityInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**facility** | [**FacilityInputFacility**](FacilityInputFacility.md) | | +**href** | **str** | | [optional] +**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] +**customdata** | **Dict[str, object]** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] +**description** | **str** | Any description of the device or how it will be used. This may be used to inform other API consumers with project access. | [optional] +**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}]] +**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] +**no_ssh_keys** | **bool** | Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified | [optional] [default to False] +**operating_system** | **str** | The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. | +**plan** | **str** | The slug of the device plan to provision. | +**private_ipv4_subnet_size** | **int** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. | [optional] +**project_ssh_keys** | **List[str]** | A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**public_ipv4_subnet_size** | **int** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. | [optional] +**spot_instance** | **bool** | Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. | [optional] +**spot_price_max** | **float** | The maximum amount to bid for a spot instance. | [optional] +**ssh_keys** | [**List[SSHKeyInput]**](SSHKeyInput.md) | A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. | [optional] +**storage** | [**Storage**](Storage.md) | | [optional] +**tags** | **List[str]** | | [optional] +**termination_time** | **datetime** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**user_ssh_keys** | **List[str]** | A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**userdata** | **str** | 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. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.device_create_in_facility_input import DeviceCreateInFacilityInput + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceCreateInFacilityInput from a JSON string +device_create_in_facility_input_instance = DeviceCreateInFacilityInput.from_json(json) +# print the JSON string representation of the object +print(DeviceCreateInFacilityInput.to_json()) + +# convert the object into a dict +device_create_in_facility_input_dict = device_create_in_facility_input_instance.to_dict() +# create an instance of DeviceCreateInFacilityInput from a dict +device_create_in_facility_input_form_dict = device_create_in_facility_input.from_dict(device_create_in_facility_input_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/DeviceCreateInMetroInput.md b/equinix/services/metalv1/docs/DeviceCreateInMetroInput.md new file mode 100644 index 00000000..4f9f118e --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceCreateInMetroInput.md @@ -0,0 +1,55 @@ +# DeviceCreateInMetroInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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] +**customdata** | **Dict[str, object]** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] +**description** | **str** | Any description of the device or how it will be used. This may be used to inform other API consumers with project access. | [optional] +**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}]] +**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] +**no_ssh_keys** | **bool** | Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified | [optional] [default to False] +**operating_system** | **str** | The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. | +**plan** | **str** | The slug of the device plan to provision. | +**private_ipv4_subnet_size** | **int** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. | [optional] +**project_ssh_keys** | **List[str]** | A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**public_ipv4_subnet_size** | **int** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. | [optional] +**spot_instance** | **bool** | Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. | [optional] +**spot_price_max** | **float** | The maximum amount to bid for a spot instance. | [optional] +**ssh_keys** | [**List[SSHKeyInput]**](SSHKeyInput.md) | A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. | [optional] +**storage** | [**Storage**](Storage.md) | | [optional] +**tags** | **List[str]** | | [optional] +**termination_time** | **datetime** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**user_ssh_keys** | **List[str]** | A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**userdata** | **str** | 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. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.device_create_in_metro_input import DeviceCreateInMetroInput + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceCreateInMetroInput from a JSON string +device_create_in_metro_input_instance = DeviceCreateInMetroInput.from_json(json) +# print the JSON string representation of the object +print(DeviceCreateInMetroInput.to_json()) + +# convert the object into a dict +device_create_in_metro_input_dict = device_create_in_metro_input_instance.to_dict() +# create an instance of DeviceCreateInMetroInput from a dict +device_create_in_metro_input_form_dict = device_create_in_metro_input.from_dict(device_create_in_metro_input_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/DeviceCreateInput.md b/equinix/services/metalv1/docs/DeviceCreateInput.md new file mode 100644 index 00000000..efc3db05 --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceCreateInput.md @@ -0,0 +1,54 @@ +# DeviceCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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] +**customdata** | **Dict[str, object]** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] +**description** | **str** | Any description of the device or how it will be used. This may be used to inform other API consumers with project access. | [optional] +**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] +**href** | **str** | | [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}]] +**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] +**no_ssh_keys** | **bool** | Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified | [optional] [default to False] +**operating_system** | **str** | The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. | +**plan** | **str** | The slug of the device plan to provision. | +**private_ipv4_subnet_size** | **int** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. | [optional] +**project_ssh_keys** | **List[str]** | A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**public_ipv4_subnet_size** | **int** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. | [optional] +**spot_instance** | **bool** | Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. | [optional] +**spot_price_max** | **float** | The maximum amount to bid for a spot instance. | [optional] +**ssh_keys** | [**List[SSHKeyInput]**](SSHKeyInput.md) | A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. | [optional] +**storage** | [**Storage**](Storage.md) | | [optional] +**tags** | **List[str]** | | [optional] +**termination_time** | **datetime** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**user_ssh_keys** | **List[str]** | A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**userdata** | **str** | 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. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.device_create_input import DeviceCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceCreateInput from a JSON string +device_create_input_instance = DeviceCreateInput.from_json(json) +# print the JSON string representation of the object +print(DeviceCreateInput.to_json()) + +# convert the object into a dict +device_create_input_dict = device_create_input_instance.to_dict() +# create an instance of DeviceCreateInput from a dict +device_create_input_form_dict = device_create_input.from_dict(device_create_input_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/DeviceCreatedBy.md b/equinix/services/metalv1/docs/DeviceCreatedBy.md new file mode 100644 index 00000000..ff54f68d --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceCreatedBy.md @@ -0,0 +1,38 @@ +# DeviceCreatedBy + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avatar_thumb_url** | **str** | Avatar thumbnail URL of the User | [optional] +**created_at** | **datetime** | When the user was created | [optional] +**email** | **str** | Primary email address of the User | [optional] +**first_name** | **str** | First name of the User | [optional] +**full_name** | **str** | Full name of the User | [optional] +**href** | **str** | API URL uniquely representing the User | [optional] +**id** | **str** | ID of the User | +**last_name** | **str** | Last name of the User | [optional] +**short_id** | **str** | Short ID of the User | +**updated_at** | **datetime** | When the user details were last updated | [optional] + +## Example + +```python +from equinix.services.metalv1.models.device_created_by import DeviceCreatedBy + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceCreatedBy from a JSON string +device_created_by_instance = DeviceCreatedBy.from_json(json) +# print the JSON string representation of the object +print(DeviceCreatedBy.to_json()) + +# convert the object into a dict +device_created_by_dict = device_created_by_instance.to_dict() +# create an instance of DeviceCreatedBy from a dict +device_created_by_form_dict = device_created_by.from_dict(device_created_by_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/DeviceHealthRollup.md b/equinix/services/metalv1/docs/DeviceHealthRollup.md new file mode 100644 index 00000000..77cb0717 --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceHealthRollup.md @@ -0,0 +1,32 @@ +# DeviceHealthRollup + +Represents a Device Health Status + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**health_rollup** | **str** | Health Status | [optional] [readonly] +**href** | **str** | | [optional] +**updated_at** | **datetime** | Last update of health status. | [optional] [readonly] + +## Example + +```python +from equinix.services.metalv1.models.device_health_rollup import DeviceHealthRollup + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceHealthRollup from a JSON string +device_health_rollup_instance = DeviceHealthRollup.from_json(json) +# print the JSON string representation of the object +print(DeviceHealthRollup.to_json()) + +# convert the object into a dict +device_health_rollup_dict = device_health_rollup_instance.to_dict() +# create an instance of DeviceHealthRollup from a dict +device_health_rollup_form_dict = device_health_rollup.from_dict(device_health_rollup_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/DeviceList.md b/equinix/services/metalv1/docs/DeviceList.md new file mode 100644 index 00000000..f785338b --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceList.md @@ -0,0 +1,31 @@ +# DeviceList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices** | [**List[Device]**](Device.md) | | [optional] +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.device_list import DeviceList + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceList from a JSON string +device_list_instance = DeviceList.from_json(json) +# print the JSON string representation of the object +print(DeviceList.to_json()) + +# convert the object into a dict +device_list_dict = device_list_instance.to_dict() +# create an instance of DeviceList from a dict +device_list_form_dict = device_list.from_dict(device_list_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/DeviceMetro.md b/equinix/services/metalv1/docs/DeviceMetro.md new file mode 100644 index 00000000..ad6ad325 --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceMetro.md @@ -0,0 +1,33 @@ +# DeviceMetro + + +## 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.device_metro import DeviceMetro + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceMetro from a JSON string +device_metro_instance = DeviceMetro.from_json(json) +# print the JSON string representation of the object +print(DeviceMetro.to_json()) + +# convert the object into a dict +device_metro_dict = device_metro_instance.to_dict() +# create an instance of DeviceMetro from a dict +device_metro_form_dict = device_metro.from_dict(device_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/DeviceProjectLite.md b/equinix/services/metalv1/docs/DeviceProjectLite.md new file mode 100644 index 00000000..6cb91191 --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceProjectLite.md @@ -0,0 +1,29 @@ +# DeviceProjectLite + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | + +## Example + +```python +from equinix.services.metalv1.models.device_project_lite import DeviceProjectLite + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceProjectLite from a JSON string +device_project_lite_instance = DeviceProjectLite.from_json(json) +# print the JSON string representation of the object +print(DeviceProjectLite.to_json()) + +# convert the object into a dict +device_project_lite_dict = device_project_lite_instance.to_dict() +# create an instance of DeviceProjectLite from a dict +device_project_lite_form_dict = device_project_lite.from_dict(device_project_lite_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/DeviceUpdateInput.md b/equinix/services/metalv1/docs/DeviceUpdateInput.md new file mode 100644 index 00000000..f9702cbb --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceUpdateInput.md @@ -0,0 +1,41 @@ +# DeviceUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**always_pxe** | **bool** | | [optional] +**billing_cycle** | **str** | | [optional] +**customdata** | **Dict[str, object]** | | [optional] +**description** | **str** | | [optional] +**firmware_set_id** | **str** | | [optional] +**hostname** | **str** | | [optional] +**href** | **str** | | [optional] +**ipxe_script_url** | **str** | | [optional] +**locked** | **bool** | Whether the device should be locked, preventing accidental deletion. | [optional] +**network_frozen** | **bool** | If true, this instance can not be converted to a different network type. | [optional] +**spot_instance** | **bool** | Can be set to false to convert a spot-market instance to on-demand. | [optional] +**tags** | **List[str]** | | [optional] +**userdata** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.device_update_input import DeviceUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceUpdateInput from a JSON string +device_update_input_instance = DeviceUpdateInput.from_json(json) +# print the JSON string representation of the object +print(DeviceUpdateInput.to_json()) + +# convert the object into a dict +device_update_input_dict = device_update_input_instance.to_dict() +# create an instance of DeviceUpdateInput from a dict +device_update_input_form_dict = device_update_input.from_dict(device_update_input_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/DeviceUsage.md b/equinix/services/metalv1/docs/DeviceUsage.md new file mode 100644 index 00000000..08217839 --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceUsage.md @@ -0,0 +1,32 @@ +# DeviceUsage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**quantity** | **str** | | [optional] +**total** | **str** | | [optional] +**unit** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.device_usage import DeviceUsage + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceUsage from a JSON string +device_usage_instance = DeviceUsage.from_json(json) +# print the JSON string representation of the object +print(DeviceUsage.to_json()) + +# convert the object into a dict +device_usage_dict = device_usage_instance.to_dict() +# create an instance of DeviceUsage from a dict +device_usage_form_dict = device_usage.from_dict(device_usage_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/DeviceUsageList.md b/equinix/services/metalv1/docs/DeviceUsageList.md new file mode 100644 index 00000000..032e54b1 --- /dev/null +++ b/equinix/services/metalv1/docs/DeviceUsageList.md @@ -0,0 +1,30 @@ +# DeviceUsageList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**usages** | [**List[DeviceUsage]**](DeviceUsage.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.device_usage_list import DeviceUsageList + +# TODO update the JSON string below +json = "{}" +# create an instance of DeviceUsageList from a JSON string +device_usage_list_instance = DeviceUsageList.from_json(json) +# print the JSON string representation of the object +print(DeviceUsageList.to_json()) + +# convert the object into a dict +device_usage_list_dict = device_usage_list_instance.to_dict() +# create an instance of DeviceUsageList from a dict +device_usage_list_form_dict = device_usage_list.from_dict(device_usage_list_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/DevicesApi.md b/equinix/services/metalv1/docs/DevicesApi.md new file mode 100644 index 00000000..c2907a63 --- /dev/null +++ b/equinix/services/metalv1/docs/DevicesApi.md @@ -0,0 +1,1750 @@ +# equinix.services.metalv1.DevicesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_bgp_session**](DevicesApi.md#create_bgp_session) | **POST** /devices/{id}/bgp/sessions | Create a BGP session +[**create_device**](DevicesApi.md#create_device) | **POST** /projects/{id}/devices | Create a device +[**create_ip_assignment**](DevicesApi.md#create_ip_assignment) | **POST** /devices/{id}/ips | Create an ip assignment +[**delete_device**](DevicesApi.md#delete_device) | **DELETE** /devices/{id} | Delete the device +[**find_bgp_sessions**](DevicesApi.md#find_bgp_sessions) | **GET** /devices/{id}/bgp/sessions | Retrieve all BGP sessions +[**find_device_by_id**](DevicesApi.md#find_device_by_id) | **GET** /devices/{id} | Retrieve a device +[**find_device_customdata**](DevicesApi.md#find_device_customdata) | **GET** /devices/{id}/customdata | Retrieve the custom metadata of an instance +[**find_device_metadata_by_id**](DevicesApi.md#find_device_metadata_by_id) | **GET** /devices/{id}/metadata | Retrieve metadata +[**find_device_userdata_by_id**](DevicesApi.md#find_device_userdata_by_id) | **GET** /devices/{id}/userdata | Retrieve userdata +[**find_instance_bandwidth**](DevicesApi.md#find_instance_bandwidth) | **GET** /devices/{id}/bandwidth | Retrieve an instance bandwidth +[**find_ip_assignment_customdata**](DevicesApi.md#find_ip_assignment_customdata) | **GET** /devices/{instance_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Assignment +[**find_ip_assignments**](DevicesApi.md#find_ip_assignments) | **GET** /devices/{id}/ips | Retrieve all ip assignments +[**find_organization_devices**](DevicesApi.md#find_organization_devices) | **GET** /organizations/{id}/devices | Retrieve all devices of an organization +[**find_organization_devices_all_pages**](DevicesApi.md#find_organization_devices_all_pages) | **GET** /organizations/{id}/devices | Retrieve all devices of an organization, fetches all the pages +[**find_project_devices**](DevicesApi.md#find_project_devices) | **GET** /projects/{id}/devices | Retrieve all devices of a project +[**find_project_devices_all_pages**](DevicesApi.md#find_project_devices_all_pages) | **GET** /projects/{id}/devices | Retrieve all devices of a project, fetches all the pages +[**find_traffic**](DevicesApi.md#find_traffic) | **GET** /devices/{id}/traffic | Retrieve device traffic +[**get_bgp_neighbor_data**](DevicesApi.md#get_bgp_neighbor_data) | **GET** /devices/{id}/bgp/neighbors | Retrieve BGP neighbor data for this device +[**get_device_firmware_sets**](DevicesApi.md#get_device_firmware_sets) | **GET** /devices/{id}/firmware-sets | Get Device's associated Firmware Set +[**get_device_health_rollup**](DevicesApi.md#get_device_health_rollup) | **GET** /devices/{id}/diagnostics/health/rollup | Get Device's Health Status +[**perform_action**](DevicesApi.md#perform_action) | **POST** /devices/{id}/actions | Perform an action +[**update_device**](DevicesApi.md#update_device) | **PUT** /devices/{id} | Update the device + + +# **create_bgp_session** +> BgpSession create_bgp_session(id, bgp_session_input, include=include) + +Create a BGP session + +Creates a BGP session. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_session_input import BGPSessionInput +from equinix.services.metalv1.models.bgp_session import BgpSession +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + bgp_session_input = equinix.services.metalv1.BGPSessionInput() # BGPSessionInput | BGP session to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create a BGP session + api_response = api_instance.create_bgp_session(id, bgp_session_input, include=include) + print("The response of DevicesApi->create_bgp_session:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->create_bgp_session: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **bgp_session_input** | [**BGPSessionInput**](BGPSessionInput.md)| BGP session to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**BgpSession**](BgpSession.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_device** +> Device create_device(id, create_device_request, include=include, exclude=exclude) + +Create a device + +Creates a new device and provisions it in the specified location. Device type-specific options are accepted. For example, `baremetal` devices accept `operating_system`, `hostname`, and `plan`. These parameters may not be accepted for other device types. The default device type is `baremetal`. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.create_device_request import CreateDeviceRequest +from equinix.services.metalv1.models.device import Device +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Project UUID + create_device_request = equinix.services.metalv1.CreateDeviceRequest() # CreateDeviceRequest | Device to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create a device + api_response = api_instance.create_device(id, create_device_request, include=include, exclude=exclude) + print("The response of DevicesApi->create_device:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->create_device: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **create_device_request** | [**CreateDeviceRequest**](CreateDeviceRequest.md)| Device to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Device**](Device.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_ip_assignment** +> IPAssignment create_ip_assignment(id, ip_assignment_input, include=include, exclude=exclude) + +Create an ip assignment + +Creates an ip assignment for a device. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ip_assignment import IPAssignment +from equinix.services.metalv1.models.ip_assignment_input import IPAssignmentInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + ip_assignment_input = equinix.services.metalv1.IPAssignmentInput() # IPAssignmentInput | IPAssignment to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create an ip assignment + api_response = api_instance.create_ip_assignment(id, ip_assignment_input, include=include, exclude=exclude) + print("The response of DevicesApi->create_ip_assignment:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->create_ip_assignment: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **ip_assignment_input** | [**IPAssignmentInput**](IPAssignmentInput.md)| IPAssignment to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**IPAssignment**](IPAssignment.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_device** +> delete_device(id, force_delete=force_delete) + +Delete the device + +Deletes a device and deprovisions it in our datacenter. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + force_delete = True # bool | Force the deletion of the device, by detaching any storage volume still active. (optional) + + try: + # Delete the device + api_instance.delete_device(id, force_delete=force_delete) + except Exception as e: + print("Exception when calling DevicesApi->delete_device: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **force_delete** | **bool**| Force the deletion of the device, by detaching any storage volume still active. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_bgp_sessions** +> BgpSessionList find_bgp_sessions(id, include=include) + +Retrieve all BGP sessions + +Provides a listing of available BGP sessions for the device. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_session_list import BgpSessionList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve all BGP sessions + api_response = api_instance.find_bgp_sessions(id, include=include) + print("The response of DevicesApi->find_bgp_sessions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->find_bgp_sessions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**BgpSessionList**](BgpSessionList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_device_by_id** +> Device find_device_by_id(id, include=include, exclude=exclude) + +Retrieve a device + +Type-specific options (such as facility for baremetal devices) will be included as part of the main data structure. State value can be one of: active inactive queued or provisioning + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.device import Device +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve a device + api_response = api_instance.find_device_by_id(id, include=include, exclude=exclude) + print("The response of DevicesApi->find_device_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->find_device_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Device**](Device.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_device_customdata** +> find_device_customdata(id) + +Retrieve the custom metadata of an instance + +Provides the custom metadata stored for this instance in json format + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Instance UUID + + try: + # Retrieve the custom metadata of an instance + api_instance.find_device_customdata(id) + except Exception as e: + print("Exception when calling DevicesApi->find_device_customdata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Instance UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_device_metadata_by_id** +> Metadata find_device_metadata_by_id(id) + +Retrieve metadata + +Retrieve device metadata + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.metadata import Metadata +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + + try: + # Retrieve metadata + api_response = api_instance.find_device_metadata_by_id(id) + print("The response of DevicesApi->find_device_metadata_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->find_device_metadata_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + +### Return type + +[**Metadata**](Metadata.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_device_userdata_by_id** +> Userdata find_device_userdata_by_id(id) + +Retrieve userdata + +Retrieve device userdata + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.userdata import Userdata +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + + try: + # Retrieve userdata + api_response = api_instance.find_device_userdata_by_id(id) + print("The response of DevicesApi->find_device_userdata_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->find_device_userdata_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + +### Return type + +[**Userdata**](Userdata.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_instance_bandwidth** +> find_instance_bandwidth(id, var_from, until) + +Retrieve an instance bandwidth + +Retrieve an instance bandwidth for a given period of time. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + var_from = 'var_from_example' # str | Timestamp from range + until = 'until_example' # str | Timestamp to range + + try: + # Retrieve an instance bandwidth + api_instance.find_instance_bandwidth(id, var_from, until) + except Exception as e: + print("Exception when calling DevicesApi->find_instance_bandwidth: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **var_from** | **str**| Timestamp from range | + **until** | **str**| Timestamp to range | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_ip_assignment_customdata** +> find_ip_assignment_customdata(instance_id, id) + +Retrieve the custom metadata of an IP Assignment + +Provides the custom metadata stored for this IP Assignment in json format + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + instance_id = 'instance_id_example' # str | Instance UUID + id = 'id_example' # str | Ip Assignment UUID + + try: + # Retrieve the custom metadata of an IP Assignment + api_instance.find_ip_assignment_customdata(instance_id, id) + except Exception as e: + print("Exception when calling DevicesApi->find_ip_assignment_customdata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instance_id** | **str**| Instance UUID | + **id** | **str**| Ip Assignment UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_ip_assignments** +> IPAssignmentList find_ip_assignments(id, include=include, exclude=exclude) + +Retrieve all ip assignments + +Returns all ip assignments for a device. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ip_assignment_list import IPAssignmentList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve all ip assignments + api_response = api_instance.find_ip_assignments(id, include=include, exclude=exclude) + print("The response of DevicesApi->find_ip_assignments:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->find_ip_assignments: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**IPAssignmentList**](IPAssignmentList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_devices** +> DeviceList find_organization_devices(id, search=search, categories=categories, facility=facility, hostname=hostname, reserved=reserved, tag=tag, type=type, has_termination_time=has_termination_time, mac_address=mac_address, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve all devices of an organization + +Provides a collection of devices for a given organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.device_list import DeviceList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Organization UUID + search = 'search_example' # str | Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. (optional) + categories = ['categories_example'] # List[str] | Filter by plan category (optional) + facility = 'facility_example' # str | Filter by device facility (optional) + hostname = 'hostname_example' # str | Filter by partial hostname (optional) + reserved = True # bool | Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. (optional) + tag = 'tag_example' # str | Filter by device tag (optional) + type = 'type_example' # str | Filter by instance type (ondemand,spot,reserved) (optional) + has_termination_time = True # bool | Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. (optional) + mac_address = 'mac_address_example' # str | Filter by MAC address (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve all devices of an organization + api_response = api_instance.find_organization_devices(id, search=search, categories=categories, facility=facility, hostname=hostname, reserved=reserved, tag=tag, type=type, has_termination_time=has_termination_time, mac_address=mac_address, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of DevicesApi->find_organization_devices:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->find_organization_devices: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **search** | **str**| Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. | [optional] + **categories** | [**List[str]**](str.md)| Filter by plan category | [optional] + **facility** | **str**| Filter by device facility | [optional] + **hostname** | **str**| Filter by partial hostname | [optional] + **reserved** | **bool**| Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. | [optional] + **tag** | **str**| Filter by device tag | [optional] + **type** | **str**| Filter by instance type (ondemand,spot,reserved) | [optional] + **has_termination_time** | **bool**| Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. | [optional] + **mac_address** | **str**| Filter by MAC address | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**DeviceList**](DeviceList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_devices_all_pages** +> DeviceList find_organization_devices_all_pages(id, search=search, categories=categories, facility=facility, hostname=hostname, reserved=reserved, tag=tag, type=type, has_termination_time=has_termination_time, mac_address=mac_address, include=include, exclude=exclude, per_page=per_page) +Just like [**find_organization_devices**](DevicesApi.md#find_organization_devices) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_organization_devices**](DevicesApi.md#find_organization_devices). +# **find_project_devices** +> DeviceList find_project_devices(id, search=search, categories=categories, facility=facility, metro=metro, hostname=hostname, reserved=reserved, tag=tag, type=type, has_termination_time=has_termination_time, mac_address=mac_address, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve all devices of a project + +Provides a collection of devices for a given project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.device_list import DeviceList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Project UUID + search = 'search_example' # str | Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. (optional) + categories = ['categories_example'] # List[str] | Filter by plan category (optional) + facility = 'facility_example' # str | Filter by device facility (optional) + metro = 'metro_example' # str | Filter by device metro (optional) + hostname = 'hostname_example' # str | Filter by partial hostname (optional) + reserved = True # bool | Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. (optional) + tag = 'tag_example' # str | Filter by device tag (optional) + type = 'type_example' # str | Filter by instance type (ondemand,spot,reserved) (optional) + has_termination_time = True # bool | Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. (optional) + mac_address = 'mac_address_example' # str | Filter by MAC address (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve all devices of a project + api_response = api_instance.find_project_devices(id, search=search, categories=categories, facility=facility, metro=metro, hostname=hostname, reserved=reserved, tag=tag, type=type, has_termination_time=has_termination_time, mac_address=mac_address, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of DevicesApi->find_project_devices:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->find_project_devices: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **search** | **str**| Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. | [optional] + **categories** | [**List[str]**](str.md)| Filter by plan category | [optional] + **facility** | **str**| Filter by device facility | [optional] + **metro** | **str**| Filter by device metro | [optional] + **hostname** | **str**| Filter by partial hostname | [optional] + **reserved** | **bool**| Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. | [optional] + **tag** | **str**| Filter by device tag | [optional] + **type** | **str**| Filter by instance type (ondemand,spot,reserved) | [optional] + **has_termination_time** | **bool**| Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. | [optional] + **mac_address** | **str**| Filter by MAC address | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**DeviceList**](DeviceList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_devices_all_pages** +> DeviceList find_project_devices_all_pages(id, search=search, categories=categories, facility=facility, metro=metro, hostname=hostname, reserved=reserved, tag=tag, type=type, has_termination_time=has_termination_time, mac_address=mac_address, include=include, exclude=exclude, per_page=per_page) +Just like [**find_project_devices**](DevicesApi.md#find_project_devices) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_project_devices**](DevicesApi.md#find_project_devices). +# **find_traffic** +> find_traffic(id, direction, interval=interval, bucket=bucket, timeframe=timeframe) + +Retrieve device traffic + +Returns the total amount of inbound or outbound traffic for a specific device. The default time period is 1 hour. Please note the results capture all network traffic for the server, but not all traffic may come from or be destined to the Internet and may be non-billable. Only Internet bound traffic is charged. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.find_traffic_timeframe_parameter import FindTrafficTimeframeParameter +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + direction = 'direction_example' # str | Traffic direction + interval = 'interval_example' # str | Traffic interval (optional) + bucket = 'bucket_example' # str | Traffic bucket (optional) + timeframe = equinix.services.metalv1.FindTrafficTimeframeParameter() # FindTrafficTimeframeParameter | (optional) + + try: + # Retrieve device traffic + api_instance.find_traffic(id, direction, interval=interval, bucket=bucket, timeframe=timeframe) + except Exception as e: + print("Exception when calling DevicesApi->find_traffic: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **direction** | **str**| Traffic direction | + **interval** | **str**| Traffic interval | [optional] + **bucket** | **str**| Traffic bucket | [optional] + **timeframe** | [**FindTrafficTimeframeParameter**](.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_bgp_neighbor_data** +> BgpSessionNeighbors get_bgp_neighbor_data(id, include=include) + +Retrieve BGP neighbor data for this device + +Provides a summary of the BGP neighbor data associated to the BGP sessions for this device. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_session_neighbors import BgpSessionNeighbors +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve BGP neighbor data for this device + api_response = api_instance.get_bgp_neighbor_data(id, include=include) + print("The response of DevicesApi->get_bgp_neighbor_data:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->get_bgp_neighbor_data: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**BgpSessionNeighbors**](BgpSessionNeighbors.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_device_firmware_sets** +> FirmwareSetResponse get_device_firmware_sets(id) + +Get Device's associated Firmware Set + +Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.firmware_set_response import FirmwareSetResponse +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + + try: + # Get Device's associated Firmware Set + api_response = api_instance.get_device_firmware_sets(id) + print("The response of DevicesApi->get_device_firmware_sets:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->get_device_firmware_sets: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + +### Return type + +[**FirmwareSetResponse**](FirmwareSetResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**401** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +**404** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_device_health_rollup** +> DeviceHealthRollup get_device_health_rollup(id) + +Get Device's Health Status + +Returns the health rollup status of the device. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.device_health_rollup import DeviceHealthRollup +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + + try: + # Get Device's Health Status + api_response = api_instance.get_device_health_rollup(id) + print("The response of DevicesApi->get_device_health_rollup:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->get_device_health_rollup: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + +### Return type + +[**DeviceHealthRollup**](DeviceHealthRollup.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**401** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +**404** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **perform_action** +> perform_action(id, device_action_input) + +Perform an action + +Performs an action for the given device. Possible actions include: power_on, power_off, reboot, reinstall, and rescue (reboot the device into rescue OS.) + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.device_action_input import DeviceActionInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + device_action_input = equinix.services.metalv1.DeviceActionInput() # DeviceActionInput | Action to perform + + try: + # Perform an action + api_instance.perform_action(id, device_action_input) + except Exception as e: + print("Exception when calling DevicesApi->perform_action: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **device_action_input** | [**DeviceActionInput**](DeviceActionInput.md)| Action to perform | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | accepted | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_device** +> Device update_device(id, device_update_input, include=include, exclude=exclude) + +Update the device + +Updates the device. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.device import Device +from equinix.services.metalv1.models.device_update_input import DeviceUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.DevicesApi(api_client) + id = 'id_example' # str | Device UUID + device_update_input = equinix.services.metalv1.DeviceUpdateInput() # DeviceUpdateInput | Device to update + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Update the device + api_response = api_instance.update_device(id, device_update_input, include=include, exclude=exclude) + print("The response of DevicesApi->update_device:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->update_device: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **device_update_input** | [**DeviceUpdateInput**](DeviceUpdateInput.md)| Device to update | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Device**](Device.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Disk.md b/equinix/services/metalv1/docs/Disk.md new file mode 100644 index 00000000..3b8b219e --- /dev/null +++ b/equinix/services/metalv1/docs/Disk.md @@ -0,0 +1,32 @@ +# Disk + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device** | **str** | | [optional] +**href** | **str** | | [optional] +**partitions** | [**List[Partition]**](Partition.md) | | [optional] +**wipe_table** | **bool** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.disk import Disk + +# TODO update the JSON string below +json = "{}" +# create an instance of Disk from a JSON string +disk_instance = Disk.from_json(json) +# print the JSON string representation of the object +print(Disk.to_json()) + +# convert the object into a dict +disk_dict = disk_instance.to_dict() +# create an instance of Disk from a dict +disk_form_dict = disk.from_dict(disk_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/Email.md b/equinix/services/metalv1/docs/Email.md new file mode 100644 index 00000000..040e8231 --- /dev/null +++ b/equinix/services/metalv1/docs/Email.md @@ -0,0 +1,33 @@ +# Email + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | [optional] +**default** | **bool** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**verified** | **bool** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.email import Email + +# TODO update the JSON string below +json = "{}" +# create an instance of Email from a JSON string +email_instance = Email.from_json(json) +# print the JSON string representation of the object +print(Email.to_json()) + +# convert the object into a dict +email_dict = email_instance.to_dict() +# create an instance of Email from a dict +email_form_dict = email.from_dict(email_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/EmailInput.md b/equinix/services/metalv1/docs/EmailInput.md new file mode 100644 index 00000000..51d22c63 --- /dev/null +++ b/equinix/services/metalv1/docs/EmailInput.md @@ -0,0 +1,31 @@ +# EmailInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | +**default** | **bool** | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.email_input import EmailInput + +# TODO update the JSON string below +json = "{}" +# create an instance of EmailInput from a JSON string +email_input_instance = EmailInput.from_json(json) +# print the JSON string representation of the object +print(EmailInput.to_json()) + +# convert the object into a dict +email_input_dict = email_input_instance.to_dict() +# create an instance of EmailInput from a dict +email_input_form_dict = email_input.from_dict(email_input_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/EmailsApi.md b/equinix/services/metalv1/docs/EmailsApi.md new file mode 100644 index 00000000..7ee181d4 --- /dev/null +++ b/equinix/services/metalv1/docs/EmailsApi.md @@ -0,0 +1,337 @@ +# equinix.services.metalv1.EmailsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_email**](EmailsApi.md#create_email) | **POST** /emails | Create an email +[**delete_email**](EmailsApi.md#delete_email) | **DELETE** /emails/{id} | Delete the email +[**find_email_by_id**](EmailsApi.md#find_email_by_id) | **GET** /emails/{id} | Retrieve an email +[**update_email**](EmailsApi.md#update_email) | **PUT** /emails/{id} | Update the email + + +# **create_email** +> Email create_email(create_email_input) + +Create an email + +Add a new email address to the current user. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.create_email_input import CreateEmailInput +from equinix.services.metalv1.models.email import Email +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EmailsApi(api_client) + create_email_input = equinix.services.metalv1.CreateEmailInput() # CreateEmailInput | Email to create + + try: + # Create an email + api_response = api_instance.create_email(create_email_input) + print("The response of EmailsApi->create_email:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EmailsApi->create_email: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_email_input** | [**CreateEmailInput**](CreateEmailInput.md)| Email to create | + +### Return type + +[**Email**](Email.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_email** +> delete_email(id) + +Delete the email + +Deletes the email. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EmailsApi(api_client) + id = 'id_example' # str | Email UUID + + try: + # Delete the email + api_instance.delete_email(id) + except Exception as e: + print("Exception when calling EmailsApi->delete_email: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Email UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_email_by_id** +> Email find_email_by_id(id) + +Retrieve an email + +Provides one of the user’s emails. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.email import Email +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EmailsApi(api_client) + id = 'id_example' # str | Email UUID + + try: + # Retrieve an email + api_response = api_instance.find_email_by_id(id) + print("The response of EmailsApi->find_email_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EmailsApi->find_email_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Email UUID | + +### Return type + +[**Email**](Email.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_email** +> Email update_email(id, update_email_input) + +Update the email + +Updates the email. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.email import Email +from equinix.services.metalv1.models.update_email_input import UpdateEmailInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EmailsApi(api_client) + id = 'id_example' # str | Email UUID + update_email_input = equinix.services.metalv1.UpdateEmailInput() # UpdateEmailInput | email to update + + try: + # Update the email + api_response = api_instance.update_email(id, update_email_input) + print("The response of EmailsApi->update_email:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EmailsApi->update_email: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Email UUID | + **update_email_input** | [**UpdateEmailInput**](UpdateEmailInput.md)| email to update | + +### Return type + +[**Email**](Email.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Entitlement.md b/equinix/services/metalv1/docs/Entitlement.md new file mode 100644 index 00000000..d7c31835 --- /dev/null +++ b/equinix/services/metalv1/docs/Entitlement.md @@ -0,0 +1,40 @@ +# Entitlement + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**feature_access** | **object** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | +**instance_quota** | **object** | | [optional] +**ip_quota** | **object** | | [optional] +**name** | **str** | | [optional] +**project_quota** | **int** | | [optional] [default to 0] +**slug** | **str** | | +**volume_limits** | **object** | | [optional] +**volume_quota** | **object** | | [optional] +**weight** | **int** | | + +## Example + +```python +from equinix.services.metalv1.models.entitlement import Entitlement + +# TODO update the JSON string below +json = "{}" +# create an instance of Entitlement from a JSON string +entitlement_instance = Entitlement.from_json(json) +# print the JSON string representation of the object +print(Entitlement.to_json()) + +# convert the object into a dict +entitlement_dict = entitlement_instance.to_dict() +# create an instance of Entitlement from a dict +entitlement_form_dict = entitlement.from_dict(entitlement_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/Error.md b/equinix/services/metalv1/docs/Error.md new file mode 100644 index 00000000..ff000dae --- /dev/null +++ b/equinix/services/metalv1/docs/Error.md @@ -0,0 +1,32 @@ +# Error + +Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | A description of the error that caused the request to fail. | [optional] +**errors** | **List[str]** | A list of errors that contributed to the request failing. | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print(Error.to_json()) + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_form_dict = error.from_dict(error_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/Event.md b/equinix/services/metalv1/docs/Event.md new file mode 100644 index 00000000..e6fa5c6e --- /dev/null +++ b/equinix/services/metalv1/docs/Event.md @@ -0,0 +1,38 @@ +# Event + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **str** | | [optional] +**created_at** | **datetime** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**interpolated** | **str** | | [optional] +**ip** | **str** | | [optional] +**modified_by** | **object** | | [optional] +**relationships** | [**List[Href]**](Href.md) | | [optional] +**state** | **str** | | [optional] +**type** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.event import Event + +# TODO update the JSON string below +json = "{}" +# create an instance of Event from a JSON string +event_instance = Event.from_json(json) +# print the JSON string representation of the object +print(Event.to_json()) + +# convert the object into a dict +event_dict = event_instance.to_dict() +# create an instance of Event from a dict +event_form_dict = event.from_dict(event_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/EventList.md b/equinix/services/metalv1/docs/EventList.md new file mode 100644 index 00000000..b8fea8ba --- /dev/null +++ b/equinix/services/metalv1/docs/EventList.md @@ -0,0 +1,31 @@ +# EventList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**events** | [**List[Event]**](Event.md) | | [optional] +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.event_list import EventList + +# TODO update the JSON string below +json = "{}" +# create an instance of EventList from a JSON string +event_list_instance = EventList.from_json(json) +# print the JSON string representation of the object +print(EventList.to_json()) + +# convert the object into a dict +event_list_dict = event_list_instance.to_dict() +# create an instance of EventList from a dict +event_list_form_dict = event_list.from_dict(event_list_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/EventsApi.md b/equinix/services/metalv1/docs/EventsApi.md new file mode 100644 index 00000000..2f81dcec --- /dev/null +++ b/equinix/services/metalv1/docs/EventsApi.md @@ -0,0 +1,832 @@ +# equinix.services.metalv1.EventsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_device_events**](EventsApi.md#find_device_events) | **GET** /devices/{id}/events | Retrieve device's events +[**find_device_events_all_pages**](EventsApi.md#find_device_events_all_pages) | **GET** /devices/{id}/events | Retrieve device's events, fetches all the pages +[**find_event_by_id**](EventsApi.md#find_event_by_id) | **GET** /events/{id} | Retrieve an event +[**find_events**](EventsApi.md#find_events) | **GET** /events | Retrieve current user's events +[**find_events_all_pages**](EventsApi.md#find_events_all_pages) | **GET** /events | Retrieve current user's events, fetches all the pages +[**find_interconnection_events**](EventsApi.md#find_interconnection_events) | **GET** /connections/{connection_id}/events | Retrieve interconnection events +[**find_interconnection_events_all_pages**](EventsApi.md#find_interconnection_events_all_pages) | **GET** /connections/{connection_id}/events | Retrieve interconnection events, fetches all the pages +[**find_interconnection_port_events**](EventsApi.md#find_interconnection_port_events) | **GET** /connections/{connection_id}/ports/{id}/events | Retrieve interconnection port events +[**find_organization_events**](EventsApi.md#find_organization_events) | **GET** /organizations/{id}/events | Retrieve organization's events +[**find_organization_events_all_pages**](EventsApi.md#find_organization_events_all_pages) | **GET** /organizations/{id}/events | Retrieve organization's events, fetches all the pages +[**find_project_events**](EventsApi.md#find_project_events) | **GET** /projects/{id}/events | Retrieve project's events +[**find_project_events_all_pages**](EventsApi.md#find_project_events_all_pages) | **GET** /projects/{id}/events | Retrieve project's events, fetches all the pages +[**find_virtual_circuit_events**](EventsApi.md#find_virtual_circuit_events) | **GET** /virtual-circuits/{id}/events | Retrieve virtual circuit events +[**find_vrf_route_events**](EventsApi.md#find_vrf_route_events) | **GET** /routes/{id}/events | Retrieve VRF route events + + +# **find_device_events** +> EventList find_device_events(id, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve device's events + +Returns a list of events pertaining to a specific device + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.event_list import EventList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EventsApi(api_client) + id = 'id_example' # str | Device UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve device's events + api_response = api_instance.find_device_events(id, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of EventsApi->find_device_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->find_device_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**EventList**](EventList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_device_events_all_pages** +> EventList find_device_events_all_pages(id, include=include, exclude=exclude, per_page=per_page) +Just like [**find_device_events**](EventsApi.md#find_device_events) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_device_events**](EventsApi.md#find_device_events). +# **find_event_by_id** +> Event find_event_by_id(id, include=include, exclude=exclude) + +Retrieve an event + +Returns a single event if the user has access + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.event import Event +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EventsApi(api_client) + id = 'id_example' # str | Event UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve an event + api_response = api_instance.find_event_by_id(id, include=include, exclude=exclude) + print("The response of EventsApi->find_event_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->find_event_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Event UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Event**](Event.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_events** +> EventList find_events(include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve current user's events + +Returns a list of the current user’s events + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.event_list import EventList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EventsApi(api_client) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve current user's events + api_response = api_instance.find_events(include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of EventsApi->find_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->find_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**EventList**](EventList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_events_all_pages** +> EventList find_events_all_pages(include=include, exclude=exclude, per_page=per_page) +Just like [**find_events**](EventsApi.md#find_events) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_events**](EventsApi.md#find_events). +# **find_interconnection_events** +> EventList find_interconnection_events(connection_id, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve interconnection events + +Returns a list of the interconnection events + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.event_list import EventList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EventsApi(api_client) + connection_id = 'connection_id_example' # str | Interconnection UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve interconnection events + api_response = api_instance.find_interconnection_events(connection_id, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of EventsApi->find_interconnection_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->find_interconnection_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection_id** | **str**| Interconnection UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**EventList**](EventList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_interconnection_events_all_pages** +> EventList find_interconnection_events_all_pages(connection_id, include=include, exclude=exclude, per_page=per_page) +Just like [**find_interconnection_events**](EventsApi.md#find_interconnection_events) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_interconnection_events**](EventsApi.md#find_interconnection_events). +# **find_interconnection_port_events** +> Event find_interconnection_port_events(connection_id, id, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve interconnection port events + +Returns a list of the interconnection port events + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.event import Event +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EventsApi(api_client) + connection_id = 'connection_id_example' # str | Interconnection UUID + id = 'id_example' # str | Interconnection Port UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve interconnection port events + api_response = api_instance.find_interconnection_port_events(connection_id, id, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of EventsApi->find_interconnection_port_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->find_interconnection_port_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection_id** | **str**| Interconnection UUID | + **id** | **str**| Interconnection Port UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**Event**](Event.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_events** +> EventList find_organization_events(id, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve organization's events + +Returns a list of events for a single organization + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.event_list import EventList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EventsApi(api_client) + id = 'id_example' # str | Organization UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve organization's events + api_response = api_instance.find_organization_events(id, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of EventsApi->find_organization_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->find_organization_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**EventList**](EventList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_events_all_pages** +> EventList find_organization_events_all_pages(id, include=include, exclude=exclude, per_page=per_page) +Just like [**find_organization_events**](EventsApi.md#find_organization_events) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_organization_events**](EventsApi.md#find_organization_events). +# **find_project_events** +> EventList find_project_events(id, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve project's events + +Returns a list of events for a single project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.event_list import EventList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EventsApi(api_client) + id = 'id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve project's events + api_response = api_instance.find_project_events(id, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of EventsApi->find_project_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->find_project_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**EventList**](EventList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_events_all_pages** +> EventList find_project_events_all_pages(id, include=include, exclude=exclude, per_page=per_page) +Just like [**find_project_events**](EventsApi.md#find_project_events) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_project_events**](EventsApi.md#find_project_events). +# **find_virtual_circuit_events** +> Event find_virtual_circuit_events(id, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve virtual circuit events + +Returns a list of the virtual circuit events + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.event import Event +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EventsApi(api_client) + id = 'id_example' # str | Virtual Circuit UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve virtual circuit events + api_response = api_instance.find_virtual_circuit_events(id, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of EventsApi->find_virtual_circuit_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->find_virtual_circuit_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Virtual Circuit UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**Event**](Event.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_vrf_route_events** +> Event find_vrf_route_events(id, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve VRF route events + +Returns a list of the VRF route events + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.event import Event +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.EventsApi(api_client) + id = 'id_example' # str | VRF Route UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve VRF route events + api_response = api_instance.find_vrf_route_events(id, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of EventsApi->find_vrf_route_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->find_vrf_route_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF Route UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**Event**](Event.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/FabricServiceToken.md b/equinix/services/metalv1/docs/FabricServiceToken.md new file mode 100644 index 00000000..d19caea9 --- /dev/null +++ b/equinix/services/metalv1/docs/FabricServiceToken.md @@ -0,0 +1,35 @@ +# FabricServiceToken + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expires_at** | **datetime** | The expiration date and time of the Fabric service token. Once a service token is expired, it is no longer redeemable. | [optional] +**href** | **str** | | [optional] +**id** | **str** | The UUID that can be used on the Fabric Portal to redeem either an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this UUID will represent an A-Side Service Token, which will allow interconnections to be made from Equinix Metal to other Service Providers on Fabric. For Fabric VCs (Fabric Billed), this UUID will represent a Z-Side Service Token, which will allow interconnections to be made to connect an owned Fabric Port or Virtual Device to Equinix Metal. | [optional] +**max_allowed_speed** | **int** | The maximum speed that can be selected on the Fabric Portal when configuring a interconnection with either an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this is what the billing is based off of, and can be one of the following options, '50mbps', '200mbps', '500mbps', '1gbps', '2gbps', '5gbps' or '10gbps'. For Fabric VCs (Fabric Billed), this will default to 10Gbps. | [optional] +**role** | **str** | Either primary or secondary, depending on which interconnection the service token is associated to. | [optional] +**service_token_type** | **str** | Either 'a_side' or 'z_side', depending on which type of Fabric VC was requested. | [optional] +**state** | **str** | The state of the service token that corresponds with the service token state on Fabric. An 'inactive' state refers to a token that has not been redeemed yet on the Fabric side, an 'active' state refers to a token that has already been redeemed, and an 'expired' state refers to a token that has reached its expiry time. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.fabric_service_token import FabricServiceToken + +# TODO update the JSON string below +json = "{}" +# create an instance of FabricServiceToken from a JSON string +fabric_service_token_instance = FabricServiceToken.from_json(json) +# print the JSON string representation of the object +print(FabricServiceToken.to_json()) + +# convert the object into a dict +fabric_service_token_dict = fabric_service_token_instance.to_dict() +# create an instance of FabricServiceToken from a dict +fabric_service_token_form_dict = fabric_service_token.from_dict(fabric_service_token_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/FacilitiesApi.md b/equinix/services/metalv1/docs/FacilitiesApi.md new file mode 100644 index 00000000..fc0171f6 --- /dev/null +++ b/equinix/services/metalv1/docs/FacilitiesApi.md @@ -0,0 +1,262 @@ +# equinix.services.metalv1.FacilitiesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_facilities**](FacilitiesApi.md#find_facilities) | **GET** /facilities | Retrieve all facilities +[**find_facilities_by_organization**](FacilitiesApi.md#find_facilities_by_organization) | **GET** /organizations/{id}/facilities | Retrieve all facilities visible by the organization +[**find_facilities_by_project**](FacilitiesApi.md#find_facilities_by_project) | **GET** /projects/{id}/facilities | Retrieve all facilities visible by the project + + +# **find_facilities** +> FacilityList find_facilities(include=include, exclude=exclude) + +Retrieve all facilities + +Provides a listing of available datacenters where you can provision Packet devices. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.facility_list import FacilityList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.FacilitiesApi(api_client) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ["address"] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) (default to ["address"]) + + try: + # Retrieve all facilities + api_response = api_instance.find_facilities(include=include, exclude=exclude) + print("The response of FacilitiesApi->find_facilities:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FacilitiesApi->find_facilities: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] [default to ["address"]] + +### Return type + +[**FacilityList**](FacilityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_facilities_by_organization** +> FacilityList find_facilities_by_organization(id, include=include, exclude=exclude) + +Retrieve all facilities visible by the organization + +Returns a listing of available datacenters for the given organization + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.facility_list import FacilityList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.FacilitiesApi(api_client) + id = 'id_example' # str | Organization UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve all facilities visible by the organization + api_response = api_instance.find_facilities_by_organization(id, include=include, exclude=exclude) + print("The response of FacilitiesApi->find_facilities_by_organization:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FacilitiesApi->find_facilities_by_organization: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**FacilityList**](FacilityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_facilities_by_project** +> FacilityList find_facilities_by_project(id, include=include, exclude=exclude) + +Retrieve all facilities visible by the project + +Returns a listing of available datacenters for the given project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.facility_list import FacilityList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.FacilitiesApi(api_client) + id = 'id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve all facilities visible by the project + api_response = api_instance.find_facilities_by_project(id, include=include, exclude=exclude) + print("The response of FacilitiesApi->find_facilities_by_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FacilitiesApi->find_facilities_by_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**FacilityList**](FacilityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Facility.md b/equinix/services/metalv1/docs/Facility.md new file mode 100644 index 00000000..9c5a7c4f --- /dev/null +++ b/equinix/services/metalv1/docs/Facility.md @@ -0,0 +1,36 @@ +# Facility + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**Address**](Address.md) | | [optional] +**code** | **str** | | [optional] +**features** | **List[str]** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**ip_ranges** | **List[str]** | IP ranges registered in facility. Can be used for GeoIP location | [optional] +**metro** | [**DeviceMetro**](DeviceMetro.md) | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.facility import Facility + +# TODO update the JSON string below +json = "{}" +# create an instance of Facility from a JSON string +facility_instance = Facility.from_json(json) +# print the JSON string representation of the object +print(Facility.to_json()) + +# convert the object into a dict +facility_dict = facility_instance.to_dict() +# create an instance of Facility from a dict +facility_form_dict = facility.from_dict(facility_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/FacilityInput.md b/equinix/services/metalv1/docs/FacilityInput.md new file mode 100644 index 00000000..828cf480 --- /dev/null +++ b/equinix/services/metalv1/docs/FacilityInput.md @@ -0,0 +1,30 @@ +# FacilityInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**facility** | [**FacilityInputFacility**](FacilityInputFacility.md) | | +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.facility_input import FacilityInput + +# TODO update the JSON string below +json = "{}" +# create an instance of FacilityInput from a JSON string +facility_input_instance = FacilityInput.from_json(json) +# print the JSON string representation of the object +print(FacilityInput.to_json()) + +# convert the object into a dict +facility_input_dict = facility_input_instance.to_dict() +# create an instance of FacilityInput from a dict +facility_input_form_dict = facility_input.from_dict(facility_input_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/FacilityInputFacility.md b/equinix/services/metalv1/docs/FacilityInputFacility.md new file mode 100644 index 00000000..bfba7918 --- /dev/null +++ b/equinix/services/metalv1/docs/FacilityInputFacility.md @@ -0,0 +1,29 @@ +# FacilityInputFacility + +The datacenter where the device should be created. Either metro or facility must be provided. The API will accept either a single facility `{ \"facility\": \"f1\" }`, or it can be instructed to create the device in the best available datacenter `{ \"facility\": \"any\" }`. Additionally it is possible to set a prioritized location selection. For example `{ \"facility\": [\"f3\", \"f2\", \"any\"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from equinix.services.metalv1.models.facility_input_facility import FacilityInputFacility + +# TODO update the JSON string below +json = "{}" +# create an instance of FacilityInputFacility from a JSON string +facility_input_facility_instance = FacilityInputFacility.from_json(json) +# print the JSON string representation of the object +print(FacilityInputFacility.to_json()) + +# convert the object into a dict +facility_input_facility_dict = facility_input_facility_instance.to_dict() +# create an instance of FacilityInputFacility from a dict +facility_input_facility_form_dict = facility_input_facility.from_dict(facility_input_facility_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/FacilityList.md b/equinix/services/metalv1/docs/FacilityList.md new file mode 100644 index 00000000..a49b80d0 --- /dev/null +++ b/equinix/services/metalv1/docs/FacilityList.md @@ -0,0 +1,30 @@ +# FacilityList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**facilities** | [**List[Facility]**](Facility.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.facility_list import FacilityList + +# TODO update the JSON string below +json = "{}" +# create an instance of FacilityList from a JSON string +facility_list_instance = FacilityList.from_json(json) +# print the JSON string representation of the object +print(FacilityList.to_json()) + +# convert the object into a dict +facility_list_dict = facility_list_instance.to_dict() +# create an instance of FacilityList from a dict +facility_list_form_dict = facility_list.from_dict(facility_list_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/Filesystem.md b/equinix/services/metalv1/docs/Filesystem.md new file mode 100644 index 00000000..155f873c --- /dev/null +++ b/equinix/services/metalv1/docs/Filesystem.md @@ -0,0 +1,30 @@ +# Filesystem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**mount** | [**Mount**](Mount.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.filesystem import Filesystem + +# TODO update the JSON string below +json = "{}" +# create an instance of Filesystem from a JSON string +filesystem_instance = Filesystem.from_json(json) +# print the JSON string representation of the object +print(Filesystem.to_json()) + +# convert the object into a dict +filesystem_dict = filesystem_instance.to_dict() +# create an instance of Filesystem from a dict +filesystem_form_dict = filesystem.from_dict(filesystem_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/FindIPAddressById200Response.md b/equinix/services/metalv1/docs/FindIPAddressById200Response.md new file mode 100644 index 00000000..470d616e --- /dev/null +++ b/equinix/services/metalv1/docs/FindIPAddressById200Response.md @@ -0,0 +1,62 @@ +# FindIPAddressById200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | [optional] +**address_family** | **int** | | [optional] +**assigned_to** | [**Href**](Href.md) | | +**cidr** | **int** | | [optional] +**created_at** | **datetime** | | [optional] +**enabled** | **bool** | | [optional] +**gateway** | **str** | | [optional] +**global_ip** | **bool** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**manageable** | **bool** | | [optional] +**management** | **bool** | | [optional] +**metro** | [**Metro**](Metro.md) | | [optional] +**netmask** | **str** | | [optional] +**network** | **str** | | [optional] +**next_hop** | **str** | Only set when this is a Metal Gateway Elastic IP Assignment. The IP address within the Metal Gateway to which requests to the Elastic IP are forwarded. | [optional] +**parent_block** | [**ParentBlock**](ParentBlock.md) | | [optional] +**public** | **bool** | | [optional] +**state** | **str** | | [optional] +**addon** | **bool** | | [optional] +**assignments** | [**List[Href]**](Href.md) | | [optional] +**available** | **str** | | [optional] +**bill** | **bool** | | [optional] +**customdata** | **object** | | [optional] +**details** | **str** | | [optional] +**facility** | [**IPReservationFacility**](IPReservationFacility.md) | | [optional] +**metal_gateway** | [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**project_lite** | [**Project**](Project.md) | | [optional] +**requested_by** | [**Href**](Href.md) | | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | | +**created_by** | [**Href**](Href.md) | | [optional] +**vrf** | [**Vrf**](Vrf.md) | | + +## Example + +```python +from equinix.services.metalv1.models.find_ip_address_by_id200_response import FindIPAddressById200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of FindIPAddressById200Response from a JSON string +find_ip_address_by_id200_response_instance = FindIPAddressById200Response.from_json(json) +# print the JSON string representation of the object +print(FindIPAddressById200Response.to_json()) + +# convert the object into a dict +find_ip_address_by_id200_response_dict = find_ip_address_by_id200_response_instance.to_dict() +# create an instance of FindIPAddressById200Response from a dict +find_ip_address_by_id200_response_form_dict = find_ip_address_by_id200_response.from_dict(find_ip_address_by_id200_response_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/FindMetalGatewayById200Response.md b/equinix/services/metalv1/docs/FindMetalGatewayById200Response.md new file mode 100644 index 00000000..1ff44215 --- /dev/null +++ b/equinix/services/metalv1/docs/FindMetalGatewayById200Response.md @@ -0,0 +1,38 @@ +# FindMetalGatewayById200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**created_by** | [**Href**](Href.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**ip_reservation** | [**VrfIpReservation**](VrfIpReservation.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**state** | **str** | The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. | [optional] +**updated_at** | **datetime** | | [optional] +**virtual_network** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] +**vrf** | [**Vrf**](Vrf.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.find_metal_gateway_by_id200_response import FindMetalGatewayById200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of FindMetalGatewayById200Response from a JSON string +find_metal_gateway_by_id200_response_instance = FindMetalGatewayById200Response.from_json(json) +# print the JSON string representation of the object +print(FindMetalGatewayById200Response.to_json()) + +# convert the object into a dict +find_metal_gateway_by_id200_response_dict = find_metal_gateway_by_id200_response_instance.to_dict() +# create an instance of FindMetalGatewayById200Response from a dict +find_metal_gateway_by_id200_response_form_dict = find_metal_gateway_by_id200_response.from_dict(find_metal_gateway_by_id200_response_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/FindTrafficTimeframeParameter.md b/equinix/services/metalv1/docs/FindTrafficTimeframeParameter.md new file mode 100644 index 00000000..9a1a3ecb --- /dev/null +++ b/equinix/services/metalv1/docs/FindTrafficTimeframeParameter.md @@ -0,0 +1,31 @@ +# FindTrafficTimeframeParameter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ended_at** | **datetime** | | +**href** | **str** | | [optional] +**started_at** | **datetime** | | + +## Example + +```python +from equinix.services.metalv1.models.find_traffic_timeframe_parameter import FindTrafficTimeframeParameter + +# TODO update the JSON string below +json = "{}" +# create an instance of FindTrafficTimeframeParameter from a JSON string +find_traffic_timeframe_parameter_instance = FindTrafficTimeframeParameter.from_json(json) +# print the JSON string representation of the object +print(FindTrafficTimeframeParameter.to_json()) + +# convert the object into a dict +find_traffic_timeframe_parameter_dict = find_traffic_timeframe_parameter_instance.to_dict() +# create an instance of FindTrafficTimeframeParameter from a dict +find_traffic_timeframe_parameter_form_dict = find_traffic_timeframe_parameter.from_dict(find_traffic_timeframe_parameter_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/FirmwareSet.md b/equinix/services/metalv1/docs/FirmwareSet.md new file mode 100644 index 00000000..988556f5 --- /dev/null +++ b/equinix/services/metalv1/docs/FirmwareSet.md @@ -0,0 +1,36 @@ +# FirmwareSet + +Represents a Firmware Set + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**List[Attribute]**](Attribute.md) | Represents a list of attributes | [optional] +**component_firmware** | [**List[Component]**](Component.md) | List of components versions | [optional] +**created_at** | **datetime** | Datetime when the block was created. | [optional] [readonly] +**href** | **str** | | [optional] +**name** | **str** | Firmware Set Name | [readonly] +**updated_at** | **datetime** | Datetime when the block was updated. | [optional] [readonly] +**uuid** | **str** | Firmware Set UUID | [readonly] + +## Example + +```python +from equinix.services.metalv1.models.firmware_set import FirmwareSet + +# TODO update the JSON string below +json = "{}" +# create an instance of FirmwareSet from a JSON string +firmware_set_instance = FirmwareSet.from_json(json) +# print the JSON string representation of the object +print(FirmwareSet.to_json()) + +# convert the object into a dict +firmware_set_dict = firmware_set_instance.to_dict() +# create an instance of FirmwareSet from a dict +firmware_set_form_dict = firmware_set.from_dict(firmware_set_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/FirmwareSetListResponse.md b/equinix/services/metalv1/docs/FirmwareSetListResponse.md new file mode 100644 index 00000000..a080c9eb --- /dev/null +++ b/equinix/services/metalv1/docs/FirmwareSetListResponse.md @@ -0,0 +1,36 @@ +# FirmwareSetListResponse + +Represents collection of Firmware Sets + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**page** | **int** | Page returned | [optional] +**page_count** | **int** | Items returned in current page | [optional] +**page_size** | **int** | Max number of items returned in a page | [optional] +**records** | [**List[FirmwareSet]**](FirmwareSet.md) | Represents a list of FirmwareSets | [optional] +**total_pages** | **int** | Total count of pages | [optional] +**total_record_count** | **int** | Total count of items | [optional] + +## Example + +```python +from equinix.services.metalv1.models.firmware_set_list_response import FirmwareSetListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FirmwareSetListResponse from a JSON string +firmware_set_list_response_instance = FirmwareSetListResponse.from_json(json) +# print the JSON string representation of the object +print(FirmwareSetListResponse.to_json()) + +# convert the object into a dict +firmware_set_list_response_dict = firmware_set_list_response_instance.to_dict() +# create an instance of FirmwareSetListResponse from a dict +firmware_set_list_response_form_dict = firmware_set_list_response.from_dict(firmware_set_list_response_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/FirmwareSetResponse.md b/equinix/services/metalv1/docs/FirmwareSetResponse.md new file mode 100644 index 00000000..27428253 --- /dev/null +++ b/equinix/services/metalv1/docs/FirmwareSetResponse.md @@ -0,0 +1,31 @@ +# FirmwareSetResponse + +Represents single Firmware set response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**record** | [**FirmwareSet**](FirmwareSet.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.firmware_set_response import FirmwareSetResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FirmwareSetResponse from a JSON string +firmware_set_response_instance = FirmwareSetResponse.from_json(json) +# print the JSON string representation of the object +print(FirmwareSetResponse.to_json()) + +# convert the object into a dict +firmware_set_response_dict = firmware_set_response_instance.to_dict() +# create an instance of FirmwareSetResponse from a dict +firmware_set_response_form_dict = firmware_set_response.from_dict(firmware_set_response_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/FirmwareSetsApi.md b/equinix/services/metalv1/docs/FirmwareSetsApi.md new file mode 100644 index 00000000..7662aa2c --- /dev/null +++ b/equinix/services/metalv1/docs/FirmwareSetsApi.md @@ -0,0 +1,180 @@ +# equinix.services.metalv1.FirmwareSetsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_organization_firmware_sets**](FirmwareSetsApi.md#get_organization_firmware_sets) | **GET** /organizations/{id}/firmware-sets | Get Organization's Firmware Sets +[**get_project_firmware_sets**](FirmwareSetsApi.md#get_project_firmware_sets) | **GET** /projects/{id}/firmware-sets | Get Project's Firmware Sets + + +# **get_organization_firmware_sets** +> FirmwareSetListResponse get_organization_firmware_sets(id, page=page, per_page=per_page) + +Get Organization's Firmware Sets + +Returns all firmware sets associated with the organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.firmware_set_list_response import FirmwareSetListResponse +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.FirmwareSetsApi(api_client) + id = 'id_example' # str | Organization UUID + page = 56 # int | page number to return (optional) + per_page = 56 # int | items returned per page. (optional) + + try: + # Get Organization's Firmware Sets + api_response = api_instance.get_organization_firmware_sets(id, page=page, per_page=per_page) + print("The response of FirmwareSetsApi->get_organization_firmware_sets:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FirmwareSetsApi->get_organization_firmware_sets: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **page** | **int**| page number to return | [optional] + **per_page** | **int**| items returned per page. | [optional] + +### Return type + +[**FirmwareSetListResponse**](FirmwareSetListResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**401** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +**404** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_project_firmware_sets** +> FirmwareSetListResponse get_project_firmware_sets(id, page=page, per_page=per_page) + +Get Project's Firmware Sets + +Returns all firmware sets associated with the project or organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.firmware_set_list_response import FirmwareSetListResponse +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.FirmwareSetsApi(api_client) + id = 'id_example' # str | Project UUID + page = 56 # int | page number to return (optional) + per_page = 56 # int | items returned per page. (optional) + + try: + # Get Project's Firmware Sets + api_response = api_instance.get_project_firmware_sets(id, page=page, per_page=per_page) + print("The response of FirmwareSetsApi->get_project_firmware_sets:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FirmwareSetsApi->get_project_firmware_sets: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **page** | **int**| page number to return | [optional] + **per_page** | **int**| items returned per page. | [optional] + +### Return type + +[**FirmwareSetListResponse**](FirmwareSetListResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**401** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +**404** | Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. | - | +**500** | Internal Server Error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/GlobalBgpRange.md b/equinix/services/metalv1/docs/GlobalBgpRange.md new file mode 100644 index 00000000..a6625c96 --- /dev/null +++ b/equinix/services/metalv1/docs/GlobalBgpRange.md @@ -0,0 +1,33 @@ +# GlobalBgpRange + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_family** | **int** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**project** | [**Href**](Href.md) | | [optional] +**range** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.global_bgp_range import GlobalBgpRange + +# TODO update the JSON string below +json = "{}" +# create an instance of GlobalBgpRange from a JSON string +global_bgp_range_instance = GlobalBgpRange.from_json(json) +# print the JSON string representation of the object +print(GlobalBgpRange.to_json()) + +# convert the object into a dict +global_bgp_range_dict = global_bgp_range_instance.to_dict() +# create an instance of GlobalBgpRange from a dict +global_bgp_range_form_dict = global_bgp_range.from_dict(global_bgp_range_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/GlobalBgpRangeList.md b/equinix/services/metalv1/docs/GlobalBgpRangeList.md new file mode 100644 index 00000000..8b0af4c1 --- /dev/null +++ b/equinix/services/metalv1/docs/GlobalBgpRangeList.md @@ -0,0 +1,30 @@ +# GlobalBgpRangeList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**global_bgp_ranges** | [**List[GlobalBgpRange]**](GlobalBgpRange.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.global_bgp_range_list import GlobalBgpRangeList + +# TODO update the JSON string below +json = "{}" +# create an instance of GlobalBgpRangeList from a JSON string +global_bgp_range_list_instance = GlobalBgpRangeList.from_json(json) +# print the JSON string representation of the object +print(GlobalBgpRangeList.to_json()) + +# convert the object into a dict +global_bgp_range_list_dict = global_bgp_range_list_instance.to_dict() +# create an instance of GlobalBgpRangeList from a dict +global_bgp_range_list_form_dict = global_bgp_range_list.from_dict(global_bgp_range_list_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/HardwareReservation.md b/equinix/services/metalv1/docs/HardwareReservation.md new file mode 100644 index 00000000..824d1dbe --- /dev/null +++ b/equinix/services/metalv1/docs/HardwareReservation.md @@ -0,0 +1,42 @@ +# HardwareReservation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**custom_rate** | **float** | Amount that will be charged for every billing_cycle. | [optional] +**device** | [**Device**](Device.md) | | [optional] +**facility** | [**Facility**](Facility.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**need_of_service** | **bool** | Whether this Device requires assistance from Equinix Metal. | [optional] +**plan** | [**Plan**](Plan.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**provisionable** | **bool** | Whether the reserved server is provisionable or not. Spare devices can't be provisioned unless they are activated first. | [optional] +**short_id** | **str** | Short version of the ID. | [optional] +**spare** | **bool** | Whether the Hardware Reservation is a spare. Spare Hardware Reservations are used when a Hardware Reservations requires service from Equinix Metal | [optional] +**switch_uuid** | **str** | Switch short id. This can be used to determine if two devices are connected to the same switch, for example. | [optional] +**termination_time** | **datetime** | Expiration date for the reservation. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.hardware_reservation import HardwareReservation + +# TODO update the JSON string below +json = "{}" +# create an instance of HardwareReservation from a JSON string +hardware_reservation_instance = HardwareReservation.from_json(json) +# print the JSON string representation of the object +print(HardwareReservation.to_json()) + +# convert the object into a dict +hardware_reservation_dict = hardware_reservation_instance.to_dict() +# create an instance of HardwareReservation from a dict +hardware_reservation_form_dict = hardware_reservation.from_dict(hardware_reservation_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/HardwareReservationList.md b/equinix/services/metalv1/docs/HardwareReservationList.md new file mode 100644 index 00000000..c3016389 --- /dev/null +++ b/equinix/services/metalv1/docs/HardwareReservationList.md @@ -0,0 +1,31 @@ +# HardwareReservationList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hardware_reservations** | [**List[HardwareReservation]**](HardwareReservation.md) | | [optional] +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.hardware_reservation_list import HardwareReservationList + +# TODO update the JSON string below +json = "{}" +# create an instance of HardwareReservationList from a JSON string +hardware_reservation_list_instance = HardwareReservationList.from_json(json) +# print the JSON string representation of the object +print(HardwareReservationList.to_json()) + +# convert the object into a dict +hardware_reservation_list_dict = hardware_reservation_list_instance.to_dict() +# create an instance of HardwareReservationList from a dict +hardware_reservation_list_form_dict = hardware_reservation_list.from_dict(hardware_reservation_list_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/HardwareReservationsApi.md b/equinix/services/metalv1/docs/HardwareReservationsApi.md new file mode 100644 index 00000000..57b36569 --- /dev/null +++ b/equinix/services/metalv1/docs/HardwareReservationsApi.md @@ -0,0 +1,372 @@ +# equinix.services.metalv1.HardwareReservationsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**activate_hardware_reservation**](HardwareReservationsApi.md#activate_hardware_reservation) | **POST** /hardware-reservations/{id}/activate | Activate a spare hardware reservation +[**find_hardware_reservation_by_id**](HardwareReservationsApi.md#find_hardware_reservation_by_id) | **GET** /hardware-reservations/{id} | Retrieve a hardware reservation +[**find_project_hardware_reservations**](HardwareReservationsApi.md#find_project_hardware_reservations) | **GET** /projects/{id}/hardware-reservations | Retrieve all hardware reservations for a given project +[**find_project_hardware_reservations_all_pages**](HardwareReservationsApi.md#find_project_hardware_reservations_all_pages) | **GET** /projects/{id}/hardware-reservations | Retrieve all hardware reservations for a given project, fetches all the pages +[**move_hardware_reservation**](HardwareReservationsApi.md#move_hardware_reservation) | **POST** /hardware-reservations/{id}/move | Move a hardware reservation + + +# **activate_hardware_reservation** +> HardwareReservation activate_hardware_reservation(id, include=include, exclude=exclude, activate_hardware_reservation_request=activate_hardware_reservation_request) + +Activate a spare hardware reservation + +Activate a spare hardware reservation + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.activate_hardware_reservation_request import ActivateHardwareReservationRequest +from equinix.services.metalv1.models.hardware_reservation import HardwareReservation +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.HardwareReservationsApi(api_client) + id = 'id_example' # str | Hardware Reservation UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + activate_hardware_reservation_request = equinix.services.metalv1.ActivateHardwareReservationRequest() # ActivateHardwareReservationRequest | Note to attach to the reservation (optional) + + try: + # Activate a spare hardware reservation + api_response = api_instance.activate_hardware_reservation(id, include=include, exclude=exclude, activate_hardware_reservation_request=activate_hardware_reservation_request) + print("The response of HardwareReservationsApi->activate_hardware_reservation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HardwareReservationsApi->activate_hardware_reservation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Hardware Reservation UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **activate_hardware_reservation_request** | [**ActivateHardwareReservationRequest**](ActivateHardwareReservationRequest.md)| Note to attach to the reservation | [optional] + +### Return type + +[**HardwareReservation**](HardwareReservation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_hardware_reservation_by_id** +> HardwareReservation find_hardware_reservation_by_id(id, include=include, exclude=exclude) + +Retrieve a hardware reservation + +Returns a single hardware reservation + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.hardware_reservation import HardwareReservation +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.HardwareReservationsApi(api_client) + id = 'id_example' # str | HardwareReservation UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve a hardware reservation + api_response = api_instance.find_hardware_reservation_by_id(id, include=include, exclude=exclude) + print("The response of HardwareReservationsApi->find_hardware_reservation_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HardwareReservationsApi->find_hardware_reservation_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| HardwareReservation UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**HardwareReservation**](HardwareReservation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_hardware_reservations** +> HardwareReservationList find_project_hardware_reservations(id, query=query, state=state, provisionable=provisionable, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve all hardware reservations for a given project + +Provides a collection of hardware reservations for a given project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.hardware_reservation_list import HardwareReservationList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.HardwareReservationsApi(api_client) + id = 'id_example' # str | Project UUID + query = 'query_example' # str | Search by facility code, plan name, project name, reservation short ID or device hostname (optional) + state = 'state_example' # str | Filter by hardware reservation state (optional) + provisionable = 'provisionable_example' # str | Filter hardware reservation that is provisionable (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve all hardware reservations for a given project + api_response = api_instance.find_project_hardware_reservations(id, query=query, state=state, provisionable=provisionable, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of HardwareReservationsApi->find_project_hardware_reservations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HardwareReservationsApi->find_project_hardware_reservations: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **query** | **str**| Search by facility code, plan name, project name, reservation short ID or device hostname | [optional] + **state** | **str**| Filter by hardware reservation state | [optional] + **provisionable** | **str**| Filter hardware reservation that is provisionable | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**HardwareReservationList**](HardwareReservationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_hardware_reservations_all_pages** +> HardwareReservationList find_project_hardware_reservations_all_pages(id, query=query, state=state, provisionable=provisionable, include=include, exclude=exclude, per_page=per_page) +Just like [**find_project_hardware_reservations**](HardwareReservationsApi.md#find_project_hardware_reservations) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_project_hardware_reservations**](HardwareReservationsApi.md#find_project_hardware_reservations). +# **move_hardware_reservation** +> HardwareReservation move_hardware_reservation(id, move_hardware_reservation_request, include=include, exclude=exclude) + +Move a hardware reservation + +Move a hardware reservation to another project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.hardware_reservation import HardwareReservation +from equinix.services.metalv1.models.move_hardware_reservation_request import MoveHardwareReservationRequest +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.HardwareReservationsApi(api_client) + id = 'id_example' # str | Hardware Reservation UUID + move_hardware_reservation_request = equinix.services.metalv1.MoveHardwareReservationRequest() # MoveHardwareReservationRequest | Destination Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Move a hardware reservation + api_response = api_instance.move_hardware_reservation(id, move_hardware_reservation_request, include=include, exclude=exclude) + print("The response of HardwareReservationsApi->move_hardware_reservation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling HardwareReservationsApi->move_hardware_reservation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Hardware Reservation UUID | + **move_hardware_reservation_request** | [**MoveHardwareReservationRequest**](MoveHardwareReservationRequest.md)| Destination Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**HardwareReservation**](HardwareReservation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Href.md b/equinix/services/metalv1/docs/Href.md new file mode 100644 index 00000000..a0e775a7 --- /dev/null +++ b/equinix/services/metalv1/docs/Href.md @@ -0,0 +1,29 @@ +# Href + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | + +## Example + +```python +from equinix.services.metalv1.models.href import Href + +# TODO update the JSON string below +json = "{}" +# create an instance of Href from a JSON string +href_instance = Href.from_json(json) +# print the JSON string representation of the object +print(Href.to_json()) + +# convert the object into a dict +href_dict = href_instance.to_dict() +# create an instance of Href from a dict +href_form_dict = href.from_dict(href_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/IPAddress.md b/equinix/services/metalv1/docs/IPAddress.md new file mode 100644 index 00000000..b8bdc88b --- /dev/null +++ b/equinix/services/metalv1/docs/IPAddress.md @@ -0,0 +1,33 @@ +# IPAddress + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_family** | **int** | Address Family for IP Address | [optional] +**cidr** | **int** | Cidr Size for the IP Block created. Valid values depends on the operating system being provisioned. (28..32 for IPv4 addresses, 124..127 for IPv6 addresses) | [optional] +**href** | **str** | | [optional] +**ip_reservations** | **List[str]** | UUIDs of any IP reservations to use when assigning IPs | [optional] +**public** | **bool** | Address Type for IP Address | [optional] [default to True] + +## Example + +```python +from equinix.services.metalv1.models.ip_address import IPAddress + +# TODO update the JSON string below +json = "{}" +# create an instance of IPAddress from a JSON string +ip_address_instance = IPAddress.from_json(json) +# print the JSON string representation of the object +print(IPAddress.to_json()) + +# convert the object into a dict +ip_address_dict = ip_address_instance.to_dict() +# create an instance of IPAddress from a dict +ip_address_form_dict = ip_address.from_dict(ip_address_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/IPAddressesApi.md b/equinix/services/metalv1/docs/IPAddressesApi.md new file mode 100644 index 00000000..0d0cced2 --- /dev/null +++ b/equinix/services/metalv1/docs/IPAddressesApi.md @@ -0,0 +1,605 @@ +# equinix.services.metalv1.IPAddressesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_ip_address**](IPAddressesApi.md#delete_ip_address) | **DELETE** /ips/{id} | Unassign an ip address +[**find_ip_address_by_id**](IPAddressesApi.md#find_ip_address_by_id) | **GET** /ips/{id} | Retrieve an ip address +[**find_ip_address_customdata**](IPAddressesApi.md#find_ip_address_customdata) | **GET** /ips/{id}/customdata | Retrieve the custom metadata of an IP Reservation or IP Assignment +[**find_ip_availabilities**](IPAddressesApi.md#find_ip_availabilities) | **GET** /ips/{id}/available | Retrieve all available subnets of a particular reservation +[**find_ip_reservations**](IPAddressesApi.md#find_ip_reservations) | **GET** /projects/{id}/ips | Retrieve all ip reservations +[**request_ip_reservation**](IPAddressesApi.md#request_ip_reservation) | **POST** /projects/{id}/ips | Requesting IP reservations +[**update_ip_address**](IPAddressesApi.md#update_ip_address) | **PATCH** /ips/{id} | Update an ip address + + +# **delete_ip_address** +> delete_ip_address(id) + +Unassign an ip address + +This call can be used to un-assign an IP assignment or delete an IP reservation. Un-assign an IP address record. Use the assignment UUID you get after attaching the IP. This will remove the relationship between an IP and the device or metal gateway and will make the IP address available to be assigned to another device, once the IP has been un-configured from the network. Delete an IP reservation. Use the reservation UUID you get after adding the IP to the project. This will permanently delete the IP block reservation from the project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.IPAddressesApi(api_client) + id = 'id_example' # str | IP Address UUID + + try: + # Unassign an ip address + api_instance.delete_ip_address(id) + except Exception as e: + print("Exception when calling IPAddressesApi->delete_ip_address: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| IP Address UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_ip_address_by_id** +> FindIPAddressById200Response find_ip_address_by_id(id, include=include, exclude=exclude) + +Retrieve an ip address + +Returns a single ip address if the user has access. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.find_ip_address_by_id200_response import FindIPAddressById200Response +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.IPAddressesApi(api_client) + id = 'id_example' # str | IP Address UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve an ip address + api_response = api_instance.find_ip_address_by_id(id, include=include, exclude=exclude) + print("The response of IPAddressesApi->find_ip_address_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IPAddressesApi->find_ip_address_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| IP Address UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**FindIPAddressById200Response**](FindIPAddressById200Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_ip_address_customdata** +> find_ip_address_customdata(id) + +Retrieve the custom metadata of an IP Reservation or IP Assignment + +Provides the custom metadata stored for this IP Reservation or IP Assignment in json format + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.IPAddressesApi(api_client) + id = 'id_example' # str | Ip Reservation UUID + + try: + # Retrieve the custom metadata of an IP Reservation or IP Assignment + api_instance.find_ip_address_customdata(id) + except Exception as e: + print("Exception when calling IPAddressesApi->find_ip_address_customdata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Ip Reservation UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_ip_availabilities** +> IPAvailabilitiesList find_ip_availabilities(id, cidr) + +Retrieve all available subnets of a particular reservation + +Provides a list of IP resevations for a single project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ip_availabilities_list import IPAvailabilitiesList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.IPAddressesApi(api_client) + id = 'id_example' # str | IP Reservation UUID + cidr = 'cidr_example' # str | Size of subnets in bits + + try: + # Retrieve all available subnets of a particular reservation + api_response = api_instance.find_ip_availabilities(id, cidr) + print("The response of IPAddressesApi->find_ip_availabilities:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IPAddressesApi->find_ip_availabilities: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| IP Reservation UUID | + **cidr** | **str**| Size of subnets in bits | + +### Return type + +[**IPAvailabilitiesList**](IPAvailabilitiesList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_ip_reservations** +> IPReservationList find_ip_reservations(id, types=types, include=include, exclude=exclude, per_page=per_page) + +Retrieve all ip reservations + +Provides a paginated list of IP reservations for a single project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ip_reservation_list import IPReservationList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.IPAddressesApi(api_client) + id = 'id_example' # str | Project UUID + types = ['types_example'] # List[str] | Filter project IP reservations by reservation type (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + per_page = 250 # int | Items returned per page (optional) (default to 250) + + try: + # Retrieve all ip reservations + api_response = api_instance.find_ip_reservations(id, types=types, include=include, exclude=exclude, per_page=per_page) + print("The response of IPAddressesApi->find_ip_reservations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IPAddressesApi->find_ip_reservations: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **types** | [**List[str]**](str.md)| Filter project IP reservations by reservation type | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **per_page** | **int**| Items returned per page | [optional] [default to 250] + +### Return type + +[**IPReservationList**](IPReservationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **request_ip_reservation** +> RequestIPReservation201Response request_ip_reservation(id, request_ip_reservation_request, include=include, exclude=exclude) + +Requesting IP reservations + +Request more IP space for a project in order to have additional IP addresses to assign to devices. If the request is within the max quota, an IP reservation will be created. If the project will exceed its IP quota, a request will be submitted for review, and will return an IP Reservation with a `state` of `pending`. You can automatically have the request fail with HTTP status 422 instead of triggering the review process by providing the `fail_on_approval_required` parameter set to `true` in the request. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.request_ip_reservation201_response import RequestIPReservation201Response +from equinix.services.metalv1.models.request_ip_reservation_request import RequestIPReservationRequest +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.IPAddressesApi(api_client) + id = 'id_example' # str | Project UUID + request_ip_reservation_request = equinix.services.metalv1.RequestIPReservationRequest() # RequestIPReservationRequest | IP Reservation Request to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Requesting IP reservations + api_response = api_instance.request_ip_reservation(id, request_ip_reservation_request, include=include, exclude=exclude) + print("The response of IPAddressesApi->request_ip_reservation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IPAddressesApi->request_ip_reservation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **request_ip_reservation_request** | [**RequestIPReservationRequest**](RequestIPReservationRequest.md)| IP Reservation Request to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**RequestIPReservation201Response**](RequestIPReservation201Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_ip_address** +> FindIPAddressById200Response update_ip_address(id, include=include, exclude=exclude, ip_assignment_update_input=ip_assignment_update_input) + +Update an ip address + +Update details about an ip address + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.find_ip_address_by_id200_response import FindIPAddressById200Response +from equinix.services.metalv1.models.ip_assignment_update_input import IPAssignmentUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.IPAddressesApi(api_client) + id = 'id_example' # str | IP Address UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + ip_assignment_update_input = equinix.services.metalv1.IPAssignmentUpdateInput() # IPAssignmentUpdateInput | (optional) + + try: + # Update an ip address + api_response = api_instance.update_ip_address(id, include=include, exclude=exclude, ip_assignment_update_input=ip_assignment_update_input) + print("The response of IPAddressesApi->update_ip_address:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IPAddressesApi->update_ip_address: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| IP Address UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **ip_assignment_update_input** | [**IPAssignmentUpdateInput**](IPAssignmentUpdateInput.md)| | [optional] + +### Return type + +[**FindIPAddressById200Response**](FindIPAddressById200Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/IPAssignment.md b/equinix/services/metalv1/docs/IPAssignment.md new file mode 100644 index 00000000..81f8d0f0 --- /dev/null +++ b/equinix/services/metalv1/docs/IPAssignment.md @@ -0,0 +1,47 @@ +# IPAssignment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | [optional] +**address_family** | **int** | | [optional] +**assigned_to** | [**Href**](Href.md) | | +**cidr** | **int** | | [optional] +**created_at** | **datetime** | | [optional] +**enabled** | **bool** | | [optional] +**gateway** | **str** | | [optional] +**global_ip** | **bool** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**manageable** | **bool** | | [optional] +**management** | **bool** | | [optional] +**metro** | [**IPAssignmentMetro**](IPAssignmentMetro.md) | | [optional] +**netmask** | **str** | | [optional] +**network** | **str** | | [optional] +**next_hop** | **str** | Only set when this is a Metal Gateway Elastic IP Assignment. The IP address within the Metal Gateway to which requests to the Elastic IP are forwarded. | [optional] +**parent_block** | [**ParentBlock**](ParentBlock.md) | | [optional] +**public** | **bool** | | [optional] +**state** | **str** | Only set when this is a Metal Gateway Elastic IP Assignment. Describes the current configuration state of this IP on the network. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ip_assignment import IPAssignment + +# TODO update the JSON string below +json = "{}" +# create an instance of IPAssignment from a JSON string +ip_assignment_instance = IPAssignment.from_json(json) +# print the JSON string representation of the object +print(IPAssignment.to_json()) + +# convert the object into a dict +ip_assignment_dict = ip_assignment_instance.to_dict() +# create an instance of IPAssignment from a dict +ip_assignment_form_dict = ip_assignment.from_dict(ip_assignment_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/IPAssignmentInput.md b/equinix/services/metalv1/docs/IPAssignmentInput.md new file mode 100644 index 00000000..8415c9d1 --- /dev/null +++ b/equinix/services/metalv1/docs/IPAssignmentInput.md @@ -0,0 +1,31 @@ +# IPAssignmentInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | +**customdata** | **object** | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ip_assignment_input import IPAssignmentInput + +# TODO update the JSON string below +json = "{}" +# create an instance of IPAssignmentInput from a JSON string +ip_assignment_input_instance = IPAssignmentInput.from_json(json) +# print the JSON string representation of the object +print(IPAssignmentInput.to_json()) + +# convert the object into a dict +ip_assignment_input_dict = ip_assignment_input_instance.to_dict() +# create an instance of IPAssignmentInput from a dict +ip_assignment_input_form_dict = ip_assignment_input.from_dict(ip_assignment_input_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/IPAssignmentList.md b/equinix/services/metalv1/docs/IPAssignmentList.md new file mode 100644 index 00000000..d798ea5b --- /dev/null +++ b/equinix/services/metalv1/docs/IPAssignmentList.md @@ -0,0 +1,30 @@ +# IPAssignmentList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**ip_addresses** | [**List[IPAssignment]**](IPAssignment.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ip_assignment_list import IPAssignmentList + +# TODO update the JSON string below +json = "{}" +# create an instance of IPAssignmentList from a JSON string +ip_assignment_list_instance = IPAssignmentList.from_json(json) +# print the JSON string representation of the object +print(IPAssignmentList.to_json()) + +# convert the object into a dict +ip_assignment_list_dict = ip_assignment_list_instance.to_dict() +# create an instance of IPAssignmentList from a dict +ip_assignment_list_form_dict = ip_assignment_list.from_dict(ip_assignment_list_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/IPAssignmentMetro.md b/equinix/services/metalv1/docs/IPAssignmentMetro.md new file mode 100644 index 00000000..17bb616a --- /dev/null +++ b/equinix/services/metalv1/docs/IPAssignmentMetro.md @@ -0,0 +1,33 @@ +# IPAssignmentMetro + + +## 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.ip_assignment_metro import IPAssignmentMetro + +# TODO update the JSON string below +json = "{}" +# create an instance of IPAssignmentMetro from a JSON string +ip_assignment_metro_instance = IPAssignmentMetro.from_json(json) +# print the JSON string representation of the object +print(IPAssignmentMetro.to_json()) + +# convert the object into a dict +ip_assignment_metro_dict = ip_assignment_metro_instance.to_dict() +# create an instance of IPAssignmentMetro from a dict +ip_assignment_metro_form_dict = ip_assignment_metro.from_dict(ip_assignment_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/IPAssignmentUpdateInput.md b/equinix/services/metalv1/docs/IPAssignmentUpdateInput.md new file mode 100644 index 00000000..5cef298b --- /dev/null +++ b/equinix/services/metalv1/docs/IPAssignmentUpdateInput.md @@ -0,0 +1,32 @@ +# IPAssignmentUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customdata** | **object** | | [optional] +**details** | **str** | | [optional] +**href** | **str** | | [optional] +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ip_assignment_update_input import IPAssignmentUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of IPAssignmentUpdateInput from a JSON string +ip_assignment_update_input_instance = IPAssignmentUpdateInput.from_json(json) +# print the JSON string representation of the object +print(IPAssignmentUpdateInput.to_json()) + +# convert the object into a dict +ip_assignment_update_input_dict = ip_assignment_update_input_instance.to_dict() +# create an instance of IPAssignmentUpdateInput from a dict +ip_assignment_update_input_form_dict = ip_assignment_update_input.from_dict(ip_assignment_update_input_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/IPAvailabilitiesList.md b/equinix/services/metalv1/docs/IPAvailabilitiesList.md new file mode 100644 index 00000000..3ad4c581 --- /dev/null +++ b/equinix/services/metalv1/docs/IPAvailabilitiesList.md @@ -0,0 +1,30 @@ +# IPAvailabilitiesList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available** | **List[str]** | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ip_availabilities_list import IPAvailabilitiesList + +# TODO update the JSON string below +json = "{}" +# create an instance of IPAvailabilitiesList from a JSON string +ip_availabilities_list_instance = IPAvailabilitiesList.from_json(json) +# print the JSON string representation of the object +print(IPAvailabilitiesList.to_json()) + +# convert the object into a dict +ip_availabilities_list_dict = ip_availabilities_list_instance.to_dict() +# create an instance of IPAvailabilitiesList from a dict +ip_availabilities_list_form_dict = ip_availabilities_list.from_dict(ip_availabilities_list_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/IPReservation.md b/equinix/services/metalv1/docs/IPReservation.md new file mode 100644 index 00000000..16d3b8a6 --- /dev/null +++ b/equinix/services/metalv1/docs/IPReservation.md @@ -0,0 +1,57 @@ +# IPReservation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addon** | **bool** | | [optional] +**address** | **str** | | [optional] +**address_family** | **int** | | [optional] +**assignments** | [**List[Href]**](Href.md) | | [optional] +**available** | **str** | | [optional] +**bill** | **bool** | | [optional] +**cidr** | **int** | | [optional] +**created_at** | **datetime** | | [optional] +**customdata** | **object** | | [optional] +**details** | **str** | | [optional] +**enabled** | **bool** | | [optional] +**facility** | [**IPReservationFacility**](IPReservationFacility.md) | | [optional] +**gateway** | **str** | | [optional] +**global_ip** | **bool** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**manageable** | **bool** | | [optional] +**management** | **bool** | | [optional] +**metal_gateway** | [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] +**metro** | [**IPReservationMetro**](IPReservationMetro.md) | | [optional] +**netmask** | **str** | | [optional] +**network** | **str** | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**project_lite** | [**Href**](Href.md) | | [optional] +**public** | **bool** | | [optional] +**requested_by** | [**Href**](Href.md) | | [optional] +**state** | **str** | | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | | + +## Example + +```python +from equinix.services.metalv1.models.ip_reservation import IPReservation + +# TODO update the JSON string below +json = "{}" +# create an instance of IPReservation from a JSON string +ip_reservation_instance = IPReservation.from_json(json) +# print the JSON string representation of the object +print(IPReservation.to_json()) + +# convert the object into a dict +ip_reservation_dict = ip_reservation_instance.to_dict() +# create an instance of IPReservation from a dict +ip_reservation_form_dict = ip_reservation.from_dict(ip_reservation_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/IPReservationFacility.md b/equinix/services/metalv1/docs/IPReservationFacility.md new file mode 100644 index 00000000..99004672 --- /dev/null +++ b/equinix/services/metalv1/docs/IPReservationFacility.md @@ -0,0 +1,36 @@ +# IPReservationFacility + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**Address**](Address.md) | | [optional] +**code** | **str** | | [optional] +**features** | **List[str]** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**ip_ranges** | **List[str]** | IP ranges registered in facility. Can be used for GeoIP location | [optional] +**metro** | [**DeviceMetro**](DeviceMetro.md) | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ip_reservation_facility import IPReservationFacility + +# TODO update the JSON string below +json = "{}" +# create an instance of IPReservationFacility from a JSON string +ip_reservation_facility_instance = IPReservationFacility.from_json(json) +# print the JSON string representation of the object +print(IPReservationFacility.to_json()) + +# convert the object into a dict +ip_reservation_facility_dict = ip_reservation_facility_instance.to_dict() +# create an instance of IPReservationFacility from a dict +ip_reservation_facility_form_dict = ip_reservation_facility.from_dict(ip_reservation_facility_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/IPReservationList.md b/equinix/services/metalv1/docs/IPReservationList.md new file mode 100644 index 00000000..a9b84b1d --- /dev/null +++ b/equinix/services/metalv1/docs/IPReservationList.md @@ -0,0 +1,31 @@ +# IPReservationList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**ip_addresses** | [**List[IPReservationListIpAddressesInner]**](IPReservationListIpAddressesInner.md) | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ip_reservation_list import IPReservationList + +# TODO update the JSON string below +json = "{}" +# create an instance of IPReservationList from a JSON string +ip_reservation_list_instance = IPReservationList.from_json(json) +# print the JSON string representation of the object +print(IPReservationList.to_json()) + +# convert the object into a dict +ip_reservation_list_dict = ip_reservation_list_instance.to_dict() +# create an instance of IPReservationList from a dict +ip_reservation_list_form_dict = ip_reservation_list.from_dict(ip_reservation_list_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/IPReservationListIpAddressesInner.md b/equinix/services/metalv1/docs/IPReservationListIpAddressesInner.md new file mode 100644 index 00000000..95a5b9e8 --- /dev/null +++ b/equinix/services/metalv1/docs/IPReservationListIpAddressesInner.md @@ -0,0 +1,59 @@ +# IPReservationListIpAddressesInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addon** | **bool** | | [optional] +**address** | **str** | | [optional] +**address_family** | **int** | | [optional] +**assignments** | [**List[Href]**](Href.md) | | [optional] +**available** | **str** | | [optional] +**bill** | **bool** | | [optional] +**cidr** | **int** | | [optional] +**created_at** | **datetime** | | [optional] +**customdata** | **object** | | [optional] +**details** | **str** | | [optional] +**enabled** | **bool** | | [optional] +**facility** | [**IPReservationFacility**](IPReservationFacility.md) | | [optional] +**gateway** | **str** | | [optional] +**global_ip** | **bool** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**manageable** | **bool** | | [optional] +**management** | **bool** | | [optional] +**metal_gateway** | [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] +**metro** | [**Metro**](Metro.md) | | [optional] +**netmask** | **str** | | [optional] +**network** | **str** | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**project_lite** | [**Project**](Project.md) | | [optional] +**public** | **bool** | | [optional] +**requested_by** | [**Href**](Href.md) | | [optional] +**state** | **str** | | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | | +**created_by** | [**Href**](Href.md) | | [optional] +**vrf** | [**Vrf**](Vrf.md) | | + +## Example + +```python +from equinix.services.metalv1.models.ip_reservation_list_ip_addresses_inner import IPReservationListIpAddressesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of IPReservationListIpAddressesInner from a JSON string +ip_reservation_list_ip_addresses_inner_instance = IPReservationListIpAddressesInner.from_json(json) +# print the JSON string representation of the object +print(IPReservationListIpAddressesInner.to_json()) + +# convert the object into a dict +ip_reservation_list_ip_addresses_inner_dict = ip_reservation_list_ip_addresses_inner_instance.to_dict() +# create an instance of IPReservationListIpAddressesInner from a dict +ip_reservation_list_ip_addresses_inner_form_dict = ip_reservation_list_ip_addresses_inner.from_dict(ip_reservation_list_ip_addresses_inner_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/IPReservationMetro.md b/equinix/services/metalv1/docs/IPReservationMetro.md new file mode 100644 index 00000000..fc4ad034 --- /dev/null +++ b/equinix/services/metalv1/docs/IPReservationMetro.md @@ -0,0 +1,33 @@ +# IPReservationMetro + + +## 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.ip_reservation_metro import IPReservationMetro + +# TODO update the JSON string below +json = "{}" +# create an instance of IPReservationMetro from a JSON string +ip_reservation_metro_instance = IPReservationMetro.from_json(json) +# print the JSON string representation of the object +print(IPReservationMetro.to_json()) + +# convert the object into a dict +ip_reservation_metro_dict = ip_reservation_metro_instance.to_dict() +# create an instance of IPReservationMetro from a dict +ip_reservation_metro_form_dict = ip_reservation_metro.from_dict(ip_reservation_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/IPReservationRequestInput.md b/equinix/services/metalv1/docs/IPReservationRequestInput.md new file mode 100644 index 00000000..9fa4cc68 --- /dev/null +++ b/equinix/services/metalv1/docs/IPReservationRequestInput.md @@ -0,0 +1,38 @@ +# IPReservationRequestInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comments** | **str** | | [optional] +**customdata** | **object** | | [optional] +**details** | **str** | | [optional] +**facility** | **str** | | [optional] +**fail_on_approval_required** | **bool** | | [optional] +**href** | **str** | | [optional] +**metro** | **str** | The code of the metro you are requesting the IP reservation in. | [optional] +**quantity** | **int** | | +**tags** | **List[str]** | | [optional] +**type** | **str** | | + +## Example + +```python +from equinix.services.metalv1.models.ip_reservation_request_input import IPReservationRequestInput + +# TODO update the JSON string below +json = "{}" +# create an instance of IPReservationRequestInput from a JSON string +ip_reservation_request_input_instance = IPReservationRequestInput.from_json(json) +# print the JSON string representation of the object +print(IPReservationRequestInput.to_json()) + +# convert the object into a dict +ip_reservation_request_input_dict = ip_reservation_request_input_instance.to_dict() +# create an instance of IPReservationRequestInput from a dict +ip_reservation_request_input_form_dict = ip_reservation_request_input.from_dict(ip_reservation_request_input_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/IncidentsApi.md b/equinix/services/metalv1/docs/IncidentsApi.md new file mode 100644 index 00000000..768a5749 --- /dev/null +++ b/equinix/services/metalv1/docs/IncidentsApi.md @@ -0,0 +1,87 @@ +# equinix.services.metalv1.IncidentsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_incidents**](IncidentsApi.md#find_incidents) | **GET** /incidents | Retrieve the number of incidents + + +# **find_incidents** +> find_incidents(include=include, exclude=exclude) + +Retrieve the number of incidents + +Retrieve the number of incidents. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.IncidentsApi(api_client) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve the number of incidents + api_instance.find_incidents(include=include, exclude=exclude) + except Exception as e: + print("Exception when calling IncidentsApi->find_incidents: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/InstancesBatchCreateInput.md b/equinix/services/metalv1/docs/InstancesBatchCreateInput.md new file mode 100644 index 00000000..d13a3b7b --- /dev/null +++ b/equinix/services/metalv1/docs/InstancesBatchCreateInput.md @@ -0,0 +1,30 @@ +# InstancesBatchCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**batches** | [**List[InstancesBatchCreateInputBatchesInner]**](InstancesBatchCreateInputBatchesInner.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.instances_batch_create_input import InstancesBatchCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of InstancesBatchCreateInput from a JSON string +instances_batch_create_input_instance = InstancesBatchCreateInput.from_json(json) +# print the JSON string representation of the object +print(InstancesBatchCreateInput.to_json()) + +# convert the object into a dict +instances_batch_create_input_dict = instances_batch_create_input_instance.to_dict() +# create an instance of InstancesBatchCreateInput from a dict +instances_batch_create_input_form_dict = instances_batch_create_input.from_dict(instances_batch_create_input_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/InstancesBatchCreateInputBatchesInner.md b/equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md new file mode 100644 index 00000000..d50cca21 --- /dev/null +++ b/equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md @@ -0,0 +1,58 @@ +# InstancesBatchCreateInputBatchesInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hostnames** | **List[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] +**customdata** | **Dict[str, object]** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] +**description** | **str** | Any description of the device or how it will be used. This may be used to inform other API consumers with project access. | [optional] +**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}]] +**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] +**no_ssh_keys** | **bool** | Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified | [optional] [default to False] +**operating_system** | **str** | The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. | +**plan** | **str** | The slug of the device plan to provision. | +**private_ipv4_subnet_size** | **int** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. | [optional] +**project_ssh_keys** | **List[str]** | A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**public_ipv4_subnet_size** | **int** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. | [optional] +**spot_instance** | **bool** | Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. | [optional] +**spot_price_max** | **float** | The maximum amount to bid for a spot instance. | [optional] +**ssh_keys** | [**List[SSHKeyInput]**](SSHKeyInput.md) | A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. | [optional] +**storage** | [**Storage**](Storage.md) | | [optional] +**tags** | **List[str]** | | [optional] +**termination_time** | **datetime** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**user_ssh_keys** | **List[str]** | A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**userdata** | **str** | 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. | [optional] +**facility** | [**FacilityInputFacility**](FacilityInputFacility.md) | | + +## Example + +```python +from equinix.services.metalv1.models.instances_batch_create_input_batches_inner import InstancesBatchCreateInputBatchesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of InstancesBatchCreateInputBatchesInner from a JSON string +instances_batch_create_input_batches_inner_instance = InstancesBatchCreateInputBatchesInner.from_json(json) +# print the JSON string representation of the object +print(InstancesBatchCreateInputBatchesInner.to_json()) + +# convert the object into a dict +instances_batch_create_input_batches_inner_dict = instances_batch_create_input_batches_inner_instance.to_dict() +# create an instance of InstancesBatchCreateInputBatchesInner from a dict +instances_batch_create_input_batches_inner_form_dict = instances_batch_create_input_batches_inner.from_dict(instances_batch_create_input_batches_inner_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 new file mode 100644 index 00000000..bfdb9f22 --- /dev/null +++ b/equinix/services/metalv1/docs/Interconnection.md @@ -0,0 +1,51 @@ +# Interconnection + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authorization_code** | **str** | For Fabric VCs (Metal Billed), this allows Fabric to connect the Metal network to any connection Fabric facilitates. Fabric uses this token to be able to give more detailed information about the Metal end of the network, when viewing resources from within Fabric. | [optional] +**contact_email** | **str** | | [optional] +**created_at** | **datetime** | | [optional] +**description** | **str** | | [optional] +**fabric_provider** | [**InterconnectionFabricProvider**](InterconnectionFabricProvider.md) | | [optional] +**facility** | [**Facility**](Facility.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [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] +**ports** | [**List[InterconnectionPort]**](InterconnectionPort.md) | For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the Dedicated Port(s). | [optional] +**project** | [**Project**](Project.md) | | [optional] +**redundancy** | **str** | Either 'primary', meaning a single interconnection, or 'redundant', meaning a redundant interconnection. | [optional] +**requested_by** | [**Href**](Href.md) | | [optional] +**service_tokens** | [**List[FabricServiceToken]**](FabricServiceToken.md) | For Fabric VCs (Metal Billed), this will show details of the A-Side service tokens issued for the interconnection. For Fabric VCs (Fabric Billed), this will show the details of the Z-Side service tokens issued for the interconnection. Dedicated interconnections will not have any service tokens issued. There will be one per interconnection, so for redundant interconnections, there should be two service tokens issued. | [optional] +**speed** | **int** | For interconnections on Dedicated Ports and shared connections, this represents the interconnection's speed in bps. For Fabric VCs, this field refers to the maximum speed of the interconnection in bps. This value will default to 10Gbps for Fabric VCs (Fabric Billed). | [optional] +**status** | **str** | | [optional] +**tags** | **List[str]** | | [optional] +**token** | **str** | This token is used for shared interconnections to be used as the Fabric Token. This field is entirely deprecated. | [optional] +**type** | **str** | The 'shared' type of interconnection refers to shared connections, or later also known as Fabric Virtual Connections (or Fabric VCs). The 'dedicated' type of interconnection refers to interconnections created with Dedicated Ports. The 'shared_port_vlan' type of interconnection refers to shared connections created without service tokens. The 'shared_port_vlan_to_csp' type of interconnection refers to connections created directly to a supported cloud service provider. | [optional] +**updated_at** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.interconnection import Interconnection + +# TODO update the JSON string below +json = "{}" +# create an instance of Interconnection from a JSON string +interconnection_instance = Interconnection.from_json(json) +# print the JSON string representation of the object +print(Interconnection.to_json()) + +# convert the object into a dict +interconnection_dict = interconnection_instance.to_dict() +# create an instance of Interconnection from a dict +interconnection_form_dict = interconnection.from_dict(interconnection_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/InterconnectionFabricProvider.md b/equinix/services/metalv1/docs/InterconnectionFabricProvider.md new file mode 100644 index 00000000..5fa1ad5f --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionFabricProvider.md @@ -0,0 +1,33 @@ +# InterconnectionFabricProvider + +Configuration information for connecting to external cloud service provider. Only available if the fabric_provider param was used when creating the interconnection. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_id** | **str** | AWS Account ID | +**href** | **str** | | [optional] +**location** | **str** | | [optional] +**type** | **str** | | + +## Example + +```python +from equinix.services.metalv1.models.interconnection_fabric_provider import InterconnectionFabricProvider + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionFabricProvider from a JSON string +interconnection_fabric_provider_instance = InterconnectionFabricProvider.from_json(json) +# print the JSON string representation of the object +print(InterconnectionFabricProvider.to_json()) + +# convert the object into a dict +interconnection_fabric_provider_dict = interconnection_fabric_provider_instance.to_dict() +# create an instance of InterconnectionFabricProvider from a dict +interconnection_fabric_provider_form_dict = interconnection_fabric_provider.from_dict(interconnection_fabric_provider_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/InterconnectionList.md b/equinix/services/metalv1/docs/InterconnectionList.md new file mode 100644 index 00000000..73512061 --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionList.md @@ -0,0 +1,31 @@ +# InterconnectionList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**interconnections** | [**List[Interconnection]**](Interconnection.md) | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.interconnection_list import InterconnectionList + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionList from a JSON string +interconnection_list_instance = InterconnectionList.from_json(json) +# print the JSON string representation of the object +print(InterconnectionList.to_json()) + +# convert the object into a dict +interconnection_list_dict = interconnection_list_instance.to_dict() +# create an instance of InterconnectionList from a dict +interconnection_list_form_dict = interconnection_list.from_dict(interconnection_list_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/InterconnectionMetroList.md b/equinix/services/metalv1/docs/InterconnectionMetroList.md new file mode 100644 index 00000000..a811a092 --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionMetroList.md @@ -0,0 +1,31 @@ +# InterconnectionMetroList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] +**metros** | [**List[InterconnectionMetroListMetrosInner]**](InterconnectionMetroListMetrosInner.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.interconnection_metro_list import InterconnectionMetroList + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionMetroList from a JSON string +interconnection_metro_list_instance = InterconnectionMetroList.from_json(json) +# print the JSON string representation of the object +print(InterconnectionMetroList.to_json()) + +# convert the object into a dict +interconnection_metro_list_dict = interconnection_metro_list_instance.to_dict() +# create an instance of InterconnectionMetroList from a dict +interconnection_metro_list_form_dict = interconnection_metro_list.from_dict(interconnection_metro_list_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/InterconnectionMetroListMetrosInner.md b/equinix/services/metalv1/docs/InterconnectionMetroListMetrosInner.md new file mode 100644 index 00000000..3a474c1d --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionMetroListMetrosInner.md @@ -0,0 +1,34 @@ +# InterconnectionMetroListMetrosInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | | [optional] +**country** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**name** | **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 import InterconnectionMetroListMetrosInner + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionMetroListMetrosInner from a JSON string +interconnection_metro_list_metros_inner_instance = InterconnectionMetroListMetrosInner.from_json(json) +# print the JSON string representation of the object +print(InterconnectionMetroListMetrosInner.to_json()) + +# convert the object into a dict +interconnection_metro_list_metros_inner_dict = interconnection_metro_list_metros_inner_instance.to_dict() +# create an instance of InterconnectionMetroListMetrosInner from a dict +interconnection_metro_list_metros_inner_form_dict = interconnection_metro_list_metros_inner.from_dict(interconnection_metro_list_metros_inner_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/InterconnectionMetroListMetrosInnerAllOfProvidersInner.md b/equinix/services/metalv1/docs/InterconnectionMetroListMetrosInnerAllOfProvidersInner.md new file mode 100644 index 00000000..441a1dbf --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionMetroListMetrosInnerAllOfProvidersInner.md @@ -0,0 +1,34 @@ +# InterconnectionMetroListMetrosInnerAllOfProvidersInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bandwidths** | **List[int]** | | [optional] +**features** | **List[str]** | | [optional] +**href** | **str** | | [optional] +**locations** | **List[str]** | | [optional] +**name** | **str** | | [optional] +**type** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.interconnection_metro_list_metros_inner_all_of_providers_inner import InterconnectionMetroListMetrosInnerAllOfProvidersInner + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionMetroListMetrosInnerAllOfProvidersInner from a JSON string +interconnection_metro_list_metros_inner_all_of_providers_inner_instance = InterconnectionMetroListMetrosInnerAllOfProvidersInner.from_json(json) +# print the JSON string representation of the object +print(InterconnectionMetroListMetrosInnerAllOfProvidersInner.to_json()) + +# convert the object into a dict +interconnection_metro_list_metros_inner_all_of_providers_inner_dict = interconnection_metro_list_metros_inner_all_of_providers_inner_instance.to_dict() +# create an instance of InterconnectionMetroListMetrosInnerAllOfProvidersInner from a dict +interconnection_metro_list_metros_inner_all_of_providers_inner_form_dict = interconnection_metro_list_metros_inner_all_of_providers_inner.from_dict(interconnection_metro_list_metros_inner_all_of_providers_inner_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/InterconnectionPort.md b/equinix/services/metalv1/docs/InterconnectionPort.md new file mode 100644 index 00000000..53b6473c --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionPort.md @@ -0,0 +1,38 @@ +# InterconnectionPort + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**link_status** | **str** | | [optional] +**name** | **str** | | [optional] +**organization** | [**Href**](Href.md) | | [optional] +**role** | **str** | Either 'primary' or 'secondary'. | [optional] +**speed** | **int** | | [optional] +**status** | **str** | For both Fabric VCs and Dedicated Ports, this will be 'requested' on creation and 'deleting' on deletion. Once the Fabric VC has found its corresponding Fabric connection, this will turn to 'active'. For Dedicated Ports, once the dedicated port is associated, this will also turn to 'active'. For Fabric VCs, this can turn into an 'expired' state if the service token associated is expired. | [optional] +**switch_id** | **str** | A switch 'short ID' | [optional] +**virtual_circuits** | [**List[VirtualCircuit]**](VirtualCircuit.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.interconnection_port import InterconnectionPort + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionPort from a JSON string +interconnection_port_instance = InterconnectionPort.from_json(json) +# print the JSON string representation of the object +print(InterconnectionPort.to_json()) + +# convert the object into a dict +interconnection_port_dict = interconnection_port_instance.to_dict() +# create an instance of InterconnectionPort from a dict +interconnection_port_form_dict = interconnection_port.from_dict(interconnection_port_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/InterconnectionPortList.md b/equinix/services/metalv1/docs/InterconnectionPortList.md new file mode 100644 index 00000000..42c27ef2 --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionPortList.md @@ -0,0 +1,30 @@ +# InterconnectionPortList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**ports** | [**List[InterconnectionPort]**](InterconnectionPort.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.interconnection_port_list import InterconnectionPortList + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionPortList from a JSON string +interconnection_port_list_instance = InterconnectionPortList.from_json(json) +# print the JSON string representation of the object +print(InterconnectionPortList.to_json()) + +# convert the object into a dict +interconnection_port_list_dict = interconnection_port_list_instance.to_dict() +# create an instance of InterconnectionPortList from a dict +interconnection_port_list_form_dict = interconnection_port_list.from_dict(interconnection_port_list_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/InterconnectionPricingList.md b/equinix/services/metalv1/docs/InterconnectionPricingList.md new file mode 100644 index 00000000..be06bf05 --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionPricingList.md @@ -0,0 +1,30 @@ +# InterconnectionPricingList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**provider_pricing** | [**List[InterconnectionPricingListProviderPricingInner]**](InterconnectionPricingListProviderPricingInner.md) | Pricing information per connection provider. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.interconnection_pricing_list import InterconnectionPricingList + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionPricingList from a JSON string +interconnection_pricing_list_instance = InterconnectionPricingList.from_json(json) +# print the JSON string representation of the object +print(InterconnectionPricingList.to_json()) + +# convert the object into a dict +interconnection_pricing_list_dict = interconnection_pricing_list_instance.to_dict() +# create an instance of InterconnectionPricingList from a dict +interconnection_pricing_list_form_dict = interconnection_pricing_list.from_dict(interconnection_pricing_list_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/InterconnectionPricingListProviderPricingInner.md b/equinix/services/metalv1/docs/InterconnectionPricingListProviderPricingInner.md new file mode 100644 index 00000000..b0046777 --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionPricingListProviderPricingInner.md @@ -0,0 +1,31 @@ +# InterconnectionPricingListProviderPricingInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**provider** | **str** | | [optional] +**tiers** | [**List[InterconnectionPricingListProviderPricingInnerTiersInner]**](InterconnectionPricingListProviderPricingInnerTiersInner.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.interconnection_pricing_list_provider_pricing_inner import InterconnectionPricingListProviderPricingInner + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionPricingListProviderPricingInner from a JSON string +interconnection_pricing_list_provider_pricing_inner_instance = InterconnectionPricingListProviderPricingInner.from_json(json) +# print the JSON string representation of the object +print(InterconnectionPricingListProviderPricingInner.to_json()) + +# convert the object into a dict +interconnection_pricing_list_provider_pricing_inner_dict = interconnection_pricing_list_provider_pricing_inner_instance.to_dict() +# create an instance of InterconnectionPricingListProviderPricingInner from a dict +interconnection_pricing_list_provider_pricing_inner_form_dict = interconnection_pricing_list_provider_pricing_inner.from_dict(interconnection_pricing_list_provider_pricing_inner_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/InterconnectionPricingListProviderPricingInnerTiersInner.md b/equinix/services/metalv1/docs/InterconnectionPricingListProviderPricingInnerTiersInner.md new file mode 100644 index 00000000..f258b68e --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionPricingListProviderPricingInnerTiersInner.md @@ -0,0 +1,32 @@ +# InterconnectionPricingListProviderPricingInnerTiersInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bandwidth** | **int** | Bandwidth tier in Mbps | [optional] +**billing_cycle** | **str** | | [optional] +**href** | **str** | | [optional] +**price** | **float** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.interconnection_pricing_list_provider_pricing_inner_tiers_inner import InterconnectionPricingListProviderPricingInnerTiersInner + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionPricingListProviderPricingInnerTiersInner from a JSON string +interconnection_pricing_list_provider_pricing_inner_tiers_inner_instance = InterconnectionPricingListProviderPricingInnerTiersInner.from_json(json) +# print the JSON string representation of the object +print(InterconnectionPricingListProviderPricingInnerTiersInner.to_json()) + +# convert the object into a dict +interconnection_pricing_list_provider_pricing_inner_tiers_inner_dict = interconnection_pricing_list_provider_pricing_inner_tiers_inner_instance.to_dict() +# create an instance of InterconnectionPricingListProviderPricingInnerTiersInner from a dict +interconnection_pricing_list_provider_pricing_inner_tiers_inner_form_dict = interconnection_pricing_list_provider_pricing_inner_tiers_inner.from_dict(interconnection_pricing_list_provider_pricing_inner_tiers_inner_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/InterconnectionUpdateInput.md b/equinix/services/metalv1/docs/InterconnectionUpdateInput.md new file mode 100644 index 00000000..dc9e6d70 --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionUpdateInput.md @@ -0,0 +1,34 @@ +# InterconnectionUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contact_email** | **str** | | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [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] +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.interconnection_update_input import InterconnectionUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of InterconnectionUpdateInput from a JSON string +interconnection_update_input_instance = InterconnectionUpdateInput.from_json(json) +# print the JSON string representation of the object +print(InterconnectionUpdateInput.to_json()) + +# convert the object into a dict +interconnection_update_input_dict = interconnection_update_input_instance.to_dict() +# create an instance of InterconnectionUpdateInput from a dict +interconnection_update_input_form_dict = interconnection_update_input.from_dict(interconnection_update_input_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/InterconnectionsApi.md b/equinix/services/metalv1/docs/InterconnectionsApi.md new file mode 100644 index 00000000..611318ab --- /dev/null +++ b/equinix/services/metalv1/docs/InterconnectionsApi.md @@ -0,0 +1,1456 @@ +# equinix.services.metalv1.InterconnectionsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_interconnection_port_virtual_circuit**](InterconnectionsApi.md#create_interconnection_port_virtual_circuit) | **POST** /connections/{connection_id}/ports/{port_id}/virtual-circuits | Create a new Virtual Circuit +[**create_organization_interconnection**](InterconnectionsApi.md#create_organization_interconnection) | **POST** /organizations/{organization_id}/connections | Request a new interconnection for the organization +[**create_project_interconnection**](InterconnectionsApi.md#create_project_interconnection) | **POST** /projects/{project_id}/connections | Request a new interconnection for the project's organization +[**delete_interconnection**](InterconnectionsApi.md#delete_interconnection) | **DELETE** /connections/{connection_id} | Delete interconnection +[**delete_virtual_circuit**](InterconnectionsApi.md#delete_virtual_circuit) | **DELETE** /virtual-circuits/{id} | Delete a virtual circuit +[**get_interconnection**](InterconnectionsApi.md#get_interconnection) | **GET** /connections/{connection_id} | Get interconnection +[**get_interconnection_metros**](InterconnectionsApi.md#get_interconnection_metros) | **GET** /connections/metros | Get connectivity to network provider by metro +[**get_interconnection_port**](InterconnectionsApi.md#get_interconnection_port) | **GET** /connections/{connection_id}/ports/{id} | Get a interconnection port +[**get_interconnection_pricing**](InterconnectionsApi.md#get_interconnection_pricing) | **GET** /connections/prices | Get Interconnection Pricing +[**get_virtual_circuit**](InterconnectionsApi.md#get_virtual_circuit) | **GET** /virtual-circuits/{id} | Get a virtual circuit +[**list_interconnection_port_virtual_circuits**](InterconnectionsApi.md#list_interconnection_port_virtual_circuits) | **GET** /connections/{connection_id}/ports/{port_id}/virtual-circuits | List a interconnection port's virtual circuits +[**list_interconnection_ports**](InterconnectionsApi.md#list_interconnection_ports) | **GET** /connections/{connection_id}/ports | List a interconnection's ports +[**list_interconnection_virtual_circuits**](InterconnectionsApi.md#list_interconnection_virtual_circuits) | **GET** /connections/{connection_id}/virtual-circuits | List a interconnection's virtual circuits +[**organization_list_interconnections**](InterconnectionsApi.md#organization_list_interconnections) | **GET** /organizations/{organization_id}/connections | List organization connections +[**project_list_interconnections**](InterconnectionsApi.md#project_list_interconnections) | **GET** /projects/{project_id}/connections | List project connections +[**project_list_interconnections_all_pages**](InterconnectionsApi.md#project_list_interconnections_all_pages) | **GET** /projects/{project_id}/connections | List project connections, fetches all the pages +[**update_interconnection**](InterconnectionsApi.md#update_interconnection) | **PUT** /connections/{connection_id} | Update interconnection +[**update_virtual_circuit**](InterconnectionsApi.md#update_virtual_circuit) | **PUT** /virtual-circuits/{id} | Update a virtual circuit + + +# **create_interconnection_port_virtual_circuit** +> VirtualCircuit create_interconnection_port_virtual_circuit(connection_id, port_id, virtual_circuit_create_input) + +Create a new Virtual Circuit + +Create a new Virtual Circuit on a Dedicated Port. To create a regular Virtual Circuit, specify a Virtual Network record and an NNI VLAN value. To create a VRF-based Virtual Circuit, specify the VRF ID and subnet, along with the NNI VLAN value. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.virtual_circuit import VirtualCircuit +from equinix.services.metalv1.models.virtual_circuit_create_input import VirtualCircuitCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + connection_id = 'connection_id_example' # str | UUID of the interconnection + port_id = 'port_id_example' # str | UUID of the interconnection port + virtual_circuit_create_input = equinix.services.metalv1.VirtualCircuitCreateInput() # VirtualCircuitCreateInput | Virtual Circuit details + + try: + # Create a new Virtual Circuit + api_response = api_instance.create_interconnection_port_virtual_circuit(connection_id, port_id, virtual_circuit_create_input) + print("The response of InterconnectionsApi->create_interconnection_port_virtual_circuit:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->create_interconnection_port_virtual_circuit: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection_id** | **str**| UUID of the interconnection | + **port_id** | **str**| UUID of the interconnection port | + **virtual_circuit_create_input** | [**VirtualCircuitCreateInput**](VirtualCircuitCreateInput.md)| Virtual Circuit details | + +### Return type + +[**VirtualCircuit**](VirtualCircuit.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_organization_interconnection** +> Interconnection create_organization_interconnection(organization_id, create_organization_interconnection_request, include=include, exclude=exclude) + +Request a new interconnection for the organization + +Creates a new interconnection request. A Project ID must be specified in the request body for connections on shared ports. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.create_organization_interconnection_request import CreateOrganizationInterconnectionRequest +from equinix.services.metalv1.models.interconnection import Interconnection +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + organization_id = 'organization_id_example' # str | UUID of the organization + create_organization_interconnection_request = equinix.services.metalv1.CreateOrganizationInterconnectionRequest() # CreateOrganizationInterconnectionRequest | Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Request a new interconnection for the organization + api_response = api_instance.create_organization_interconnection(organization_id, create_organization_interconnection_request, include=include, exclude=exclude) + print("The response of InterconnectionsApi->create_organization_interconnection:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->create_organization_interconnection: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **organization_id** | **str**| UUID of the organization | + **create_organization_interconnection_request** | [**CreateOrganizationInterconnectionRequest**](CreateOrganizationInterconnectionRequest.md)| Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Interconnection**](Interconnection.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_project_interconnection** +> Interconnection create_project_interconnection(project_id, create_organization_interconnection_request, include=include, exclude=exclude) + +Request a new interconnection for the project's organization + +Creates a new interconnection request + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.create_organization_interconnection_request import CreateOrganizationInterconnectionRequest +from equinix.services.metalv1.models.interconnection import Interconnection +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + project_id = 'project_id_example' # str | UUID of the project + create_organization_interconnection_request = equinix.services.metalv1.CreateOrganizationInterconnectionRequest() # CreateOrganizationInterconnectionRequest | Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Request a new interconnection for the project's organization + api_response = api_instance.create_project_interconnection(project_id, create_organization_interconnection_request, include=include, exclude=exclude) + print("The response of InterconnectionsApi->create_project_interconnection:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->create_project_interconnection: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| UUID of the project | + **create_organization_interconnection_request** | [**CreateOrganizationInterconnectionRequest**](CreateOrganizationInterconnectionRequest.md)| Dedicated port or shared interconnection (also known as Fabric VC) creation request. Shared interconnections can be created with the following request types: * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Interconnection**](Interconnection.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**403** | forbidden | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_interconnection** +> Interconnection delete_interconnection(connection_id, include=include, exclude=exclude) + +Delete interconnection + +Delete a interconnection, its associated ports and virtual circuits. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.interconnection import Interconnection +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + connection_id = 'connection_id_example' # str | Interconnection UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Delete interconnection + api_response = api_instance.delete_interconnection(connection_id, include=include, exclude=exclude) + print("The response of InterconnectionsApi->delete_interconnection:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->delete_interconnection: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection_id** | **str**| Interconnection UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Interconnection**](Interconnection.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | accepted | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_virtual_circuit** +> VirtualCircuit delete_virtual_circuit(id, include=include, exclude=exclude) + +Delete a virtual circuit + +Delete a virtual circuit from a Dedicated Port. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.virtual_circuit import VirtualCircuit +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + id = 'id_example' # str | Virtual Circuit UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Delete a virtual circuit + api_response = api_instance.delete_virtual_circuit(id, include=include, exclude=exclude) + print("The response of InterconnectionsApi->delete_virtual_circuit:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->delete_virtual_circuit: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Virtual Circuit UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VirtualCircuit**](VirtualCircuit.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | accepted | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_interconnection** +> Interconnection get_interconnection(connection_id, include=include, exclude=exclude) + +Get interconnection + +Get the details of a interconnection + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.interconnection import Interconnection +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + connection_id = 'connection_id_example' # str | Interconnection UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Get interconnection + api_response = api_instance.get_interconnection(connection_id, include=include, exclude=exclude) + print("The response of InterconnectionsApi->get_interconnection:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->get_interconnection: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection_id** | **str**| Interconnection UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Interconnection**](Interconnection.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_interconnection_metros** +> InterconnectionMetroList get_interconnection_metros() + +Get connectivity to network provider by metro + +Displays which providers you can connect to directly from Equinix Metal Metros. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.interconnection_metro_list import InterconnectionMetroList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + + try: + # Get connectivity to network provider by metro + api_response = api_instance.get_interconnection_metros() + print("The response of InterconnectionsApi->get_interconnection_metros:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->get_interconnection_metros: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**InterconnectionMetroList**](InterconnectionMetroList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_interconnection_port** +> InterconnectionPort get_interconnection_port(connection_id, id, include=include, exclude=exclude) + +Get a interconnection port + +Get the details of an interconnection port. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.interconnection_port import InterconnectionPort +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + connection_id = 'connection_id_example' # str | UUID of the interconnection + id = 'id_example' # str | Port UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Get a interconnection port + api_response = api_instance.get_interconnection_port(connection_id, id, include=include, exclude=exclude) + print("The response of InterconnectionsApi->get_interconnection_port:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->get_interconnection_port: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection_id** | **str**| UUID of the interconnection | + **id** | **str**| Port UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**InterconnectionPort**](InterconnectionPort.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_interconnection_pricing** +> InterconnectionPricingList get_interconnection_pricing() + +Get Interconnection Pricing + +Displays pricing information for connecting to networks outside of Equinix. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.interconnection_pricing_list import InterconnectionPricingList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + + try: + # Get Interconnection Pricing + api_response = api_instance.get_interconnection_pricing() + print("The response of InterconnectionsApi->get_interconnection_pricing:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->get_interconnection_pricing: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**InterconnectionPricingList**](InterconnectionPricingList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_virtual_circuit** +> VirtualCircuit get_virtual_circuit(id, include=include, exclude=exclude) + +Get a virtual circuit + +Get the details of a virtual circuit + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.virtual_circuit import VirtualCircuit +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + id = 'id_example' # str | Virtual Circuit UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Get a virtual circuit + api_response = api_instance.get_virtual_circuit(id, include=include, exclude=exclude) + print("The response of InterconnectionsApi->get_virtual_circuit:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->get_virtual_circuit: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Virtual Circuit UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VirtualCircuit**](VirtualCircuit.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_interconnection_port_virtual_circuits** +> VirtualCircuitList list_interconnection_port_virtual_circuits(connection_id, port_id, include=include, exclude=exclude) + +List a interconnection port's virtual circuits + +List the virtual circuit record(s) associatiated with a particular interconnection port. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.virtual_circuit_list import VirtualCircuitList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + connection_id = 'connection_id_example' # str | UUID of the interconnection + port_id = 'port_id_example' # str | UUID of the interconnection port + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # List a interconnection port's virtual circuits + api_response = api_instance.list_interconnection_port_virtual_circuits(connection_id, port_id, include=include, exclude=exclude) + print("The response of InterconnectionsApi->list_interconnection_port_virtual_circuits:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->list_interconnection_port_virtual_circuits: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection_id** | **str**| UUID of the interconnection | + **port_id** | **str**| UUID of the interconnection port | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VirtualCircuitList**](VirtualCircuitList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_interconnection_ports** +> InterconnectionPortList list_interconnection_ports(connection_id) + +List a interconnection's ports + +List the ports associated to an interconnection. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.interconnection_port_list import InterconnectionPortList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + connection_id = 'connection_id_example' # str | UUID of the interconnection + + try: + # List a interconnection's ports + api_response = api_instance.list_interconnection_ports(connection_id) + print("The response of InterconnectionsApi->list_interconnection_ports:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->list_interconnection_ports: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection_id** | **str**| UUID of the interconnection | + +### Return type + +[**InterconnectionPortList**](InterconnectionPortList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_interconnection_virtual_circuits** +> VirtualCircuitList list_interconnection_virtual_circuits(connection_id) + +List a interconnection's virtual circuits + +List the virtual circuit record(s) associated with a particular interconnection id. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.virtual_circuit_list import VirtualCircuitList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + connection_id = 'connection_id_example' # str | UUID of the interconnection + + try: + # List a interconnection's virtual circuits + api_response = api_instance.list_interconnection_virtual_circuits(connection_id) + print("The response of InterconnectionsApi->list_interconnection_virtual_circuits:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->list_interconnection_virtual_circuits: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection_id** | **str**| UUID of the interconnection | + +### Return type + +[**VirtualCircuitList**](VirtualCircuitList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **organization_list_interconnections** +> InterconnectionList organization_list_interconnections(organization_id, include=include, exclude=exclude) + +List organization connections + +List the connections belonging to the organization + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.interconnection_list import InterconnectionList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + organization_id = 'organization_id_example' # str | UUID of the organization + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # List organization connections + api_response = api_instance.organization_list_interconnections(organization_id, include=include, exclude=exclude) + print("The response of InterconnectionsApi->organization_list_interconnections:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->organization_list_interconnections: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **organization_id** | **str**| UUID of the organization | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**InterconnectionList**](InterconnectionList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **project_list_interconnections** +> InterconnectionList project_list_interconnections(project_id, include=include, exclude=exclude, page=page, per_page=per_page) + +List project connections + +List the connections belonging to the project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.interconnection_list import InterconnectionList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + project_id = 'project_id_example' # str | UUID of the project + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # List project connections + api_response = api_instance.project_list_interconnections(project_id, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of InterconnectionsApi->project_list_interconnections:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->project_list_interconnections: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| UUID of the project | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**InterconnectionList**](InterconnectionList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **project_list_interconnections_all_pages** +> InterconnectionList project_list_interconnections_all_pages(project_id, include=include, exclude=exclude, per_page=per_page) +Just like [**project_list_interconnections**](InterconnectionsApi.md#project_list_interconnections) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**project_list_interconnections**](InterconnectionsApi.md#project_list_interconnections). +# **update_interconnection** +> Interconnection update_interconnection(connection_id, interconnection_update_input, include=include, exclude=exclude) + +Update interconnection + +Update the details of a interconnection + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.interconnection import Interconnection +from equinix.services.metalv1.models.interconnection_update_input import InterconnectionUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + connection_id = 'connection_id_example' # str | Interconnection UUID + interconnection_update_input = equinix.services.metalv1.InterconnectionUpdateInput() # InterconnectionUpdateInput | Updated interconnection details + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Update interconnection + api_response = api_instance.update_interconnection(connection_id, interconnection_update_input, include=include, exclude=exclude) + print("The response of InterconnectionsApi->update_interconnection:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->update_interconnection: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connection_id** | **str**| Interconnection UUID | + **interconnection_update_input** | [**InterconnectionUpdateInput**](InterconnectionUpdateInput.md)| Updated interconnection details | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Interconnection**](Interconnection.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_virtual_circuit** +> VirtualCircuit update_virtual_circuit(id, virtual_circuit_update_input, include=include, exclude=exclude) + +Update a virtual circuit + +Update the details of a virtual circuit. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.virtual_circuit import VirtualCircuit +from equinix.services.metalv1.models.virtual_circuit_update_input import VirtualCircuitUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InterconnectionsApi(api_client) + id = 'id_example' # str | Virtual Circuit UUID + virtual_circuit_update_input = equinix.services.metalv1.VirtualCircuitUpdateInput() # VirtualCircuitUpdateInput | Updated Virtual Circuit details + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Update a virtual circuit + api_response = api_instance.update_virtual_circuit(id, virtual_circuit_update_input, include=include, exclude=exclude) + print("The response of InterconnectionsApi->update_virtual_circuit:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InterconnectionsApi->update_virtual_circuit: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Virtual Circuit UUID | + **virtual_circuit_update_input** | [**VirtualCircuitUpdateInput**](VirtualCircuitUpdateInput.md)| Updated Virtual Circuit details | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VirtualCircuit**](VirtualCircuit.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**202** | accepted | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Invitation.md b/equinix/services/metalv1/docs/Invitation.md new file mode 100644 index 00000000..6bca5109 --- /dev/null +++ b/equinix/services/metalv1/docs/Invitation.md @@ -0,0 +1,39 @@ +# Invitation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**invitation** | [**Href**](Href.md) | | [optional] +**invited_by** | [**Href**](Href.md) | | [optional] +**invitee** | **str** | | [optional] +**nonce** | **str** | | [optional] +**organization** | [**Href**](Href.md) | | [optional] +**projects** | [**List[Href]**](Href.md) | | [optional] +**roles** | **List[str]** | | [optional] +**updated_at** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.invitation import Invitation + +# TODO update the JSON string below +json = "{}" +# create an instance of Invitation from a JSON string +invitation_instance = Invitation.from_json(json) +# print the JSON string representation of the object +print(Invitation.to_json()) + +# convert the object into a dict +invitation_dict = invitation_instance.to_dict() +# create an instance of Invitation from a dict +invitation_form_dict = invitation.from_dict(invitation_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/InvitationInput.md b/equinix/services/metalv1/docs/InvitationInput.md new file mode 100644 index 00000000..7c94d74d --- /dev/null +++ b/equinix/services/metalv1/docs/InvitationInput.md @@ -0,0 +1,34 @@ +# InvitationInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**invitee** | **str** | | +**message** | **str** | | [optional] +**organization_id** | **str** | | [optional] +**projects_ids** | **List[str]** | | [optional] +**roles** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.invitation_input import InvitationInput + +# TODO update the JSON string below +json = "{}" +# create an instance of InvitationInput from a JSON string +invitation_input_instance = InvitationInput.from_json(json) +# print the JSON string representation of the object +print(InvitationInput.to_json()) + +# convert the object into a dict +invitation_input_dict = invitation_input_instance.to_dict() +# create an instance of InvitationInput from a dict +invitation_input_form_dict = invitation_input.from_dict(invitation_input_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/InvitationList.md b/equinix/services/metalv1/docs/InvitationList.md new file mode 100644 index 00000000..7d1121bd --- /dev/null +++ b/equinix/services/metalv1/docs/InvitationList.md @@ -0,0 +1,30 @@ +# InvitationList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**invitations** | [**List[Membership]**](Membership.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.invitation_list import InvitationList + +# TODO update the JSON string below +json = "{}" +# create an instance of InvitationList from a JSON string +invitation_list_instance = InvitationList.from_json(json) +# print the JSON string representation of the object +print(InvitationList.to_json()) + +# convert the object into a dict +invitation_list_dict = invitation_list_instance.to_dict() +# create an instance of InvitationList from a dict +invitation_list_form_dict = invitation_list.from_dict(invitation_list_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/InvitationsApi.md b/equinix/services/metalv1/docs/InvitationsApi.md new file mode 100644 index 00000000..ffc25f41 --- /dev/null +++ b/equinix/services/metalv1/docs/InvitationsApi.md @@ -0,0 +1,255 @@ +# equinix.services.metalv1.InvitationsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**accept_invitation**](InvitationsApi.md#accept_invitation) | **PUT** /invitations/{id} | Accept an invitation +[**decline_invitation**](InvitationsApi.md#decline_invitation) | **DELETE** /invitations/{id} | Decline an invitation +[**find_invitation_by_id**](InvitationsApi.md#find_invitation_by_id) | **GET** /invitations/{id} | View an invitation + + +# **accept_invitation** +> Membership accept_invitation(id, include=include) + +Accept an invitation + +Accept an invitation. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.membership import Membership +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InvitationsApi(api_client) + id = 'id_example' # str | Invitation UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Accept an invitation + api_response = api_instance.accept_invitation(id, include=include) + print("The response of InvitationsApi->accept_invitation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InvitationsApi->accept_invitation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Invitation UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Membership**](Membership.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **decline_invitation** +> decline_invitation(id) + +Decline an invitation + +Decline an invitation. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InvitationsApi(api_client) + id = 'id_example' # str | Invitation UUID + + try: + # Decline an invitation + api_instance.decline_invitation(id) + except Exception as e: + print("Exception when calling InvitationsApi->decline_invitation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Invitation UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_invitation_by_id** +> Invitation find_invitation_by_id(id, include=include) + +View an invitation + +Returns a single invitation. (It include the `invitable` to maintain backward compatibility but will be removed soon) + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.invitation import Invitation +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InvitationsApi(api_client) + id = 'id_example' # str | Invitation UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # View an invitation + api_response = api_instance.find_invitation_by_id(id, include=include) + print("The response of InvitationsApi->find_invitation_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InvitationsApi->find_invitation_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Invitation UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Invitation**](Invitation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Invoice.md b/equinix/services/metalv1/docs/Invoice.md new file mode 100644 index 00000000..4aaf17f1 --- /dev/null +++ b/equinix/services/metalv1/docs/Invoice.md @@ -0,0 +1,43 @@ +# Invoice + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | | [optional] +**balance** | **float** | | [optional] +**created_on** | **date** | | [optional] +**credit_amount** | **float** | | [optional] +**credits_applied** | **float** | | [optional] +**currency** | **str** | | [optional] +**due_on** | **date** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**items** | [**List[LineItem]**](LineItem.md) | | [optional] +**number** | **str** | | [optional] +**project** | [**ProjectIdName**](ProjectIdName.md) | | [optional] +**reference_number** | **str** | | [optional] +**status** | **str** | | [optional] +**target_date** | **date** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.invoice import Invoice + +# TODO update the JSON string below +json = "{}" +# create an instance of Invoice from a JSON string +invoice_instance = Invoice.from_json(json) +# print the JSON string representation of the object +print(Invoice.to_json()) + +# convert the object into a dict +invoice_dict = invoice_instance.to_dict() +# create an instance of Invoice from a dict +invoice_form_dict = invoice.from_dict(invoice_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/InvoiceList.md b/equinix/services/metalv1/docs/InvoiceList.md new file mode 100644 index 00000000..cd08a0bf --- /dev/null +++ b/equinix/services/metalv1/docs/InvoiceList.md @@ -0,0 +1,30 @@ +# InvoiceList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**invoices** | [**List[Invoice]**](Invoice.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.invoice_list import InvoiceList + +# TODO update the JSON string below +json = "{}" +# create an instance of InvoiceList from a JSON string +invoice_list_instance = InvoiceList.from_json(json) +# print the JSON string representation of the object +print(InvoiceList.to_json()) + +# convert the object into a dict +invoice_list_dict = invoice_list_instance.to_dict() +# create an instance of InvoiceList from a dict +invoice_list_form_dict = invoice_list.from_dict(invoice_list_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/InvoicesApi.md b/equinix/services/metalv1/docs/InvoicesApi.md new file mode 100644 index 00000000..5b5be7dd --- /dev/null +++ b/equinix/services/metalv1/docs/InvoicesApi.md @@ -0,0 +1,176 @@ +# equinix.services.metalv1.InvoicesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_organization_invoices**](InvoicesApi.md#find_organization_invoices) | **GET** /organizations/{id}/invoices | Retrieve all invoices for an organization +[**get_invoice_by_id**](InvoicesApi.md#get_invoice_by_id) | **GET** /invoices/{id} | Retrieve an invoice + + +# **find_organization_invoices** +> InvoiceList find_organization_invoices(id, page=page, per_page=per_page, status=status) + +Retrieve all invoices for an organization + +Returns all invoices for an organization + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.invoice_list import InvoiceList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InvoicesApi(api_client) + id = 'id_example' # str | Organization UUID + page = 56 # int | page number (optional) + per_page = 56 # int | per page (optional) + status = 'status_example' # str | filter by status (optional) + + try: + # Retrieve all invoices for an organization + api_response = api_instance.find_organization_invoices(id, page=page, per_page=per_page, status=status) + print("The response of InvoicesApi->find_organization_invoices:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InvoicesApi->find_organization_invoices: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **page** | **int**| page number | [optional] + **per_page** | **int**| per page | [optional] + **status** | **str**| filter by status | [optional] + +### Return type + +[**InvoiceList**](InvoiceList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_invoice_by_id** +> Invoice get_invoice_by_id(id) + +Retrieve an invoice + +Returns the invoice identified by the provided id + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.invoice import Invoice +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.InvoicesApi(api_client) + id = 'id_example' # str | Invoice UUID + + try: + # Retrieve an invoice + api_response = api_instance.get_invoice_by_id(id) + print("The response of InvoicesApi->get_invoice_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InvoicesApi->get_invoice_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Invoice UUID | + +### Return type + +[**Invoice**](Invoice.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/License.md b/equinix/services/metalv1/docs/License.md new file mode 100644 index 00000000..407ca5d1 --- /dev/null +++ b/equinix/services/metalv1/docs/License.md @@ -0,0 +1,35 @@ +# License + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**license_key** | **str** | | [optional] +**licensee_product** | [**Href**](Href.md) | | [optional] +**project** | [**Href**](Href.md) | | [optional] +**size** | **float** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.license import License + +# TODO update the JSON string below +json = "{}" +# create an instance of License from a JSON string +license_instance = License.from_json(json) +# print the JSON string representation of the object +print(License.to_json()) + +# convert the object into a dict +license_dict = license_instance.to_dict() +# create an instance of License from a dict +license_form_dict = license.from_dict(license_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/LicenseCreateInput.md b/equinix/services/metalv1/docs/LicenseCreateInput.md new file mode 100644 index 00000000..f8a7435b --- /dev/null +++ b/equinix/services/metalv1/docs/LicenseCreateInput.md @@ -0,0 +1,32 @@ +# LicenseCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**licensee_product_id** | **str** | | [optional] +**size** | **float** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.license_create_input import LicenseCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of LicenseCreateInput from a JSON string +license_create_input_instance = LicenseCreateInput.from_json(json) +# print the JSON string representation of the object +print(LicenseCreateInput.to_json()) + +# convert the object into a dict +license_create_input_dict = license_create_input_instance.to_dict() +# create an instance of LicenseCreateInput from a dict +license_create_input_form_dict = license_create_input.from_dict(license_create_input_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/LicenseList.md b/equinix/services/metalv1/docs/LicenseList.md new file mode 100644 index 00000000..2f616a49 --- /dev/null +++ b/equinix/services/metalv1/docs/LicenseList.md @@ -0,0 +1,30 @@ +# LicenseList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**licenses** | [**List[License]**](License.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.license_list import LicenseList + +# TODO update the JSON string below +json = "{}" +# create an instance of LicenseList from a JSON string +license_list_instance = LicenseList.from_json(json) +# print the JSON string representation of the object +print(LicenseList.to_json()) + +# convert the object into a dict +license_list_dict = license_list_instance.to_dict() +# create an instance of LicenseList from a dict +license_list_form_dict = license_list.from_dict(license_list_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/LicenseUpdateInput.md b/equinix/services/metalv1/docs/LicenseUpdateInput.md new file mode 100644 index 00000000..cf7c1a5f --- /dev/null +++ b/equinix/services/metalv1/docs/LicenseUpdateInput.md @@ -0,0 +1,31 @@ +# LicenseUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**size** | **float** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.license_update_input import LicenseUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of LicenseUpdateInput from a JSON string +license_update_input_instance = LicenseUpdateInput.from_json(json) +# print the JSON string representation of the object +print(LicenseUpdateInput.to_json()) + +# convert the object into a dict +license_update_input_dict = license_update_input_instance.to_dict() +# create an instance of LicenseUpdateInput from a dict +license_update_input_form_dict = license_update_input.from_dict(license_update_input_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/LicensesApi.md b/equinix/services/metalv1/docs/LicensesApi.md new file mode 100644 index 00000000..0dc249b0 --- /dev/null +++ b/equinix/services/metalv1/docs/LicensesApi.md @@ -0,0 +1,443 @@ +# equinix.services.metalv1.LicensesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_license**](LicensesApi.md#create_license) | **POST** /projects/{id}/licenses | Create a License +[**delete_license**](LicensesApi.md#delete_license) | **DELETE** /licenses/{id} | Delete the license +[**find_license_by_id**](LicensesApi.md#find_license_by_id) | **GET** /licenses/{id} | Retrieve a license +[**find_project_licenses**](LicensesApi.md#find_project_licenses) | **GET** /projects/{id}/licenses | Retrieve all licenses +[**update_license**](LicensesApi.md#update_license) | **PUT** /licenses/{id} | Update the license + + +# **create_license** +> License create_license(id, license_create_input, include=include, exclude=exclude) + +Create a License + +Creates a new license for the given project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.license import License +from equinix.services.metalv1.models.license_create_input import LicenseCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.LicensesApi(api_client) + id = 'id_example' # str | Project UUID + license_create_input = equinix.services.metalv1.LicenseCreateInput() # LicenseCreateInput | License to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create a License + api_response = api_instance.create_license(id, license_create_input, include=include, exclude=exclude) + print("The response of LicensesApi->create_license:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LicensesApi->create_license: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **license_create_input** | [**LicenseCreateInput**](LicenseCreateInput.md)| License to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**License**](License.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_license** +> delete_license(id) + +Delete the license + +Deletes a license. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.LicensesApi(api_client) + id = 'id_example' # str | License UUID + + try: + # Delete the license + api_instance.delete_license(id) + except Exception as e: + print("Exception when calling LicensesApi->delete_license: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| License UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_license_by_id** +> License find_license_by_id(id, include=include, exclude=exclude) + +Retrieve a license + +Returns a license + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.license import License +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.LicensesApi(api_client) + id = 'id_example' # str | License UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve a license + api_response = api_instance.find_license_by_id(id, include=include, exclude=exclude) + print("The response of LicensesApi->find_license_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LicensesApi->find_license_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| License UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**License**](License.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_licenses** +> LicenseList find_project_licenses(id, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve all licenses + +Provides a collection of licenses for a given project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.license_list import LicenseList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.LicensesApi(api_client) + id = 'id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve all licenses + api_response = api_instance.find_project_licenses(id, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of LicensesApi->find_project_licenses:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LicensesApi->find_project_licenses: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**LicenseList**](LicenseList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_license** +> License update_license(id, license_update_input, include=include, exclude=exclude) + +Update the license + +Updates the license. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.license import License +from equinix.services.metalv1.models.license_update_input import LicenseUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.LicensesApi(api_client) + id = 'id_example' # str | License UUID + license_update_input = equinix.services.metalv1.LicenseUpdateInput() # LicenseUpdateInput | License to update + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Update the license + api_response = api_instance.update_license(id, license_update_input, include=include, exclude=exclude) + print("The response of LicensesApi->update_license:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LicensesApi->update_license: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| License UUID | + **license_update_input** | [**LicenseUpdateInput**](LicenseUpdateInput.md)| License to update | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**License**](License.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/LineItem.md b/equinix/services/metalv1/docs/LineItem.md new file mode 100644 index 00000000..941f8555 --- /dev/null +++ b/equinix/services/metalv1/docs/LineItem.md @@ -0,0 +1,46 @@ +# LineItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**adjustments** | [**List[LineItemAdjustment]**](LineItemAdjustment.md) | Adjustments for the line item | [optional] +**amount** | **float** | | [optional] +**currency** | **str** | | [optional] +**description** | **str** | | [optional] +**details** | **str** | | [optional] +**end_date** | **date** | | [optional] +**hostname** | **str** | | [optional] +**href** | **str** | | [optional] +**item_type** | **str** | | [optional] +**location** | **str** | | [optional] +**plan** | [**PlanIdName**](PlanIdName.md) | | [optional] +**plan_id** | **str** | | [optional] +**project** | [**ProjectIdName**](ProjectIdName.md) | | [optional] +**project_id** | **str** | | [optional] +**service_id** | **str** | | [optional] +**start_date** | **date** | | [optional] +**unit** | **str** | | [optional] +**unit_price** | **float** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.line_item import LineItem + +# TODO update the JSON string below +json = "{}" +# create an instance of LineItem from a JSON string +line_item_instance = LineItem.from_json(json) +# print the JSON string representation of the object +print(LineItem.to_json()) + +# convert the object into a dict +line_item_dict = line_item_instance.to_dict() +# create an instance of LineItem from a dict +line_item_form_dict = line_item.from_dict(line_item_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/LineItemAdjustment.md b/equinix/services/metalv1/docs/LineItemAdjustment.md new file mode 100644 index 00000000..e1e2a09b --- /dev/null +++ b/equinix/services/metalv1/docs/LineItemAdjustment.md @@ -0,0 +1,31 @@ +# LineItemAdjustment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.line_item_adjustment import LineItemAdjustment + +# TODO update the JSON string below +json = "{}" +# create an instance of LineItemAdjustment from a JSON string +line_item_adjustment_instance = LineItemAdjustment.from_json(json) +# print the JSON string representation of the object +print(LineItemAdjustment.to_json()) + +# convert the object into a dict +line_item_adjustment_dict = line_item_adjustment_instance.to_dict() +# create an instance of LineItemAdjustment from a dict +line_item_adjustment_form_dict = line_item_adjustment.from_dict(line_item_adjustment_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/Membership.md b/equinix/services/metalv1/docs/Membership.md new file mode 100644 index 00000000..edf03846 --- /dev/null +++ b/equinix/services/metalv1/docs/Membership.md @@ -0,0 +1,35 @@ +# Membership + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**project** | [**Href**](Href.md) | | [optional] +**roles** | **List[str]** | | [optional] +**updated_at** | **datetime** | | [optional] +**user** | [**Href**](Href.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.membership import Membership + +# TODO update the JSON string below +json = "{}" +# create an instance of Membership from a JSON string +membership_instance = Membership.from_json(json) +# print the JSON string representation of the object +print(Membership.to_json()) + +# convert the object into a dict +membership_dict = membership_instance.to_dict() +# create an instance of Membership from a dict +membership_form_dict = membership.from_dict(membership_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/MembershipInput.md b/equinix/services/metalv1/docs/MembershipInput.md new file mode 100644 index 00000000..6da8c3c5 --- /dev/null +++ b/equinix/services/metalv1/docs/MembershipInput.md @@ -0,0 +1,30 @@ +# MembershipInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**role** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.membership_input import MembershipInput + +# TODO update the JSON string below +json = "{}" +# create an instance of MembershipInput from a JSON string +membership_input_instance = MembershipInput.from_json(json) +# print the JSON string representation of the object +print(MembershipInput.to_json()) + +# convert the object into a dict +membership_input_dict = membership_input_instance.to_dict() +# create an instance of MembershipInput from a dict +membership_input_form_dict = membership_input.from_dict(membership_input_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/MembershipList.md b/equinix/services/metalv1/docs/MembershipList.md new file mode 100644 index 00000000..5ef3c573 --- /dev/null +++ b/equinix/services/metalv1/docs/MembershipList.md @@ -0,0 +1,30 @@ +# MembershipList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**memberships** | [**List[Membership]**](Membership.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.membership_list import MembershipList + +# TODO update the JSON string below +json = "{}" +# create an instance of MembershipList from a JSON string +membership_list_instance = MembershipList.from_json(json) +# print the JSON string representation of the object +print(MembershipList.to_json()) + +# convert the object into a dict +membership_list_dict = membership_list_instance.to_dict() +# create an instance of MembershipList from a dict +membership_list_form_dict = membership_list.from_dict(membership_list_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/MembershipsApi.md b/equinix/services/metalv1/docs/MembershipsApi.md new file mode 100644 index 00000000..c45a3a5c --- /dev/null +++ b/equinix/services/metalv1/docs/MembershipsApi.md @@ -0,0 +1,259 @@ +# equinix.services.metalv1.MembershipsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_membership**](MembershipsApi.md#delete_membership) | **DELETE** /memberships/{id} | Delete the membership +[**find_membership_by_id**](MembershipsApi.md#find_membership_by_id) | **GET** /memberships/{id} | Retrieve a membership +[**update_membership**](MembershipsApi.md#update_membership) | **PUT** /memberships/{id} | Update the membership + + +# **delete_membership** +> delete_membership(id) + +Delete the membership + +Deletes the membership. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MembershipsApi(api_client) + id = 'id_example' # str | Membership UUID + + try: + # Delete the membership + api_instance.delete_membership(id) + except Exception as e: + print("Exception when calling MembershipsApi->delete_membership: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Membership UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_membership_by_id** +> Membership find_membership_by_id(id, include=include) + +Retrieve a membership + +Returns a single membership. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.membership import Membership +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MembershipsApi(api_client) + id = 'id_example' # str | Membership UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a membership + api_response = api_instance.find_membership_by_id(id, include=include) + print("The response of MembershipsApi->find_membership_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MembershipsApi->find_membership_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Membership UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Membership**](Membership.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_membership** +> Membership update_membership(id, membership_input, include=include) + +Update the membership + +Updates the membership. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.membership import Membership +from equinix.services.metalv1.models.membership_input import MembershipInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MembershipsApi(api_client) + id = 'id_example' # str | Membership UUID + membership_input = equinix.services.metalv1.MembershipInput() # MembershipInput | Membership to update + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Update the membership + api_response = api_instance.update_membership(id, membership_input, include=include) + print("The response of MembershipsApi->update_membership:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MembershipsApi->update_membership: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Membership UUID | + **membership_input** | [**MembershipInput**](MembershipInput.md)| Membership to update | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Membership**](Membership.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Meta.md b/equinix/services/metalv1/docs/Meta.md new file mode 100644 index 00000000..ecdd7c6b --- /dev/null +++ b/equinix/services/metalv1/docs/Meta.md @@ -0,0 +1,37 @@ +# Meta + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**current_page** | **int** | | [optional] +**first** | [**Href**](Href.md) | | [optional] +**href** | **str** | | [optional] +**last** | [**Href**](Href.md) | | [optional] +**last_page** | **int** | | [optional] +**next** | [**Href**](Href.md) | | [optional] +**previous** | [**Href**](Href.md) | | [optional] +**var_self** | [**Href**](Href.md) | | [optional] +**total** | **int** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.meta import Meta + +# TODO update the JSON string below +json = "{}" +# create an instance of Meta from a JSON string +meta_instance = Meta.from_json(json) +# print the JSON string representation of the object +print(Meta.to_json()) + +# convert the object into a dict +meta_dict = meta_instance.to_dict() +# create an instance of Meta from a dict +meta_form_dict = meta.from_dict(meta_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/Metadata.md b/equinix/services/metalv1/docs/Metadata.md new file mode 100644 index 00000000..74a1f034 --- /dev/null +++ b/equinix/services/metalv1/docs/Metadata.md @@ -0,0 +1,47 @@ +# Metadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_class** | **str** | | [optional] +**customdata** | **Dict[str, object]** | | [optional] +**facility** | **str** | The facility code of the instance | [optional] +**hostname** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**iqn** | **str** | | [optional] +**metro** | **str** | The metro code of the instance | [optional] +**network** | [**MetadataNetwork**](MetadataNetwork.md) | | [optional] +**operating_system** | **object** | | [optional] +**plan** | **str** | The plan slug of the instance | [optional] +**private_subnets** | **List[str]** | An array of the private subnets | [optional] +**reserved** | **bool** | | [optional] +**specs** | **object** | The specs of the plan version of the instance | [optional] +**ssh_keys** | **List[str]** | | [optional] +**state** | **str** | The current state the instance is in. * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. * Once provisioning has begun on the instance it's state will move to `provisioning`. * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. * If an instance fails to provision or deprovision it will move to `failed` state. * Once an instance has completed provisioning it will move to `active` state. * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. * When the instance is powered off completely it will move to the `inactive` state. * When an instance is powered on completely it will move to the `active` state. * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. * When the reinstall action is complete the instance will move to `active` state. | [optional] +**switch_short_id** | **str** | | [optional] +**tags** | **List[str]** | | [optional] +**volumes** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.metadata import Metadata + +# TODO update the JSON string below +json = "{}" +# create an instance of Metadata from a JSON string +metadata_instance = Metadata.from_json(json) +# print the JSON string representation of the object +print(Metadata.to_json()) + +# convert the object into a dict +metadata_dict = metadata_instance.to_dict() +# create an instance of Metadata from a dict +metadata_form_dict = metadata.from_dict(metadata_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/MetadataNetwork.md b/equinix/services/metalv1/docs/MetadataNetwork.md new file mode 100644 index 00000000..5df6b397 --- /dev/null +++ b/equinix/services/metalv1/docs/MetadataNetwork.md @@ -0,0 +1,32 @@ +# MetadataNetwork + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addresses** | **List[str]** | | [optional] +**href** | **str** | | [optional] +**interfaces** | **List[object]** | | [optional] +**network** | [**MetadataNetworkNetwork**](MetadataNetworkNetwork.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.metadata_network import MetadataNetwork + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataNetwork from a JSON string +metadata_network_instance = MetadataNetwork.from_json(json) +# print the JSON string representation of the object +print(MetadataNetwork.to_json()) + +# convert the object into a dict +metadata_network_dict = metadata_network_instance.to_dict() +# create an instance of MetadataNetwork from a dict +metadata_network_form_dict = metadata_network.from_dict(metadata_network_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/MetadataNetworkNetwork.md b/equinix/services/metalv1/docs/MetadataNetworkNetwork.md new file mode 100644 index 00000000..4a2b5379 --- /dev/null +++ b/equinix/services/metalv1/docs/MetadataNetworkNetwork.md @@ -0,0 +1,30 @@ +# MetadataNetworkNetwork + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bonding** | [**MetadataNetworkNetworkBonding**](MetadataNetworkNetworkBonding.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.metadata_network_network import MetadataNetworkNetwork + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataNetworkNetwork from a JSON string +metadata_network_network_instance = MetadataNetworkNetwork.from_json(json) +# print the JSON string representation of the object +print(MetadataNetworkNetwork.to_json()) + +# convert the object into a dict +metadata_network_network_dict = metadata_network_network_instance.to_dict() +# create an instance of MetadataNetworkNetwork from a dict +metadata_network_network_form_dict = metadata_network_network.from_dict(metadata_network_network_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/MetadataNetworkNetworkBonding.md b/equinix/services/metalv1/docs/MetadataNetworkNetworkBonding.md new file mode 100644 index 00000000..50456ecd --- /dev/null +++ b/equinix/services/metalv1/docs/MetadataNetworkNetworkBonding.md @@ -0,0 +1,32 @@ +# MetadataNetworkNetworkBonding + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**link_aggregation** | **str** | | [optional] +**mac** | **str** | | [optional] +**mode** | **int** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.metadata_network_network_bonding import MetadataNetworkNetworkBonding + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataNetworkNetworkBonding from a JSON string +metadata_network_network_bonding_instance = MetadataNetworkNetworkBonding.from_json(json) +# print the JSON string representation of the object +print(MetadataNetworkNetworkBonding.to_json()) + +# convert the object into a dict +metadata_network_network_bonding_dict = metadata_network_network_bonding_instance.to_dict() +# create an instance of MetadataNetworkNetworkBonding from a dict +metadata_network_network_bonding_form_dict = metadata_network_network_bonding.from_dict(metadata_network_network_bonding_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/MetalGateway.md b/equinix/services/metalv1/docs/MetalGateway.md new file mode 100644 index 00000000..6eb15b09 --- /dev/null +++ b/equinix/services/metalv1/docs/MetalGateway.md @@ -0,0 +1,37 @@ +# MetalGateway + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**created_by** | [**Href**](Href.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**ip_reservation** | [**IPReservation**](IPReservation.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**state** | **str** | The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. | [optional] +**updated_at** | **datetime** | | [optional] +**virtual_network** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.metal_gateway import MetalGateway + +# TODO update the JSON string below +json = "{}" +# create an instance of MetalGateway from a JSON string +metal_gateway_instance = MetalGateway.from_json(json) +# print the JSON string representation of the object +print(MetalGateway.to_json()) + +# convert the object into a dict +metal_gateway_dict = metal_gateway_instance.to_dict() +# create an instance of MetalGateway from a dict +metal_gateway_form_dict = metal_gateway.from_dict(metal_gateway_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/MetalGatewayCreateInput.md b/equinix/services/metalv1/docs/MetalGatewayCreateInput.md new file mode 100644 index 00000000..caecb4b7 --- /dev/null +++ b/equinix/services/metalv1/docs/MetalGatewayCreateInput.md @@ -0,0 +1,32 @@ +# MetalGatewayCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**ip_reservation_id** | **str** | The UUID of an IP reservation that belongs to the same project as where the metal gateway will be created in. This field is required unless the private IPv4 subnet size is specified. | [optional] +**private_ipv4_subnet_size** | **int** | The subnet size (8, 16, 32, 64, or 128) of the private IPv4 reservation that will be created for the metal gateway. This field is required unless a project IP reservation was specified. Please keep in mind that the number of private metal gateway ranges are limited per project. If you would like to increase the limit per project, please contact support for assistance. | [optional] +**virtual_network_id** | **str** | The UUID of a metro virtual network that belongs to the same project as where the metal gateway will be created in. | + +## Example + +```python +from equinix.services.metalv1.models.metal_gateway_create_input import MetalGatewayCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of MetalGatewayCreateInput from a JSON string +metal_gateway_create_input_instance = MetalGatewayCreateInput.from_json(json) +# print the JSON string representation of the object +print(MetalGatewayCreateInput.to_json()) + +# convert the object into a dict +metal_gateway_create_input_dict = metal_gateway_create_input_instance.to_dict() +# create an instance of MetalGatewayCreateInput from a dict +metal_gateway_create_input_form_dict = metal_gateway_create_input.from_dict(metal_gateway_create_input_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/MetalGatewayElasticIpCreateInput.md b/equinix/services/metalv1/docs/MetalGatewayElasticIpCreateInput.md new file mode 100644 index 00000000..1c165e70 --- /dev/null +++ b/equinix/services/metalv1/docs/MetalGatewayElasticIpCreateInput.md @@ -0,0 +1,33 @@ +# MetalGatewayElasticIpCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | An IP address (or IP Address range) contained within one of the project's IP Reservations | +**customdata** | **Dict[str, object]** | Optional User-defined JSON object value. | [optional] +**href** | **str** | | [optional] +**next_hop** | **str** | An IP address contained within the Metal Gateways' IP Reservation range. | +**tags** | **List[str]** | Optional list of User-defined tags. Can be used by users to provide additional details or context regarding the purpose or usage of this resource. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.metal_gateway_elastic_ip_create_input import MetalGatewayElasticIpCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of MetalGatewayElasticIpCreateInput from a JSON string +metal_gateway_elastic_ip_create_input_instance = MetalGatewayElasticIpCreateInput.from_json(json) +# print the JSON string representation of the object +print(MetalGatewayElasticIpCreateInput.to_json()) + +# convert the object into a dict +metal_gateway_elastic_ip_create_input_dict = metal_gateway_elastic_ip_create_input_instance.to_dict() +# create an instance of MetalGatewayElasticIpCreateInput from a dict +metal_gateway_elastic_ip_create_input_form_dict = metal_gateway_elastic_ip_create_input.from_dict(metal_gateway_elastic_ip_create_input_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/MetalGatewayList.md b/equinix/services/metalv1/docs/MetalGatewayList.md new file mode 100644 index 00000000..fe826cc0 --- /dev/null +++ b/equinix/services/metalv1/docs/MetalGatewayList.md @@ -0,0 +1,31 @@ +# MetalGatewayList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] +**metal_gateways** | [**List[MetalGatewayListMetalGatewaysInner]**](MetalGatewayListMetalGatewaysInner.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.metal_gateway_list import MetalGatewayList + +# TODO update the JSON string below +json = "{}" +# create an instance of MetalGatewayList from a JSON string +metal_gateway_list_instance = MetalGatewayList.from_json(json) +# print the JSON string representation of the object +print(MetalGatewayList.to_json()) + +# convert the object into a dict +metal_gateway_list_dict = metal_gateway_list_instance.to_dict() +# create an instance of MetalGatewayList from a dict +metal_gateway_list_form_dict = metal_gateway_list.from_dict(metal_gateway_list_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/MetalGatewayListMetalGatewaysInner.md b/equinix/services/metalv1/docs/MetalGatewayListMetalGatewaysInner.md new file mode 100644 index 00000000..20887211 --- /dev/null +++ b/equinix/services/metalv1/docs/MetalGatewayListMetalGatewaysInner.md @@ -0,0 +1,38 @@ +# MetalGatewayListMetalGatewaysInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**created_by** | [**Href**](Href.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**ip_reservation** | [**VrfIpReservation**](VrfIpReservation.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**state** | **str** | The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. | [optional] +**updated_at** | **datetime** | | [optional] +**virtual_network** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] +**vrf** | [**Vrf**](Vrf.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.metal_gateway_list_metal_gateways_inner import MetalGatewayListMetalGatewaysInner + +# TODO update the JSON string below +json = "{}" +# create an instance of MetalGatewayListMetalGatewaysInner from a JSON string +metal_gateway_list_metal_gateways_inner_instance = MetalGatewayListMetalGatewaysInner.from_json(json) +# print the JSON string representation of the object +print(MetalGatewayListMetalGatewaysInner.to_json()) + +# convert the object into a dict +metal_gateway_list_metal_gateways_inner_dict = metal_gateway_list_metal_gateways_inner_instance.to_dict() +# create an instance of MetalGatewayListMetalGatewaysInner from a dict +metal_gateway_list_metal_gateways_inner_form_dict = metal_gateway_list_metal_gateways_inner.from_dict(metal_gateway_list_metal_gateways_inner_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/MetalGatewayLite.md b/equinix/services/metalv1/docs/MetalGatewayLite.md new file mode 100644 index 00000000..9f551566 --- /dev/null +++ b/equinix/services/metalv1/docs/MetalGatewayLite.md @@ -0,0 +1,35 @@ +# MetalGatewayLite + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**gateway_address** | **str** | The gateway address with subnet CIDR value for this Metal Gateway. For example, a Metal Gateway using an IP reservation with block 10.1.2.0/27 would have a gateway address of 10.1.2.1/27. | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**state** | **str** | The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. | [optional] +**updated_at** | **datetime** | | [optional] +**vlan** | **int** | The VLAN id of the Virtual Network record associated to this Metal Gateway. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.metal_gateway_lite import MetalGatewayLite + +# TODO update the JSON string below +json = "{}" +# create an instance of MetalGatewayLite from a JSON string +metal_gateway_lite_instance = MetalGatewayLite.from_json(json) +# print the JSON string representation of the object +print(MetalGatewayLite.to_json()) + +# convert the object into a dict +metal_gateway_lite_dict = metal_gateway_lite_instance.to_dict() +# create an instance of MetalGatewayLite from a dict +metal_gateway_lite_form_dict = metal_gateway_lite.from_dict(metal_gateway_lite_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/MetalGatewaysApi.md b/equinix/services/metalv1/docs/MetalGatewaysApi.md new file mode 100644 index 00000000..978e6b8f --- /dev/null +++ b/equinix/services/metalv1/docs/MetalGatewaysApi.md @@ -0,0 +1,714 @@ +# equinix.services.metalv1.MetalGatewaysApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_bgp_dynamic_neighbor**](MetalGatewaysApi.md#create_bgp_dynamic_neighbor) | **POST** /metal-gateways/{id}/bgp-dynamic-neighbors | Create a VRF BGP Dynamic Neighbor range +[**create_metal_gateway**](MetalGatewaysApi.md#create_metal_gateway) | **POST** /projects/{project_id}/metal-gateways | Create a metal gateway +[**create_metal_gateway_elastic_ip**](MetalGatewaysApi.md#create_metal_gateway_elastic_ip) | **POST** /metal-gateways/{id}/ips | Create a Metal Gateway Elastic IP +[**delete_metal_gateway**](MetalGatewaysApi.md#delete_metal_gateway) | **DELETE** /metal-gateways/{id} | Deletes the metal gateway +[**find_metal_gateway_by_id**](MetalGatewaysApi.md#find_metal_gateway_by_id) | **GET** /metal-gateways/{id} | Returns the metal gateway +[**find_metal_gateways_by_project**](MetalGatewaysApi.md#find_metal_gateways_by_project) | **GET** /projects/{project_id}/metal-gateways | Returns all metal gateways for a project +[**find_metal_gateways_by_project_all_pages**](MetalGatewaysApi.md#find_metal_gateways_by_project_all_pages) | **GET** /projects/{project_id}/metal-gateways | Returns all metal gateways for a project, fetches all the pages +[**get_bgp_dynamic_neighbors**](MetalGatewaysApi.md#get_bgp_dynamic_neighbors) | **GET** /metal-gateways/{id}/bgp-dynamic-neighbors | List BGP Dynamic Neighbors +[**get_metal_gateway_elastic_ips**](MetalGatewaysApi.md#get_metal_gateway_elastic_ips) | **GET** /metal-gateways/{id}/ips | List Metal Gateway Elastic IPs + + +# **create_bgp_dynamic_neighbor** +> BgpDynamicNeighbor create_bgp_dynamic_neighbor(id, bgp_dynamic_neighbor_create_input, include=include, exclude=exclude) + +Create a VRF BGP Dynamic Neighbor range + +Create a VRF BGP Dynamic Neighbor range. BGP Dynamic Neighbor records are limited to 2 per Virtual Network. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_dynamic_neighbor import BgpDynamicNeighbor +from equinix.services.metalv1.models.bgp_dynamic_neighbor_create_input import BgpDynamicNeighborCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MetalGatewaysApi(api_client) + id = 'id_example' # str | Metal Gateway UUID + bgp_dynamic_neighbor_create_input = equinix.services.metalv1.BgpDynamicNeighborCreateInput() # BgpDynamicNeighborCreateInput | + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create a VRF BGP Dynamic Neighbor range + api_response = api_instance.create_bgp_dynamic_neighbor(id, bgp_dynamic_neighbor_create_input, include=include, exclude=exclude) + print("The response of MetalGatewaysApi->create_bgp_dynamic_neighbor:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetalGatewaysApi->create_bgp_dynamic_neighbor: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Metal Gateway UUID | + **bgp_dynamic_neighbor_create_input** | [**BgpDynamicNeighborCreateInput**](BgpDynamicNeighborCreateInput.md)| | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**BgpDynamicNeighbor**](BgpDynamicNeighbor.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_metal_gateway** +> FindMetalGatewayById200Response create_metal_gateway(project_id, create_metal_gateway_request, include=include, exclude=exclude, page=page, per_page=per_page) + +Create a metal gateway + +Create a metal gateway in a project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.create_metal_gateway_request import CreateMetalGatewayRequest +from equinix.services.metalv1.models.find_metal_gateway_by_id200_response import FindMetalGatewayById200Response +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MetalGatewaysApi(api_client) + project_id = 'project_id_example' # str | Project UUID + create_metal_gateway_request = equinix.services.metalv1.CreateMetalGatewayRequest() # CreateMetalGatewayRequest | Metal Gateway to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Create a metal gateway + api_response = api_instance.create_metal_gateway(project_id, create_metal_gateway_request, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of MetalGatewaysApi->create_metal_gateway:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetalGatewaysApi->create_metal_gateway: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Project UUID | + **create_metal_gateway_request** | [**CreateMetalGatewayRequest**](CreateMetalGatewayRequest.md)| Metal Gateway to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**FindMetalGatewayById200Response**](FindMetalGatewayById200Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_metal_gateway_elastic_ip** +> IPAssignment create_metal_gateway_elastic_ip(id, metal_gateway_elastic_ip_create_input, include=include, exclude=exclude) + +Create a Metal Gateway Elastic IP + +Create a new Elastic IP on this Metal Gateway. Assign an IPv4 range as an elastic IP to the Metal Gateway, with a specified next-hop address contained within the Metal Gateway. Notice: Elastic IPs on Metal Gateways are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ip_assignment import IPAssignment +from equinix.services.metalv1.models.metal_gateway_elastic_ip_create_input import MetalGatewayElasticIpCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MetalGatewaysApi(api_client) + id = 'id_example' # str | Metal Gateway UUID + metal_gateway_elastic_ip_create_input = equinix.services.metalv1.MetalGatewayElasticIpCreateInput() # MetalGatewayElasticIpCreateInput | + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create a Metal Gateway Elastic IP + api_response = api_instance.create_metal_gateway_elastic_ip(id, metal_gateway_elastic_ip_create_input, include=include, exclude=exclude) + print("The response of MetalGatewaysApi->create_metal_gateway_elastic_ip:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetalGatewaysApi->create_metal_gateway_elastic_ip: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Metal Gateway UUID | + **metal_gateway_elastic_ip_create_input** | [**MetalGatewayElasticIpCreateInput**](MetalGatewayElasticIpCreateInput.md)| | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**IPAssignment**](IPAssignment.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_metal_gateway** +> FindMetalGatewayById200Response delete_metal_gateway(id, include=include, exclude=exclude) + +Deletes the metal gateway + +Deletes a metal gateway and any elastic IP assignments associated with this metal gateway. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.find_metal_gateway_by_id200_response import FindMetalGatewayById200Response +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MetalGatewaysApi(api_client) + id = 'id_example' # str | Metal Gateway UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Deletes the metal gateway + api_response = api_instance.delete_metal_gateway(id, include=include, exclude=exclude) + print("The response of MetalGatewaysApi->delete_metal_gateway:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetalGatewaysApi->delete_metal_gateway: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Metal Gateway UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**FindMetalGatewayById200Response**](FindMetalGatewayById200Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | accepted | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_metal_gateway_by_id** +> FindMetalGatewayById200Response find_metal_gateway_by_id(id, include=include, exclude=exclude) + +Returns the metal gateway + +Returns a specific metal gateway + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.find_metal_gateway_by_id200_response import FindMetalGatewayById200Response +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MetalGatewaysApi(api_client) + id = 'id_example' # str | Metal Gateway UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Returns the metal gateway + api_response = api_instance.find_metal_gateway_by_id(id, include=include, exclude=exclude) + print("The response of MetalGatewaysApi->find_metal_gateway_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetalGatewaysApi->find_metal_gateway_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Metal Gateway UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**FindMetalGatewayById200Response**](FindMetalGatewayById200Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_metal_gateways_by_project** +> MetalGatewayList find_metal_gateways_by_project(project_id, include=include, exclude=exclude, page=page, per_page=per_page) + +Returns all metal gateways for a project + +Return all metal gateways for a project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.metal_gateway_list import MetalGatewayList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MetalGatewaysApi(api_client) + project_id = 'project_id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Returns all metal gateways for a project + api_response = api_instance.find_metal_gateways_by_project(project_id, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of MetalGatewaysApi->find_metal_gateways_by_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetalGatewaysApi->find_metal_gateways_by_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**MetalGatewayList**](MetalGatewayList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_metal_gateways_by_project_all_pages** +> MetalGatewayList find_metal_gateways_by_project_all_pages(project_id, include=include, exclude=exclude, per_page=per_page) +Just like [**find_metal_gateways_by_project**](MetalGatewaysApi.md#find_metal_gateways_by_project) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_metal_gateways_by_project**](MetalGatewaysApi.md#find_metal_gateways_by_project). +# **get_bgp_dynamic_neighbors** +> BgpDynamicNeighborList get_bgp_dynamic_neighbors(id, include=include, exclude=exclude) + +List BGP Dynamic Neighbors + +Returns the list of VRF BGP Dynamic Neighbors for this Metal Gateway + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_dynamic_neighbor_list import BgpDynamicNeighborList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MetalGatewaysApi(api_client) + id = 'id_example' # str | Metal Gateway UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # List BGP Dynamic Neighbors + api_response = api_instance.get_bgp_dynamic_neighbors(id, include=include, exclude=exclude) + print("The response of MetalGatewaysApi->get_bgp_dynamic_neighbors:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetalGatewaysApi->get_bgp_dynamic_neighbors: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Metal Gateway UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**BgpDynamicNeighborList**](BgpDynamicNeighborList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_metal_gateway_elastic_ips** +> IPAssignmentList get_metal_gateway_elastic_ips(id, include=include, exclude=exclude) + +List Metal Gateway Elastic IPs + +Returns the list of Elastic IPs assigned to this Metal Gateway + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ip_assignment_list import IPAssignmentList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MetalGatewaysApi(api_client) + id = 'id_example' # str | Metal Gateway UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # List Metal Gateway Elastic IPs + api_response = api_instance.get_metal_gateway_elastic_ips(id, include=include, exclude=exclude) + print("The response of MetalGatewaysApi->get_metal_gateway_elastic_ips:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetalGatewaysApi->get_metal_gateway_elastic_ips: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Metal Gateway UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**IPAssignmentList**](IPAssignmentList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Metro.md b/equinix/services/metalv1/docs/Metro.md new file mode 100644 index 00000000..1c4ae2b7 --- /dev/null +++ b/equinix/services/metalv1/docs/Metro.md @@ -0,0 +1,33 @@ +# Metro + + +## 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.metro import Metro + +# TODO update the JSON string below +json = "{}" +# create an instance of Metro from a JSON string +metro_instance = Metro.from_json(json) +# print the JSON string representation of the object +print(Metro.to_json()) + +# convert the object into a dict +metro_dict = metro_instance.to_dict() +# create an instance of Metro from a dict +metro_form_dict = metro.from_dict(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/MetroInput.md b/equinix/services/metalv1/docs/MetroInput.md new file mode 100644 index 00000000..2f1bfea5 --- /dev/null +++ b/equinix/services/metalv1/docs/MetroInput.md @@ -0,0 +1,30 @@ +# MetroInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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. | + +## Example + +```python +from equinix.services.metalv1.models.metro_input import MetroInput + +# TODO update the JSON string below +json = "{}" +# create an instance of MetroInput from a JSON string +metro_input_instance = MetroInput.from_json(json) +# print the JSON string representation of the object +print(MetroInput.to_json()) + +# convert the object into a dict +metro_input_dict = metro_input_instance.to_dict() +# create an instance of MetroInput from a dict +metro_input_form_dict = metro_input.from_dict(metro_input_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/MetroList.md b/equinix/services/metalv1/docs/MetroList.md new file mode 100644 index 00000000..2e106834 --- /dev/null +++ b/equinix/services/metalv1/docs/MetroList.md @@ -0,0 +1,30 @@ +# MetroList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**metros** | [**List[Metro]**](Metro.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.metro_list import MetroList + +# TODO update the JSON string below +json = "{}" +# create an instance of MetroList from a JSON string +metro_list_instance = MetroList.from_json(json) +# print the JSON string representation of the object +print(MetroList.to_json()) + +# convert the object into a dict +metro_list_dict = metro_list_instance.to_dict() +# create an instance of MetroList from a dict +metro_list_form_dict = metro_list.from_dict(metro_list_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/MetrosApi.md b/equinix/services/metalv1/docs/MetrosApi.md new file mode 100644 index 00000000..3bd8e044 --- /dev/null +++ b/equinix/services/metalv1/docs/MetrosApi.md @@ -0,0 +1,164 @@ +# equinix.services.metalv1.MetrosApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_metros**](MetrosApi.md#find_metros) | **GET** /locations/metros | Retrieve all metros +[**get_metro**](MetrosApi.md#get_metro) | **GET** /locations/metros/{id} | Retrieve a specific Metro's details + + +# **find_metros** +> MetroList find_metros() + +Retrieve all metros + +Provides a listing of available metros + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.metro_list import MetroList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MetrosApi(api_client) + + try: + # Retrieve all metros + api_response = api_instance.find_metros() + print("The response of MetrosApi->find_metros:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetrosApi->find_metros: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**MetroList**](MetroList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_metro** +> Metro get_metro(id) + +Retrieve a specific Metro's details + +Show the details for a metro, including name, code, and country. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.metro import Metro +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.MetrosApi(api_client) + id = 'id_example' # str | Metro UUID + + try: + # Retrieve a specific Metro's details + api_response = api_instance.get_metro(id) + print("The response of MetrosApi->get_metro:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling MetrosApi->get_metro: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Metro UUID | + +### Return type + +[**Metro**](Metro.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Mount.md b/equinix/services/metalv1/docs/Mount.md new file mode 100644 index 00000000..4b94dc89 --- /dev/null +++ b/equinix/services/metalv1/docs/Mount.md @@ -0,0 +1,33 @@ +# Mount + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device** | **str** | | [optional] +**format** | **str** | | [optional] +**href** | **str** | | [optional] +**options** | **List[str]** | | [optional] +**point** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.mount import Mount + +# TODO update the JSON string below +json = "{}" +# create an instance of Mount from a JSON string +mount_instance = Mount.from_json(json) +# print the JSON string representation of the object +print(Mount.to_json()) + +# convert the object into a dict +mount_dict = mount_instance.to_dict() +# create an instance of Mount from a dict +mount_form_dict = mount.from_dict(mount_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/MoveHardwareReservationRequest.md b/equinix/services/metalv1/docs/MoveHardwareReservationRequest.md new file mode 100644 index 00000000..d685c699 --- /dev/null +++ b/equinix/services/metalv1/docs/MoveHardwareReservationRequest.md @@ -0,0 +1,30 @@ +# MoveHardwareReservationRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**project_id** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.move_hardware_reservation_request import MoveHardwareReservationRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of MoveHardwareReservationRequest from a JSON string +move_hardware_reservation_request_instance = MoveHardwareReservationRequest.from_json(json) +# print the JSON string representation of the object +print(MoveHardwareReservationRequest.to_json()) + +# convert the object into a dict +move_hardware_reservation_request_dict = move_hardware_reservation_request_instance.to_dict() +# create an instance of MoveHardwareReservationRequest from a dict +move_hardware_reservation_request_form_dict = move_hardware_reservation_request.from_dict(move_hardware_reservation_request_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/NewPassword.md b/equinix/services/metalv1/docs/NewPassword.md new file mode 100644 index 00000000..cfb3b60b --- /dev/null +++ b/equinix/services/metalv1/docs/NewPassword.md @@ -0,0 +1,30 @@ +# NewPassword + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**new_password** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.new_password import NewPassword + +# TODO update the JSON string below +json = "{}" +# create an instance of NewPassword from a JSON string +new_password_instance = NewPassword.from_json(json) +# print the JSON string representation of the object +print(NewPassword.to_json()) + +# convert the object into a dict +new_password_dict = new_password_instance.to_dict() +# create an instance of NewPassword from a dict +new_password_form_dict = new_password.from_dict(new_password_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/OTPsApi.md b/equinix/services/metalv1/docs/OTPsApi.md new file mode 100644 index 00000000..e794ea48 --- /dev/null +++ b/equinix/services/metalv1/docs/OTPsApi.md @@ -0,0 +1,318 @@ +# equinix.services.metalv1.OTPsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_ensure_otp**](OTPsApi.md#find_ensure_otp) | **POST** /user/otp/verify/{otp} | Verify user by providing an OTP +[**find_recovery_codes**](OTPsApi.md#find_recovery_codes) | **GET** /user/otp/recovery-codes | Retrieve my recovery codes +[**receive_codes**](OTPsApi.md#receive_codes) | **POST** /user/otp/sms/receive | Receive an OTP per sms +[**regenerate_codes**](OTPsApi.md#regenerate_codes) | **POST** /user/otp/recovery-codes | Generate new recovery codes + + +# **find_ensure_otp** +> find_ensure_otp(otp) + +Verify user by providing an OTP + +It verifies the user once a valid OTP is provided. It gives back a session token, essentially logging in the user. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OTPsApi(api_client) + otp = 'otp_example' # str | OTP + + try: + # Verify user by providing an OTP + api_instance.find_ensure_otp(otp) + except Exception as e: + print("Exception when calling OTPsApi->find_ensure_otp: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **otp** | **str**| OTP | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**400** | bad request | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_recovery_codes** +> RecoveryCodeList find_recovery_codes() + +Retrieve my recovery codes + +Returns my recovery codes. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OTPsApi(api_client) + + try: + # Retrieve my recovery codes + api_response = api_instance.find_recovery_codes() + print("The response of OTPsApi->find_recovery_codes:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OTPsApi->find_recovery_codes: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**RecoveryCodeList**](RecoveryCodeList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **receive_codes** +> receive_codes() + +Receive an OTP per sms + +Sends an OTP to the user's mobile phone. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OTPsApi(api_client) + + try: + # Receive an OTP per sms + api_instance.receive_codes() + except Exception as e: + print("Exception when calling OTPsApi->receive_codes: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**400** | bad request | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | +**500** | internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **regenerate_codes** +> RecoveryCodeList regenerate_codes() + +Generate new recovery codes + +Generate a new set of recovery codes. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OTPsApi(api_client) + + try: + # Generate new recovery codes + api_response = api_instance.regenerate_codes() + print("The response of OTPsApi->regenerate_codes:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OTPsApi->regenerate_codes: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**RecoveryCodeList**](RecoveryCodeList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/OperatingSystem.md b/equinix/services/metalv1/docs/OperatingSystem.md new file mode 100644 index 00000000..01cccc33 --- /dev/null +++ b/equinix/services/metalv1/docs/OperatingSystem.md @@ -0,0 +1,47 @@ +# OperatingSystem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**build_date** | **date** | The date on which the current OS image was build and released | [optional] +**default_operating_system** | **bool** | Default operating system for the distro. | [optional] [readonly] +**deprecation_date** | **date** | The date when the OS is deprecated | [optional] +**distro** | **str** | | [optional] +**distro_label** | **str** | | [optional] +**end_of_life_date** | **date** | The OS no longer receives any updates and may be disabled at any time | [optional] +**end_of_service_date** | **date** | When the OS is nearing end of life, typically 30 days before end of life | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**licensed** | **bool** | Licenced OS is priced according to pricing property | [optional] +**lifecycle_state** | **str** | Where in the support lifecycle the OS is | [optional] +**name** | **str** | | [optional] +**preinstallable** | **bool** | Servers can be already preinstalled with OS in order to shorten provision time. | [optional] +**pricing** | **object** | This object contains price per time unit and optional multiplier value if licence price depends on hardware plan or components (e.g. number of cores) | [optional] +**provisionable_on** | **List[str]** | | [optional] +**release_date** | **date** | The date when the OS was released | [optional] +**release_notes** | **str** | The current release notes for this OS image, typically in Markdown format | [optional] +**slug** | **str** | | [optional] +**version** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.operating_system import OperatingSystem + +# TODO update the JSON string below +json = "{}" +# create an instance of OperatingSystem from a JSON string +operating_system_instance = OperatingSystem.from_json(json) +# print the JSON string representation of the object +print(OperatingSystem.to_json()) + +# convert the object into a dict +operating_system_dict = operating_system_instance.to_dict() +# create an instance of OperatingSystem from a dict +operating_system_form_dict = operating_system.from_dict(operating_system_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/OperatingSystemList.md b/equinix/services/metalv1/docs/OperatingSystemList.md new file mode 100644 index 00000000..ab79b31c --- /dev/null +++ b/equinix/services/metalv1/docs/OperatingSystemList.md @@ -0,0 +1,30 @@ +# OperatingSystemList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**operating_systems** | [**List[OperatingSystem]**](OperatingSystem.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.operating_system_list import OperatingSystemList + +# TODO update the JSON string below +json = "{}" +# create an instance of OperatingSystemList from a JSON string +operating_system_list_instance = OperatingSystemList.from_json(json) +# print the JSON string representation of the object +print(OperatingSystemList.to_json()) + +# convert the object into a dict +operating_system_list_dict = operating_system_list_instance.to_dict() +# create an instance of OperatingSystemList from a dict +operating_system_list_form_dict = operating_system_list.from_dict(operating_system_list_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/OperatingSystemsApi.md b/equinix/services/metalv1/docs/OperatingSystemsApi.md new file mode 100644 index 00000000..3803de87 --- /dev/null +++ b/equinix/services/metalv1/docs/OperatingSystemsApi.md @@ -0,0 +1,160 @@ +# equinix.services.metalv1.OperatingSystemsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_operating_system_version**](OperatingSystemsApi.md#find_operating_system_version) | **GET** /operating-system-versions | Retrieve all operating system versions +[**find_operating_systems**](OperatingSystemsApi.md#find_operating_systems) | **GET** /operating-systems | Retrieve all operating systems + + +# **find_operating_system_version** +> OperatingSystemList find_operating_system_version() + +Retrieve all operating system versions + +Provides a listing of available operating system versions. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.operating_system_list import OperatingSystemList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OperatingSystemsApi(api_client) + + try: + # Retrieve all operating system versions + api_response = api_instance.find_operating_system_version() + print("The response of OperatingSystemsApi->find_operating_system_version:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OperatingSystemsApi->find_operating_system_version: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**OperatingSystemList**](OperatingSystemList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_operating_systems** +> OperatingSystemList find_operating_systems() + +Retrieve all operating systems + +Provides a listing of available operating systems to provision your new device with. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.operating_system_list import OperatingSystemList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OperatingSystemsApi(api_client) + + try: + # Retrieve all operating systems + api_response = api_instance.find_operating_systems() + print("The response of OperatingSystemsApi->find_operating_systems:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OperatingSystemsApi->find_operating_systems: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**OperatingSystemList**](OperatingSystemList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Organization.md b/equinix/services/metalv1/docs/Organization.md new file mode 100644 index 00000000..3cc06b82 --- /dev/null +++ b/equinix/services/metalv1/docs/Organization.md @@ -0,0 +1,46 @@ +# Organization + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**Address**](Address.md) | | [optional] +**billing_address** | [**Address**](Address.md) | | [optional] +**created_at** | **datetime** | | [optional] +**credit_amount** | **float** | | [optional] +**customdata** | **object** | | [optional] +**description** | **str** | | [optional] +**enforce_2fa_at** | **datetime** | Force to all members to have enabled the two factor authentication after that date, unless the value is null | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**logo** | **str** | | [optional] +**members** | [**List[Href]**](Href.md) | | [optional] +**memberships** | [**List[Href]**](Href.md) | | [optional] +**name** | **str** | | [optional] +**projects** | [**List[Href]**](Href.md) | | [optional] +**terms** | **int** | | [optional] +**twitter** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] +**website** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.organization import Organization + +# TODO update the JSON string below +json = "{}" +# create an instance of Organization from a JSON string +organization_instance = Organization.from_json(json) +# print the JSON string representation of the object +print(Organization.to_json()) + +# convert the object into a dict +organization_dict = organization_instance.to_dict() +# create an instance of Organization from a dict +organization_form_dict = organization.from_dict(organization_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/OrganizationInput.md b/equinix/services/metalv1/docs/OrganizationInput.md new file mode 100644 index 00000000..67aa4e20 --- /dev/null +++ b/equinix/services/metalv1/docs/OrganizationInput.md @@ -0,0 +1,37 @@ +# OrganizationInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**Address**](Address.md) | | [optional] +**billing_address** | [**Address**](Address.md) | | [optional] +**customdata** | **object** | | [optional] +**description** | **str** | | [optional] +**enforce_2fa_at** | **datetime** | Force to all members to have enabled the two factor authentication after that date, unless the value is null | [optional] +**href** | **str** | | [optional] +**name** | **str** | | [optional] +**twitter** | **str** | | [optional] +**website** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.organization_input import OrganizationInput + +# TODO update the JSON string below +json = "{}" +# create an instance of OrganizationInput from a JSON string +organization_input_instance = OrganizationInput.from_json(json) +# print the JSON string representation of the object +print(OrganizationInput.to_json()) + +# convert the object into a dict +organization_input_dict = organization_input_instance.to_dict() +# create an instance of OrganizationInput from a dict +organization_input_form_dict = organization_input.from_dict(organization_input_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/OrganizationList.md b/equinix/services/metalv1/docs/OrganizationList.md new file mode 100644 index 00000000..9f89c897 --- /dev/null +++ b/equinix/services/metalv1/docs/OrganizationList.md @@ -0,0 +1,31 @@ +# OrganizationList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] +**organizations** | [**List[Organization]**](Organization.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.organization_list import OrganizationList + +# TODO update the JSON string below +json = "{}" +# create an instance of OrganizationList from a JSON string +organization_list_instance = OrganizationList.from_json(json) +# print the JSON string representation of the object +print(OrganizationList.to_json()) + +# convert the object into a dict +organization_list_dict = organization_list_instance.to_dict() +# create an instance of OrganizationList from a dict +organization_list_form_dict = organization_list.from_dict(organization_list_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/OrganizationsApi.md b/equinix/services/metalv1/docs/OrganizationsApi.md new file mode 100644 index 00000000..e6e121a7 --- /dev/null +++ b/equinix/services/metalv1/docs/OrganizationsApi.md @@ -0,0 +1,1307 @@ +# equinix.services.metalv1.OrganizationsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_organization**](OrganizationsApi.md#create_organization) | **POST** /organizations | Create an organization +[**create_organization_invitation**](OrganizationsApi.md#create_organization_invitation) | **POST** /organizations/{id}/invitations | Create an invitation for an organization +[**create_organization_project**](OrganizationsApi.md#create_organization_project) | **POST** /organizations/{id}/projects | Create a project for the organization +[**create_payment_method**](OrganizationsApi.md#create_payment_method) | **POST** /organizations/{id}/payment-methods | Create a payment method for the given organization +[**delete_organization**](OrganizationsApi.md#delete_organization) | **DELETE** /organizations/{id} | Delete the organization +[**find_operating_systems_by_organization**](OrganizationsApi.md#find_operating_systems_by_organization) | **GET** /organizations/{id}/operating-systems | Retrieve all operating systems visible by the organization +[**find_organization_by_id**](OrganizationsApi.md#find_organization_by_id) | **GET** /organizations/{id} | Retrieve an organization's details +[**find_organization_customdata**](OrganizationsApi.md#find_organization_customdata) | **GET** /organizations/{id}/customdata | Retrieve the custom metadata of an organization +[**find_organization_invitations**](OrganizationsApi.md#find_organization_invitations) | **GET** /organizations/{id}/invitations | Retrieve organization invitations +[**find_organization_payment_methods**](OrganizationsApi.md#find_organization_payment_methods) | **GET** /organizations/{id}/payment-methods | Retrieve all payment methods of an organization +[**find_organization_projects**](OrganizationsApi.md#find_organization_projects) | **GET** /organizations/{id}/projects | Retrieve all projects of an organization +[**find_organization_projects_all_pages**](OrganizationsApi.md#find_organization_projects_all_pages) | **GET** /organizations/{id}/projects | Retrieve all projects of an organization, fetches all the pages +[**find_organization_transfers**](OrganizationsApi.md#find_organization_transfers) | **GET** /organizations/{id}/transfers | Retrieve all project transfer requests from or to an organization +[**find_organizations**](OrganizationsApi.md#find_organizations) | **GET** /organizations | Retrieve all organizations +[**find_organizations_all_pages**](OrganizationsApi.md#find_organizations_all_pages) | **GET** /organizations | Retrieve all organizations, fetches all the pages +[**find_plans_by_organization**](OrganizationsApi.md#find_plans_by_organization) | **GET** /organizations/{id}/plans | Retrieve all plans visible by the organization +[**update_organization**](OrganizationsApi.md#update_organization) | **PUT** /organizations/{id} | Update the organization + + +# **create_organization** +> Organization create_organization(organization_input, include=include, exclude=exclude) + +Create an organization + +Creates an organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.organization import Organization +from equinix.services.metalv1.models.organization_input import OrganizationInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + organization_input = equinix.services.metalv1.OrganizationInput() # OrganizationInput | Organization to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create an organization + api_response = api_instance.create_organization(organization_input, include=include, exclude=exclude) + print("The response of OrganizationsApi->create_organization:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->create_organization: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **organization_input** | [**OrganizationInput**](OrganizationInput.md)| Organization to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_organization_invitation** +> Invitation create_organization_invitation(id, invitation_input, include=include) + +Create an invitation for an organization + +In order to add a user to an organization, they must first be invited. To invite to several projects the parameter `projects_ids:[a,b,c]` can be used + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.invitation import Invitation +from equinix.services.metalv1.models.invitation_input import InvitationInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + invitation_input = equinix.services.metalv1.InvitationInput() # InvitationInput | Invitation to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create an invitation for an organization + api_response = api_instance.create_organization_invitation(id, invitation_input, include=include) + print("The response of OrganizationsApi->create_organization_invitation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->create_organization_invitation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **invitation_input** | [**InvitationInput**](InvitationInput.md)| Invitation to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Invitation**](Invitation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_organization_project** +> Project create_organization_project(id, project_create_input, include=include, exclude=exclude) + +Create a project for the organization + +Creates a new project for the organization + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.project_create_input import ProjectCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + project_create_input = equinix.services.metalv1.ProjectCreateInput() # ProjectCreateInput | Project to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create a project for the organization + api_response = api_instance.create_organization_project(id, project_create_input, include=include, exclude=exclude) + print("The response of OrganizationsApi->create_organization_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->create_organization_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **project_create_input** | [**ProjectCreateInput**](ProjectCreateInput.md)| Project to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Project**](Project.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_payment_method** +> PaymentMethod create_payment_method(id, payment_method_create_input, include=include) + +Create a payment method for the given organization + +Creates a payment method. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.payment_method import PaymentMethod +from equinix.services.metalv1.models.payment_method_create_input import PaymentMethodCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + payment_method_create_input = equinix.services.metalv1.PaymentMethodCreateInput() # PaymentMethodCreateInput | Payment Method to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create a payment method for the given organization + api_response = api_instance.create_payment_method(id, payment_method_create_input, include=include) + print("The response of OrganizationsApi->create_payment_method:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->create_payment_method: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **payment_method_create_input** | [**PaymentMethodCreateInput**](PaymentMethodCreateInput.md)| Payment Method to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_organization** +> delete_organization(id) + +Delete the organization + +Deletes the organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + + try: + # Delete the organization + api_instance.delete_organization(id) + except Exception as e: + print("Exception when calling OrganizationsApi->delete_organization: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_operating_systems_by_organization** +> OperatingSystemList find_operating_systems_by_organization(id, include=include) + +Retrieve all operating systems visible by the organization + +Returns a listing of available operating systems for the given organization + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.operating_system_list import OperatingSystemList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve all operating systems visible by the organization + api_response = api_instance.find_operating_systems_by_organization(id, include=include) + print("The response of OrganizationsApi->find_operating_systems_by_organization:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->find_operating_systems_by_organization: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**OperatingSystemList**](OperatingSystemList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_by_id** +> Organization find_organization_by_id(id, include=include, exclude=exclude) + +Retrieve an organization's details + +Returns a single organization's details, if the user is authorized to view it. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.organization import Organization +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve an organization's details + api_response = api_instance.find_organization_by_id(id, include=include, exclude=exclude) + print("The response of OrganizationsApi->find_organization_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->find_organization_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_customdata** +> find_organization_customdata(id) + +Retrieve the custom metadata of an organization + +Provides the custom metadata stored for this organization in json format + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + + try: + # Retrieve the custom metadata of an organization + api_instance.find_organization_customdata(id) + except Exception as e: + print("Exception when calling OrganizationsApi->find_organization_customdata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_invitations** +> InvitationList find_organization_invitations(id, include=include, page=page, per_page=per_page) + +Retrieve organization invitations + +Returns all invitations in an organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.invitation_list import InvitationList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve organization invitations + api_response = api_instance.find_organization_invitations(id, include=include, page=page, per_page=per_page) + print("The response of OrganizationsApi->find_organization_invitations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->find_organization_invitations: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**InvitationList**](InvitationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_payment_methods** +> PaymentMethodList find_organization_payment_methods(id, include=include, page=page, per_page=per_page) + +Retrieve all payment methods of an organization + +Returns all payment methods of an organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.payment_method_list import PaymentMethodList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve all payment methods of an organization + api_response = api_instance.find_organization_payment_methods(id, include=include, page=page, per_page=per_page) + print("The response of OrganizationsApi->find_organization_payment_methods:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->find_organization_payment_methods: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**PaymentMethodList**](PaymentMethodList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_projects** +> ProjectList find_organization_projects(id, name=name, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve all projects of an organization + +Returns a collection of projects that belong to the organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.project_list import ProjectList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + name = 'name_example' # str | Filter results by name. (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve all projects of an organization + api_response = api_instance.find_organization_projects(id, name=name, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of OrganizationsApi->find_organization_projects:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->find_organization_projects: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **name** | **str**| Filter results by name. | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**ProjectList**](ProjectList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organization_projects_all_pages** +> ProjectList find_organization_projects_all_pages(id, name=name, include=include, exclude=exclude, per_page=per_page) +Just like [**find_organization_projects**](OrganizationsApi.md#find_organization_projects) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_organization_projects**](OrganizationsApi.md#find_organization_projects). +# **find_organization_transfers** +> TransferRequestList find_organization_transfers(id, include=include) + +Retrieve all project transfer requests from or to an organization + +Provides a collection of project transfer requests from or to the organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.transfer_request_list import TransferRequestList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve all project transfer requests from or to an organization + api_response = api_instance.find_organization_transfers(id, include=include) + print("The response of OrganizationsApi->find_organization_transfers:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->find_organization_transfers: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**TransferRequestList**](TransferRequestList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organizations** +> OrganizationList find_organizations(personal=personal, without_projects=without_projects, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve all organizations + +Returns a list of organizations that are accessible to the current user. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.organization_list import OrganizationList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + personal = 'personal_example' # str | Include, exclude or show only personal organizations. (optional) + without_projects = 'without_projects_example' # str | Include, exclude or show only organizations that have no projects. (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve all organizations + api_response = api_instance.find_organizations(personal=personal, without_projects=without_projects, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of OrganizationsApi->find_organizations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->find_organizations: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **personal** | **str**| Include, exclude or show only personal organizations. | [optional] + **without_projects** | **str**| Include, exclude or show only organizations that have no projects. | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**OrganizationList**](OrganizationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_organizations_all_pages** +> OrganizationList find_organizations_all_pages(personal=personal, without_projects=without_projects, include=include, exclude=exclude, per_page=per_page) +Just like [**find_organizations**](OrganizationsApi.md#find_organizations) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_organizations**](OrganizationsApi.md#find_organizations). +# **find_plans_by_organization** +> PlanList find_plans_by_organization(id, include=include, exclude=exclude) + +Retrieve all plans visible by the organization + +Returns a listing of available plans for the given organization + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.plan_list import PlanList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve all plans visible by the organization + api_response = api_instance.find_plans_by_organization(id, include=include, exclude=exclude) + print("The response of OrganizationsApi->find_plans_by_organization:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->find_plans_by_organization: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**PlanList**](PlanList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_organization** +> Organization update_organization(id, organization_input, include=include, exclude=exclude) + +Update the organization + +Updates the organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.organization import Organization +from equinix.services.metalv1.models.organization_input import OrganizationInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.OrganizationsApi(api_client) + id = 'id_example' # str | Organization UUID + organization_input = equinix.services.metalv1.OrganizationInput() # OrganizationInput | Organization to update + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Update the organization + api_response = api_instance.update_organization(id, organization_input, include=include, exclude=exclude) + print("The response of OrganizationsApi->update_organization:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->update_organization: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Organization UUID | + **organization_input** | [**OrganizationInput**](OrganizationInput.md)| Organization to update | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/ParentBlock.md b/equinix/services/metalv1/docs/ParentBlock.md new file mode 100644 index 00000000..68528a8e --- /dev/null +++ b/equinix/services/metalv1/docs/ParentBlock.md @@ -0,0 +1,32 @@ +# ParentBlock + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cidr** | **int** | | [optional] +**href** | **str** | | [optional] +**netmask** | **str** | | [optional] +**network** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.parent_block import ParentBlock + +# TODO update the JSON string below +json = "{}" +# create an instance of ParentBlock from a JSON string +parent_block_instance = ParentBlock.from_json(json) +# print the JSON string representation of the object +print(ParentBlock.to_json()) + +# convert the object into a dict +parent_block_dict = parent_block_instance.to_dict() +# create an instance of ParentBlock from a dict +parent_block_form_dict = parent_block.from_dict(parent_block_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/Partition.md b/equinix/services/metalv1/docs/Partition.md new file mode 100644 index 00000000..2c80f65c --- /dev/null +++ b/equinix/services/metalv1/docs/Partition.md @@ -0,0 +1,32 @@ +# Partition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**label** | **str** | | [optional] +**number** | **int** | | [optional] +**size** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.partition import Partition + +# TODO update the JSON string below +json = "{}" +# create an instance of Partition from a JSON string +partition_instance = Partition.from_json(json) +# print the JSON string representation of the object +print(Partition.to_json()) + +# convert the object into a dict +partition_dict = partition_instance.to_dict() +# create an instance of Partition from a dict +partition_form_dict = partition.from_dict(partition_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/PasswordResetTokensApi.md b/equinix/services/metalv1/docs/PasswordResetTokensApi.md new file mode 100644 index 00000000..79b909dd --- /dev/null +++ b/equinix/services/metalv1/docs/PasswordResetTokensApi.md @@ -0,0 +1,163 @@ +# equinix.services.metalv1.PasswordResetTokensApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_password_reset_token**](PasswordResetTokensApi.md#create_password_reset_token) | **POST** /reset-password | Create a password reset token +[**reset_password**](PasswordResetTokensApi.md#reset_password) | **DELETE** /reset-password | Reset current user password + + +# **create_password_reset_token** +> create_password_reset_token(email) + +Create a password reset token + +Creates a password reset token + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PasswordResetTokensApi(api_client) + email = 'email_example' # str | Email of user to create password reset token + + try: + # Create a password reset token + api_instance.create_password_reset_token(email) + except Exception as e: + print("Exception when calling PasswordResetTokensApi->create_password_reset_token: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **email** | **str**| Email of user to create password reset token | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **reset_password** +> NewPassword reset_password() + +Reset current user password + +Resets current user password. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.new_password import NewPassword +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PasswordResetTokensApi(api_client) + + try: + # Reset current user password + api_response = api_instance.reset_password() + print("The response of PasswordResetTokensApi->reset_password:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PasswordResetTokensApi->reset_password: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**NewPassword**](NewPassword.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | ok | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/PaymentMethod.md b/equinix/services/metalv1/docs/PaymentMethod.md new file mode 100644 index 00000000..3b6b4e50 --- /dev/null +++ b/equinix/services/metalv1/docs/PaymentMethod.md @@ -0,0 +1,44 @@ +# PaymentMethod + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**billing_address** | [**PaymentMethodBillingAddress**](PaymentMethodBillingAddress.md) | | [optional] +**card_type** | **str** | | [optional] +**cardholder_name** | **str** | | [optional] +**created_at** | **datetime** | | [optional] +**created_by_user** | [**Href**](Href.md) | | [optional] +**default** | **bool** | | [optional] +**email** | **str** | | [optional] +**expiration_month** | **str** | | [optional] +**expiration_year** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**organization** | [**Href**](Href.md) | | [optional] +**projects** | [**List[Href]**](Href.md) | | [optional] +**type** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.payment_method import PaymentMethod + +# TODO update the JSON string below +json = "{}" +# create an instance of PaymentMethod from a JSON string +payment_method_instance = PaymentMethod.from_json(json) +# print the JSON string representation of the object +print(PaymentMethod.to_json()) + +# convert the object into a dict +payment_method_dict = payment_method_instance.to_dict() +# create an instance of PaymentMethod from a dict +payment_method_form_dict = payment_method.from_dict(payment_method_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/PaymentMethodBillingAddress.md b/equinix/services/metalv1/docs/PaymentMethodBillingAddress.md new file mode 100644 index 00000000..99b74a74 --- /dev/null +++ b/equinix/services/metalv1/docs/PaymentMethodBillingAddress.md @@ -0,0 +1,32 @@ +# PaymentMethodBillingAddress + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_code_alpha2** | **str** | | [optional] +**href** | **str** | | [optional] +**postal_code** | **str** | | [optional] +**street_address** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.payment_method_billing_address import PaymentMethodBillingAddress + +# TODO update the JSON string below +json = "{}" +# create an instance of PaymentMethodBillingAddress from a JSON string +payment_method_billing_address_instance = PaymentMethodBillingAddress.from_json(json) +# print the JSON string representation of the object +print(PaymentMethodBillingAddress.to_json()) + +# convert the object into a dict +payment_method_billing_address_dict = payment_method_billing_address_instance.to_dict() +# create an instance of PaymentMethodBillingAddress from a dict +payment_method_billing_address_form_dict = payment_method_billing_address.from_dict(payment_method_billing_address_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/PaymentMethodCreateInput.md b/equinix/services/metalv1/docs/PaymentMethodCreateInput.md new file mode 100644 index 00000000..749015da --- /dev/null +++ b/equinix/services/metalv1/docs/PaymentMethodCreateInput.md @@ -0,0 +1,32 @@ +# PaymentMethodCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**default** | **bool** | | [optional] +**href** | **str** | | [optional] +**name** | **str** | | +**nonce** | **str** | | + +## Example + +```python +from equinix.services.metalv1.models.payment_method_create_input import PaymentMethodCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of PaymentMethodCreateInput from a JSON string +payment_method_create_input_instance = PaymentMethodCreateInput.from_json(json) +# print the JSON string representation of the object +print(PaymentMethodCreateInput.to_json()) + +# convert the object into a dict +payment_method_create_input_dict = payment_method_create_input_instance.to_dict() +# create an instance of PaymentMethodCreateInput from a dict +payment_method_create_input_form_dict = payment_method_create_input.from_dict(payment_method_create_input_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/PaymentMethodList.md b/equinix/services/metalv1/docs/PaymentMethodList.md new file mode 100644 index 00000000..be3344d5 --- /dev/null +++ b/equinix/services/metalv1/docs/PaymentMethodList.md @@ -0,0 +1,30 @@ +# PaymentMethodList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**payment_methods** | [**List[PaymentMethod]**](PaymentMethod.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.payment_method_list import PaymentMethodList + +# TODO update the JSON string below +json = "{}" +# create an instance of PaymentMethodList from a JSON string +payment_method_list_instance = PaymentMethodList.from_json(json) +# print the JSON string representation of the object +print(PaymentMethodList.to_json()) + +# convert the object into a dict +payment_method_list_dict = payment_method_list_instance.to_dict() +# create an instance of PaymentMethodList from a dict +payment_method_list_form_dict = payment_method_list.from_dict(payment_method_list_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/PaymentMethodUpdateInput.md b/equinix/services/metalv1/docs/PaymentMethodUpdateInput.md new file mode 100644 index 00000000..9fe84010 --- /dev/null +++ b/equinix/services/metalv1/docs/PaymentMethodUpdateInput.md @@ -0,0 +1,35 @@ +# PaymentMethodUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**billing_address** | **object** | | [optional] +**cardholder_name** | **str** | | [optional] +**default** | **bool** | | [optional] +**expiration_month** | **str** | | [optional] +**expiration_year** | **int** | | [optional] +**href** | **str** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.payment_method_update_input import PaymentMethodUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of PaymentMethodUpdateInput from a JSON string +payment_method_update_input_instance = PaymentMethodUpdateInput.from_json(json) +# print the JSON string representation of the object +print(PaymentMethodUpdateInput.to_json()) + +# convert the object into a dict +payment_method_update_input_dict = payment_method_update_input_instance.to_dict() +# create an instance of PaymentMethodUpdateInput from a dict +payment_method_update_input_form_dict = payment_method_update_input.from_dict(payment_method_update_input_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/PaymentMethodsApi.md b/equinix/services/metalv1/docs/PaymentMethodsApi.md new file mode 100644 index 00000000..ac7e2995 --- /dev/null +++ b/equinix/services/metalv1/docs/PaymentMethodsApi.md @@ -0,0 +1,256 @@ +# equinix.services.metalv1.PaymentMethodsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_payment_method**](PaymentMethodsApi.md#delete_payment_method) | **DELETE** /payment-methods/{id} | Delete the payment method +[**find_payment_method_by_id**](PaymentMethodsApi.md#find_payment_method_by_id) | **GET** /payment-methods/{id} | Retrieve a payment method +[**update_payment_method**](PaymentMethodsApi.md#update_payment_method) | **PUT** /payment-methods/{id} | Update the payment method + + +# **delete_payment_method** +> delete_payment_method(id) + +Delete the payment method + +Deletes the payment method. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PaymentMethodsApi(api_client) + id = 'id_example' # str | Payment Method UUID + + try: + # Delete the payment method + api_instance.delete_payment_method(id) + except Exception as e: + print("Exception when calling PaymentMethodsApi->delete_payment_method: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Payment Method UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_payment_method_by_id** +> PaymentMethod find_payment_method_by_id(id, include=include) + +Retrieve a payment method + +Returns a payment method + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.payment_method import PaymentMethod +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PaymentMethodsApi(api_client) + id = 'id_example' # str | Payment Method UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a payment method + api_response = api_instance.find_payment_method_by_id(id, include=include) + print("The response of PaymentMethodsApi->find_payment_method_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PaymentMethodsApi->find_payment_method_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Payment Method UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_payment_method** +> PaymentMethod update_payment_method(id, payment_method_update_input, include=include) + +Update the payment method + +Updates the payment method. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.payment_method import PaymentMethod +from equinix.services.metalv1.models.payment_method_update_input import PaymentMethodUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PaymentMethodsApi(api_client) + id = 'id_example' # str | Payment Method UUID + payment_method_update_input = equinix.services.metalv1.PaymentMethodUpdateInput() # PaymentMethodUpdateInput | Payment Method to update + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Update the payment method + api_response = api_instance.update_payment_method(id, payment_method_update_input, include=include) + print("The response of PaymentMethodsApi->update_payment_method:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PaymentMethodsApi->update_payment_method: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Payment Method UUID | + **payment_method_update_input** | [**PaymentMethodUpdateInput**](PaymentMethodUpdateInput.md)| Payment Method to update | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Plan.md b/equinix/services/metalv1/docs/Plan.md new file mode 100644 index 00000000..18e34398 --- /dev/null +++ b/equinix/services/metalv1/docs/Plan.md @@ -0,0 +1,43 @@ +# Plan + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available_in** | [**List[PlanAvailableInInner]**](PlanAvailableInInner.md) | Shows which facilities the plan is available in, and the facility-based price if it is different from the default price. | [optional] +**available_in_metros** | [**List[PlanAvailableInMetrosInner]**](PlanAvailableInMetrosInner.md) | Shows which metros the plan is available in, and the metro-based price if it is different from the default price. | [optional] +**categories** | **List[str]** | Categories of the plan, like compute or storage. A Plan can belong to multiple categories. | [optional] +**var_class** | **str** | | [optional] +**deployment_types** | **List[str]** | | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**legacy** | **bool** | Deprecated. Always return false | [optional] +**line** | **str** | | [optional] +**name** | **str** | | [optional] +**pricing** | **object** | | [optional] +**slug** | **str** | | [optional] +**specs** | [**PlanSpecs**](PlanSpecs.md) | | [optional] +**type** | **str** | The plan type | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan import Plan + +# TODO update the JSON string below +json = "{}" +# create an instance of Plan from a JSON string +plan_instance = Plan.from_json(json) +# print the JSON string representation of the object +print(Plan.to_json()) + +# convert the object into a dict +plan_dict = plan_instance.to_dict() +# create an instance of Plan from a dict +plan_form_dict = plan.from_dict(plan_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/PlanAvailableInInner.md b/equinix/services/metalv1/docs/PlanAvailableInInner.md new file mode 100644 index 00000000..00a36c88 --- /dev/null +++ b/equinix/services/metalv1/docs/PlanAvailableInInner.md @@ -0,0 +1,30 @@ +# PlanAvailableInInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | href to the Facility | [optional] +**price** | [**PlanAvailableInInnerPrice**](PlanAvailableInInnerPrice.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_available_in_inner import PlanAvailableInInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanAvailableInInner from a JSON string +plan_available_in_inner_instance = PlanAvailableInInner.from_json(json) +# print the JSON string representation of the object +print(PlanAvailableInInner.to_json()) + +# convert the object into a dict +plan_available_in_inner_dict = plan_available_in_inner_instance.to_dict() +# create an instance of PlanAvailableInInner from a dict +plan_available_in_inner_form_dict = plan_available_in_inner.from_dict(plan_available_in_inner_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/PlanAvailableInInnerPrice.md b/equinix/services/metalv1/docs/PlanAvailableInInnerPrice.md new file mode 100644 index 00000000..464c5d8c --- /dev/null +++ b/equinix/services/metalv1/docs/PlanAvailableInInnerPrice.md @@ -0,0 +1,30 @@ +# PlanAvailableInInnerPrice + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hour** | **float** | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_available_in_inner_price import PlanAvailableInInnerPrice + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanAvailableInInnerPrice from a JSON string +plan_available_in_inner_price_instance = PlanAvailableInInnerPrice.from_json(json) +# print the JSON string representation of the object +print(PlanAvailableInInnerPrice.to_json()) + +# convert the object into a dict +plan_available_in_inner_price_dict = plan_available_in_inner_price_instance.to_dict() +# create an instance of PlanAvailableInInnerPrice from a dict +plan_available_in_inner_price_form_dict = plan_available_in_inner_price.from_dict(plan_available_in_inner_price_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/PlanAvailableInMetrosInner.md b/equinix/services/metalv1/docs/PlanAvailableInMetrosInner.md new file mode 100644 index 00000000..0d46ea28 --- /dev/null +++ b/equinix/services/metalv1/docs/PlanAvailableInMetrosInner.md @@ -0,0 +1,30 @@ +# PlanAvailableInMetrosInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | href to the Metro | [optional] +**price** | [**PlanAvailableInInnerPrice**](PlanAvailableInInnerPrice.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_available_in_metros_inner import PlanAvailableInMetrosInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanAvailableInMetrosInner from a JSON string +plan_available_in_metros_inner_instance = PlanAvailableInMetrosInner.from_json(json) +# print the JSON string representation of the object +print(PlanAvailableInMetrosInner.to_json()) + +# convert the object into a dict +plan_available_in_metros_inner_dict = plan_available_in_metros_inner_instance.to_dict() +# create an instance of PlanAvailableInMetrosInner from a dict +plan_available_in_metros_inner_form_dict = plan_available_in_metros_inner.from_dict(plan_available_in_metros_inner_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/PlanIdName.md b/equinix/services/metalv1/docs/PlanIdName.md new file mode 100644 index 00000000..1c3ac666 --- /dev/null +++ b/equinix/services/metalv1/docs/PlanIdName.md @@ -0,0 +1,31 @@ +# PlanIdName + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_id_name import PlanIdName + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanIdName from a JSON string +plan_id_name_instance = PlanIdName.from_json(json) +# print the JSON string representation of the object +print(PlanIdName.to_json()) + +# convert the object into a dict +plan_id_name_dict = plan_id_name_instance.to_dict() +# create an instance of PlanIdName from a dict +plan_id_name_form_dict = plan_id_name.from_dict(plan_id_name_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/PlanList.md b/equinix/services/metalv1/docs/PlanList.md new file mode 100644 index 00000000..31b4c297 --- /dev/null +++ b/equinix/services/metalv1/docs/PlanList.md @@ -0,0 +1,30 @@ +# PlanList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**plans** | [**List[Plan]**](Plan.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_list import PlanList + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanList from a JSON string +plan_list_instance = PlanList.from_json(json) +# print the JSON string representation of the object +print(PlanList.to_json()) + +# convert the object into a dict +plan_list_dict = plan_list_instance.to_dict() +# create an instance of PlanList from a dict +plan_list_form_dict = plan_list.from_dict(plan_list_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/PlanSpecs.md b/equinix/services/metalv1/docs/PlanSpecs.md new file mode 100644 index 00000000..62d4a60e --- /dev/null +++ b/equinix/services/metalv1/docs/PlanSpecs.md @@ -0,0 +1,34 @@ +# PlanSpecs + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cpus** | [**List[PlanSpecsCpusInner]**](PlanSpecsCpusInner.md) | | [optional] +**drives** | [**List[PlanSpecsDrivesInner]**](PlanSpecsDrivesInner.md) | | [optional] +**features** | [**PlanSpecsFeatures**](PlanSpecsFeatures.md) | | [optional] +**href** | **str** | | [optional] +**memory** | [**PlanSpecsMemory**](PlanSpecsMemory.md) | | [optional] +**nics** | [**List[PlanSpecsNicsInner]**](PlanSpecsNicsInner.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_specs import PlanSpecs + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSpecs from a JSON string +plan_specs_instance = PlanSpecs.from_json(json) +# print the JSON string representation of the object +print(PlanSpecs.to_json()) + +# convert the object into a dict +plan_specs_dict = plan_specs_instance.to_dict() +# create an instance of PlanSpecs from a dict +plan_specs_form_dict = plan_specs.from_dict(plan_specs_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/PlanSpecsCpusInner.md b/equinix/services/metalv1/docs/PlanSpecsCpusInner.md new file mode 100644 index 00000000..e617a181 --- /dev/null +++ b/equinix/services/metalv1/docs/PlanSpecsCpusInner.md @@ -0,0 +1,31 @@ +# PlanSpecsCpusInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | | [optional] +**href** | **str** | | [optional] +**type** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_specs_cpus_inner import PlanSpecsCpusInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSpecsCpusInner from a JSON string +plan_specs_cpus_inner_instance = PlanSpecsCpusInner.from_json(json) +# print the JSON string representation of the object +print(PlanSpecsCpusInner.to_json()) + +# convert the object into a dict +plan_specs_cpus_inner_dict = plan_specs_cpus_inner_instance.to_dict() +# create an instance of PlanSpecsCpusInner from a dict +plan_specs_cpus_inner_form_dict = plan_specs_cpus_inner.from_dict(plan_specs_cpus_inner_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/PlanSpecsDrivesInner.md b/equinix/services/metalv1/docs/PlanSpecsDrivesInner.md new file mode 100644 index 00000000..dace9d17 --- /dev/null +++ b/equinix/services/metalv1/docs/PlanSpecsDrivesInner.md @@ -0,0 +1,33 @@ +# PlanSpecsDrivesInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | Values may include 'boot', 'cache', 'storage' | [optional] +**count** | **int** | | [optional] +**href** | **str** | | [optional] +**size** | **str** | | [optional] +**type** | **str** | Values may include 'HDD', 'SSD', 'NVME' | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_specs_drives_inner import PlanSpecsDrivesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSpecsDrivesInner from a JSON string +plan_specs_drives_inner_instance = PlanSpecsDrivesInner.from_json(json) +# print the JSON string representation of the object +print(PlanSpecsDrivesInner.to_json()) + +# convert the object into a dict +plan_specs_drives_inner_dict = plan_specs_drives_inner_instance.to_dict() +# create an instance of PlanSpecsDrivesInner from a dict +plan_specs_drives_inner_form_dict = plan_specs_drives_inner.from_dict(plan_specs_drives_inner_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/PlanSpecsFeatures.md b/equinix/services/metalv1/docs/PlanSpecsFeatures.md new file mode 100644 index 00000000..f68cb59d --- /dev/null +++ b/equinix/services/metalv1/docs/PlanSpecsFeatures.md @@ -0,0 +1,32 @@ +# PlanSpecsFeatures + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**raid** | **bool** | | [optional] +**txt** | **bool** | | [optional] +**uefi** | **bool** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_specs_features import PlanSpecsFeatures + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSpecsFeatures from a JSON string +plan_specs_features_instance = PlanSpecsFeatures.from_json(json) +# print the JSON string representation of the object +print(PlanSpecsFeatures.to_json()) + +# convert the object into a dict +plan_specs_features_dict = plan_specs_features_instance.to_dict() +# create an instance of PlanSpecsFeatures from a dict +plan_specs_features_form_dict = plan_specs_features.from_dict(plan_specs_features_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/PlanSpecsMemory.md b/equinix/services/metalv1/docs/PlanSpecsMemory.md new file mode 100644 index 00000000..dcb36954 --- /dev/null +++ b/equinix/services/metalv1/docs/PlanSpecsMemory.md @@ -0,0 +1,30 @@ +# PlanSpecsMemory + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**total** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_specs_memory import PlanSpecsMemory + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSpecsMemory from a JSON string +plan_specs_memory_instance = PlanSpecsMemory.from_json(json) +# print the JSON string representation of the object +print(PlanSpecsMemory.to_json()) + +# convert the object into a dict +plan_specs_memory_dict = plan_specs_memory_instance.to_dict() +# create an instance of PlanSpecsMemory from a dict +plan_specs_memory_form_dict = plan_specs_memory.from_dict(plan_specs_memory_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/PlanSpecsNicsInner.md b/equinix/services/metalv1/docs/PlanSpecsNicsInner.md new file mode 100644 index 00000000..382b6e9b --- /dev/null +++ b/equinix/services/metalv1/docs/PlanSpecsNicsInner.md @@ -0,0 +1,31 @@ +# PlanSpecsNicsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | | [optional] +**href** | **str** | | [optional] +**type** | **str** | Values may include '1Gbps', '10Gbps', '25Gbps' | [optional] + +## Example + +```python +from equinix.services.metalv1.models.plan_specs_nics_inner import PlanSpecsNicsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PlanSpecsNicsInner from a JSON string +plan_specs_nics_inner_instance = PlanSpecsNicsInner.from_json(json) +# print the JSON string representation of the object +print(PlanSpecsNicsInner.to_json()) + +# convert the object into a dict +plan_specs_nics_inner_dict = plan_specs_nics_inner_instance.to_dict() +# create an instance of PlanSpecsNicsInner from a dict +plan_specs_nics_inner_form_dict = plan_specs_nics_inner.from_dict(plan_specs_nics_inner_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/PlansApi.md b/equinix/services/metalv1/docs/PlansApi.md new file mode 100644 index 00000000..94341526 --- /dev/null +++ b/equinix/services/metalv1/docs/PlansApi.md @@ -0,0 +1,182 @@ +# equinix.services.metalv1.PlansApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_plans**](PlansApi.md#find_plans) | **GET** /plans | Retrieve all plans +[**find_plans_by_project**](PlansApi.md#find_plans_by_project) | **GET** /projects/{id}/plans | Retrieve all plans visible by the project + + +# **find_plans** +> PlanList find_plans(categories=categories, type=type, slug=slug, include=include, exclude=exclude) + +Retrieve all plans + +Provides a listing of available plans to provision your device on. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.plan_list import PlanList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PlansApi(api_client) + categories = ['categories_example'] # List[str] | Filter plans by its category (optional) + type = 'standard' # str | Filter plans by its plan type (optional) + slug = 'c3.small.x86' # str | Filter plans by slug (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve all plans + api_response = api_instance.find_plans(categories=categories, type=type, slug=slug, include=include, exclude=exclude) + print("The response of PlansApi->find_plans:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PlansApi->find_plans: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **categories** | [**List[str]**](str.md)| Filter plans by its category | [optional] + **type** | **str**| Filter plans by its plan type | [optional] + **slug** | **str**| Filter plans by slug | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**PlanList**](PlanList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_plans_by_project** +> PlanList find_plans_by_project(id, include=include, exclude=exclude) + +Retrieve all plans visible by the project + +Returns a listing of available plans for the given project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.plan_list import PlanList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PlansApi(api_client) + id = 'id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve all plans visible by the project + api_response = api_instance.find_plans_by_project(id, include=include, exclude=exclude) + print("The response of PlansApi->find_plans_by_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PlansApi->find_plans_by_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**PlanList**](PlanList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Port.md b/equinix/services/metalv1/docs/Port.md new file mode 100644 index 00000000..901c8ae0 --- /dev/null +++ b/equinix/services/metalv1/docs/Port.md @@ -0,0 +1,39 @@ +# Port + +Port is a hardware port associated with a reserved or instantiated hardware device. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bond** | [**BondPortData**](BondPortData.md) | | [optional] +**data** | [**PortData**](PortData.md) | | [optional] +**disbond_operation_supported** | **bool** | Indicates whether or not the bond can be broken on the port (when applicable). | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**native_virtual_network** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] +**network_type** | **str** | Composite network type of the bond | [optional] +**type** | **str** | Type is either \"NetworkBondPort\" for bond ports or \"NetworkPort\" for bondable ethernet ports | [optional] +**virtual_networks** | [**List[VirtualNetwork]**](VirtualNetwork.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port import Port + +# TODO update the JSON string below +json = "{}" +# create an instance of Port from a JSON string +port_instance = Port.from_json(json) +# print the JSON string representation of the object +print(Port.to_json()) + +# convert the object into a dict +port_dict = port_instance.to_dict() +# create an instance of Port from a dict +port_form_dict = port.from_dict(port_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/PortAssignInput.md b/equinix/services/metalv1/docs/PortAssignInput.md new file mode 100644 index 00000000..77238461 --- /dev/null +++ b/equinix/services/metalv1/docs/PortAssignInput.md @@ -0,0 +1,30 @@ +# PortAssignInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**vnid** | **str** | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_assign_input import PortAssignInput + +# TODO update the JSON string below +json = "{}" +# create an instance of PortAssignInput from a JSON string +port_assign_input_instance = PortAssignInput.from_json(json) +# print the JSON string representation of the object +print(PortAssignInput.to_json()) + +# convert the object into a dict +port_assign_input_dict = port_assign_input_instance.to_dict() +# create an instance of PortAssignInput from a dict +port_assign_input_form_dict = port_assign_input.from_dict(port_assign_input_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/PortConvertLayer3Input.md b/equinix/services/metalv1/docs/PortConvertLayer3Input.md new file mode 100644 index 00000000..a805ed34 --- /dev/null +++ b/equinix/services/metalv1/docs/PortConvertLayer3Input.md @@ -0,0 +1,30 @@ +# PortConvertLayer3Input + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**request_ips** | [**List[PortConvertLayer3InputRequestIpsInner]**](PortConvertLayer3InputRequestIpsInner.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_convert_layer3_input import PortConvertLayer3Input + +# TODO update the JSON string below +json = "{}" +# create an instance of PortConvertLayer3Input from a JSON string +port_convert_layer3_input_instance = PortConvertLayer3Input.from_json(json) +# print the JSON string representation of the object +print(PortConvertLayer3Input.to_json()) + +# convert the object into a dict +port_convert_layer3_input_dict = port_convert_layer3_input_instance.to_dict() +# create an instance of PortConvertLayer3Input from a dict +port_convert_layer3_input_form_dict = port_convert_layer3_input.from_dict(port_convert_layer3_input_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/PortConvertLayer3InputRequestIpsInner.md b/equinix/services/metalv1/docs/PortConvertLayer3InputRequestIpsInner.md new file mode 100644 index 00000000..ea29c697 --- /dev/null +++ b/equinix/services/metalv1/docs/PortConvertLayer3InputRequestIpsInner.md @@ -0,0 +1,31 @@ +# PortConvertLayer3InputRequestIpsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_family** | **int** | | [optional] +**href** | **str** | | [optional] +**public** | **bool** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_convert_layer3_input_request_ips_inner import PortConvertLayer3InputRequestIpsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PortConvertLayer3InputRequestIpsInner from a JSON string +port_convert_layer3_input_request_ips_inner_instance = PortConvertLayer3InputRequestIpsInner.from_json(json) +# print the JSON string representation of the object +print(PortConvertLayer3InputRequestIpsInner.to_json()) + +# convert the object into a dict +port_convert_layer3_input_request_ips_inner_dict = port_convert_layer3_input_request_ips_inner_instance.to_dict() +# create an instance of PortConvertLayer3InputRequestIpsInner from a dict +port_convert_layer3_input_request_ips_inner_form_dict = port_convert_layer3_input_request_ips_inner.from_dict(port_convert_layer3_input_request_ips_inner_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/PortData.md b/equinix/services/metalv1/docs/PortData.md new file mode 100644 index 00000000..ed2526a4 --- /dev/null +++ b/equinix/services/metalv1/docs/PortData.md @@ -0,0 +1,31 @@ +# PortData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bonded** | **bool** | Bonded is true for NetworkPort ports in a bond and NetworkBondPort ports that are active | [optional] +**href** | **str** | | [optional] +**mac** | **str** | MAC address is set for NetworkPort ports | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_data import PortData + +# TODO update the JSON string below +json = "{}" +# create an instance of PortData from a JSON string +port_data_instance = PortData.from_json(json) +# print the JSON string representation of the object +print(PortData.to_json()) + +# convert the object into a dict +port_data_dict = port_data_instance.to_dict() +# create an instance of PortData from a dict +port_data_form_dict = port_data.from_dict(port_data_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/PortVlanAssignment.md b/equinix/services/metalv1/docs/PortVlanAssignment.md new file mode 100644 index 00000000..061ed387 --- /dev/null +++ b/equinix/services/metalv1/docs/PortVlanAssignment.md @@ -0,0 +1,37 @@ +# PortVlanAssignment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**native** | **bool** | | [optional] +**port** | [**Href**](Href.md) | | [optional] +**state** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] +**virtual_network** | [**Href**](Href.md) | | [optional] +**vlan** | **int** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_vlan_assignment import PortVlanAssignment + +# TODO update the JSON string below +json = "{}" +# create an instance of PortVlanAssignment from a JSON string +port_vlan_assignment_instance = PortVlanAssignment.from_json(json) +# print the JSON string representation of the object +print(PortVlanAssignment.to_json()) + +# convert the object into a dict +port_vlan_assignment_dict = port_vlan_assignment_instance.to_dict() +# create an instance of PortVlanAssignment from a dict +port_vlan_assignment_form_dict = port_vlan_assignment.from_dict(port_vlan_assignment_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/PortVlanAssignmentBatch.md b/equinix/services/metalv1/docs/PortVlanAssignmentBatch.md new file mode 100644 index 00000000..2774a5fc --- /dev/null +++ b/equinix/services/metalv1/docs/PortVlanAssignmentBatch.md @@ -0,0 +1,38 @@ +# PortVlanAssignmentBatch + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**error_messages** | **List[str]** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**port** | [**Port**](Port.md) | | [optional] +**project** | [**Href**](Href.md) | | [optional] +**quantity** | **int** | | [optional] +**state** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] +**vlan_assignments** | [**List[PortVlanAssignmentBatchVlanAssignmentsInner]**](PortVlanAssignmentBatchVlanAssignmentsInner.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_vlan_assignment_batch import PortVlanAssignmentBatch + +# TODO update the JSON string below +json = "{}" +# create an instance of PortVlanAssignmentBatch from a JSON string +port_vlan_assignment_batch_instance = PortVlanAssignmentBatch.from_json(json) +# print the JSON string representation of the object +print(PortVlanAssignmentBatch.to_json()) + +# convert the object into a dict +port_vlan_assignment_batch_dict = port_vlan_assignment_batch_instance.to_dict() +# create an instance of PortVlanAssignmentBatch from a dict +port_vlan_assignment_batch_form_dict = port_vlan_assignment_batch.from_dict(port_vlan_assignment_batch_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/PortVlanAssignmentBatchCreateInput.md b/equinix/services/metalv1/docs/PortVlanAssignmentBatchCreateInput.md new file mode 100644 index 00000000..0c0ef772 --- /dev/null +++ b/equinix/services/metalv1/docs/PortVlanAssignmentBatchCreateInput.md @@ -0,0 +1,30 @@ +# PortVlanAssignmentBatchCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**vlan_assignments** | [**List[PortVlanAssignmentBatchCreateInputVlanAssignmentsInner]**](PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_vlan_assignment_batch_create_input import PortVlanAssignmentBatchCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of PortVlanAssignmentBatchCreateInput from a JSON string +port_vlan_assignment_batch_create_input_instance = PortVlanAssignmentBatchCreateInput.from_json(json) +# print the JSON string representation of the object +print(PortVlanAssignmentBatchCreateInput.to_json()) + +# convert the object into a dict +port_vlan_assignment_batch_create_input_dict = port_vlan_assignment_batch_create_input_instance.to_dict() +# create an instance of PortVlanAssignmentBatchCreateInput from a dict +port_vlan_assignment_batch_create_input_form_dict = port_vlan_assignment_batch_create_input.from_dict(port_vlan_assignment_batch_create_input_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/PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.md b/equinix/services/metalv1/docs/PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.md new file mode 100644 index 00000000..6aa831b0 --- /dev/null +++ b/equinix/services/metalv1/docs/PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.md @@ -0,0 +1,32 @@ +# PortVlanAssignmentBatchCreateInputVlanAssignmentsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**native** | **bool** | | [optional] +**state** | **str** | | [optional] +**vlan** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_vlan_assignment_batch_create_input_vlan_assignments_inner import PortVlanAssignmentBatchCreateInputVlanAssignmentsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PortVlanAssignmentBatchCreateInputVlanAssignmentsInner from a JSON string +port_vlan_assignment_batch_create_input_vlan_assignments_inner_instance = PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.from_json(json) +# print the JSON string representation of the object +print(PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.to_json()) + +# convert the object into a dict +port_vlan_assignment_batch_create_input_vlan_assignments_inner_dict = port_vlan_assignment_batch_create_input_vlan_assignments_inner_instance.to_dict() +# create an instance of PortVlanAssignmentBatchCreateInputVlanAssignmentsInner from a dict +port_vlan_assignment_batch_create_input_vlan_assignments_inner_form_dict = port_vlan_assignment_batch_create_input_vlan_assignments_inner.from_dict(port_vlan_assignment_batch_create_input_vlan_assignments_inner_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/PortVlanAssignmentBatchList.md b/equinix/services/metalv1/docs/PortVlanAssignmentBatchList.md new file mode 100644 index 00000000..ed882a37 --- /dev/null +++ b/equinix/services/metalv1/docs/PortVlanAssignmentBatchList.md @@ -0,0 +1,30 @@ +# PortVlanAssignmentBatchList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**batches** | [**List[PortVlanAssignmentBatch]**](PortVlanAssignmentBatch.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_vlan_assignment_batch_list import PortVlanAssignmentBatchList + +# TODO update the JSON string below +json = "{}" +# create an instance of PortVlanAssignmentBatchList from a JSON string +port_vlan_assignment_batch_list_instance = PortVlanAssignmentBatchList.from_json(json) +# print the JSON string representation of the object +print(PortVlanAssignmentBatchList.to_json()) + +# convert the object into a dict +port_vlan_assignment_batch_list_dict = port_vlan_assignment_batch_list_instance.to_dict() +# create an instance of PortVlanAssignmentBatchList from a dict +port_vlan_assignment_batch_list_form_dict = port_vlan_assignment_batch_list.from_dict(port_vlan_assignment_batch_list_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/PortVlanAssignmentBatchVlanAssignmentsInner.md b/equinix/services/metalv1/docs/PortVlanAssignmentBatchVlanAssignmentsInner.md new file mode 100644 index 00000000..fababee8 --- /dev/null +++ b/equinix/services/metalv1/docs/PortVlanAssignmentBatchVlanAssignmentsInner.md @@ -0,0 +1,33 @@ +# PortVlanAssignmentBatchVlanAssignmentsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**native** | **bool** | | [optional] +**state** | **str** | | [optional] +**vlan** | **int** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_vlan_assignment_batch_vlan_assignments_inner import PortVlanAssignmentBatchVlanAssignmentsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PortVlanAssignmentBatchVlanAssignmentsInner from a JSON string +port_vlan_assignment_batch_vlan_assignments_inner_instance = PortVlanAssignmentBatchVlanAssignmentsInner.from_json(json) +# print the JSON string representation of the object +print(PortVlanAssignmentBatchVlanAssignmentsInner.to_json()) + +# convert the object into a dict +port_vlan_assignment_batch_vlan_assignments_inner_dict = port_vlan_assignment_batch_vlan_assignments_inner_instance.to_dict() +# create an instance of PortVlanAssignmentBatchVlanAssignmentsInner from a dict +port_vlan_assignment_batch_vlan_assignments_inner_form_dict = port_vlan_assignment_batch_vlan_assignments_inner.from_dict(port_vlan_assignment_batch_vlan_assignments_inner_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/PortVlanAssignmentList.md b/equinix/services/metalv1/docs/PortVlanAssignmentList.md new file mode 100644 index 00000000..e509640f --- /dev/null +++ b/equinix/services/metalv1/docs/PortVlanAssignmentList.md @@ -0,0 +1,30 @@ +# PortVlanAssignmentList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**vlan_assignments** | [**List[PortVlanAssignment]**](PortVlanAssignment.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.port_vlan_assignment_list import PortVlanAssignmentList + +# TODO update the JSON string below +json = "{}" +# create an instance of PortVlanAssignmentList from a JSON string +port_vlan_assignment_list_instance = PortVlanAssignmentList.from_json(json) +# print the JSON string representation of the object +print(PortVlanAssignmentList.to_json()) + +# convert the object into a dict +port_vlan_assignment_list_dict = port_vlan_assignment_list_instance.to_dict() +# create an instance of PortVlanAssignmentList from a dict +port_vlan_assignment_list_form_dict = port_vlan_assignment_list.from_dict(port_vlan_assignment_list_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/PortsApi.md b/equinix/services/metalv1/docs/PortsApi.md new file mode 100644 index 00000000..cdbc8312 --- /dev/null +++ b/equinix/services/metalv1/docs/PortsApi.md @@ -0,0 +1,1213 @@ +# equinix.services.metalv1.PortsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**assign_native_vlan**](PortsApi.md#assign_native_vlan) | **POST** /ports/{id}/native-vlan | Assign a native VLAN +[**assign_port**](PortsApi.md#assign_port) | **POST** /ports/{id}/assign | Assign a port to virtual network +[**bond_port**](PortsApi.md#bond_port) | **POST** /ports/{id}/bond | Enabling bonding +[**convert_layer2**](PortsApi.md#convert_layer2) | **POST** /ports/{id}/convert/layer-2 | Convert to Layer 2 +[**convert_layer3**](PortsApi.md#convert_layer3) | **POST** /ports/{id}/convert/layer-3 | Convert to Layer 3 +[**create_port_vlan_assignment_batch**](PortsApi.md#create_port_vlan_assignment_batch) | **POST** /ports/{id}/vlan-assignments/batches | Create a new Port-VLAN Assignment management batch +[**delete_native_vlan**](PortsApi.md#delete_native_vlan) | **DELETE** /ports/{id}/native-vlan | Remove native VLAN +[**disbond_port**](PortsApi.md#disbond_port) | **POST** /ports/{id}/disbond | Disabling bonding +[**find_port_by_id**](PortsApi.md#find_port_by_id) | **GET** /ports/{id} | Retrieve a port +[**find_port_vlan_assignment_batch_by_port_id_and_batch_id**](PortsApi.md#find_port_vlan_assignment_batch_by_port_id_and_batch_id) | **GET** /ports/{id}/vlan-assignments/batches/{batch_id} | Retrieve a VLAN Assignment Batch's details +[**find_port_vlan_assignment_batches**](PortsApi.md#find_port_vlan_assignment_batches) | **GET** /ports/{id}/vlan-assignments/batches | List the VLAN Assignment Batches for a port +[**find_port_vlan_assignment_by_port_id_and_assignment_id**](PortsApi.md#find_port_vlan_assignment_by_port_id_and_assignment_id) | **GET** /ports/{id}/vlan-assignments/{assignment_id} | Show a particular Port VLAN assignment's details +[**find_port_vlan_assignments**](PortsApi.md#find_port_vlan_assignments) | **GET** /ports/{id}/vlan-assignments | List Current VLAN assignments for a port +[**unassign_port**](PortsApi.md#unassign_port) | **POST** /ports/{id}/unassign | Unassign a port + + +# **assign_native_vlan** +> Port assign_native_vlan(id, vnid, include=include) + +Assign a native VLAN + +Sets a virtual network on this port as a \"native VLAN\". The VLAN must have already been assigned using the using the \"Assign a port to a virtual network\" operation. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + vnid = 'vnid_example' # str | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Assign a native VLAN + api_response = api_instance.assign_native_vlan(id, vnid, include=include) + print("The response of PortsApi->assign_native_vlan:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->assign_native_vlan: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **vnid** | **str**| Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **assign_port** +> Port assign_port(id, port_assign_input, include=include) + +Assign a port to virtual network + +Assign a hardware port to a virtual network. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.models.port_assign_input import PortAssignInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + port_assign_input = equinix.services.metalv1.PortAssignInput() # PortAssignInput | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Assign a port to virtual network + api_response = api_instance.assign_port(id, port_assign_input, include=include) + print("The response of PortsApi->assign_port:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->assign_port: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **port_assign_input** | [**PortAssignInput**](PortAssignInput.md)| Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **bond_port** +> Port bond_port(id, bulk_enable=bulk_enable, include=include) + +Enabling bonding + +Enabling bonding for one or all ports + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + bulk_enable = True # bool | enable both ports (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Enabling bonding + api_response = api_instance.bond_port(id, bulk_enable=bulk_enable, include=include) + print("The response of PortsApi->bond_port:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->bond_port: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **bulk_enable** | **bool**| enable both ports | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **convert_layer2** +> Port convert_layer2(id, port_assign_input, include=include) + +Convert to Layer 2 + +Converts a bond port to Layer 2. IP assignments of the port will be removed. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.models.port_assign_input import PortAssignInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + port_assign_input = equinix.services.metalv1.PortAssignInput() # PortAssignInput | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Convert to Layer 2 + api_response = api_instance.convert_layer2(id, port_assign_input, include=include) + print("The response of PortsApi->convert_layer2:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->convert_layer2: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **port_assign_input** | [**PortAssignInput**](PortAssignInput.md)| Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **convert_layer3** +> Port convert_layer3(id, include=include, port_convert_layer3_input=port_convert_layer3_input) + +Convert to Layer 3 + +Converts a bond port to Layer 3. VLANs must first be unassigned. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.models.port_convert_layer3_input import PortConvertLayer3Input +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + port_convert_layer3_input = equinix.services.metalv1.PortConvertLayer3Input() # PortConvertLayer3Input | IPs to request (optional) + + try: + # Convert to Layer 3 + api_response = api_instance.convert_layer3(id, include=include, port_convert_layer3_input=port_convert_layer3_input) + print("The response of PortsApi->convert_layer3:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->convert_layer3: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **port_convert_layer3_input** | [**PortConvertLayer3Input**](PortConvertLayer3Input.md)| IPs to request | [optional] + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_port_vlan_assignment_batch** +> PortVlanAssignmentBatch create_port_vlan_assignment_batch(id, port_vlan_assignment_batch_create_input, include=include) + +Create a new Port-VLAN Assignment management batch + +Create a new asynchronous batch request which handles adding and/or removing the VLANs to which the port is assigned. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port_vlan_assignment_batch import PortVlanAssignmentBatch +from equinix.services.metalv1.models.port_vlan_assignment_batch_create_input import PortVlanAssignmentBatchCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + port_vlan_assignment_batch_create_input = equinix.services.metalv1.PortVlanAssignmentBatchCreateInput() # PortVlanAssignmentBatchCreateInput | VLAN Assignment batch details + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create a new Port-VLAN Assignment management batch + api_response = api_instance.create_port_vlan_assignment_batch(id, port_vlan_assignment_batch_create_input, include=include) + print("The response of PortsApi->create_port_vlan_assignment_batch:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->create_port_vlan_assignment_batch: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **port_vlan_assignment_batch_create_input** | [**PortVlanAssignmentBatchCreateInput**](PortVlanAssignmentBatchCreateInput.md)| VLAN Assignment batch details | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**PortVlanAssignmentBatch**](PortVlanAssignmentBatch.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_native_vlan** +> Port delete_native_vlan(id, include=include) + +Remove native VLAN + +Removes the native VLAN from this port + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Remove native VLAN + api_response = api_instance.delete_native_vlan(id, include=include) + print("The response of PortsApi->delete_native_vlan:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->delete_native_vlan: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **disbond_port** +> Port disbond_port(id, bulk_disable=bulk_disable, include=include) + +Disabling bonding + +Disabling bonding for one or all ports + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + bulk_disable = True # bool | disable both ports (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Disabling bonding + api_response = api_instance.disbond_port(id, bulk_disable=bulk_disable, include=include) + print("The response of PortsApi->disbond_port:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->disbond_port: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **bulk_disable** | **bool**| disable both ports | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_port_by_id** +> Port find_port_by_id(id, include=include) + +Retrieve a port + +Returns a port + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a port + api_response = api_instance.find_port_by_id(id, include=include) + print("The response of PortsApi->find_port_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->find_port_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_port_vlan_assignment_batch_by_port_id_and_batch_id** +> PortVlanAssignmentBatch find_port_vlan_assignment_batch_by_port_id_and_batch_id(id, batch_id, include=include) + +Retrieve a VLAN Assignment Batch's details + +Returns the details of an existing Port-VLAN Assignment batch, including the list of VLANs to assign or unassign, and the current state of the batch. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port_vlan_assignment_batch import PortVlanAssignmentBatch +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + batch_id = 'batch_id_example' # str | Batch ID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a VLAN Assignment Batch's details + api_response = api_instance.find_port_vlan_assignment_batch_by_port_id_and_batch_id(id, batch_id, include=include) + print("The response of PortsApi->find_port_vlan_assignment_batch_by_port_id_and_batch_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->find_port_vlan_assignment_batch_by_port_id_and_batch_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **batch_id** | **str**| Batch ID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**PortVlanAssignmentBatch**](PortVlanAssignmentBatch.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_port_vlan_assignment_batches** +> PortVlanAssignmentBatchList find_port_vlan_assignment_batches(id) + +List the VLAN Assignment Batches for a port + +Show all the VLAN assignment batches that have been created for managing this port's VLAN assignments + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port_vlan_assignment_batch_list import PortVlanAssignmentBatchList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + + try: + # List the VLAN Assignment Batches for a port + api_response = api_instance.find_port_vlan_assignment_batches(id) + print("The response of PortsApi->find_port_vlan_assignment_batches:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->find_port_vlan_assignment_batches: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + +### Return type + +[**PortVlanAssignmentBatchList**](PortVlanAssignmentBatchList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_port_vlan_assignment_by_port_id_and_assignment_id** +> PortVlanAssignment find_port_vlan_assignment_by_port_id_and_assignment_id(id, assignment_id, include=include) + +Show a particular Port VLAN assignment's details + +Show the details of a specific Port-VLAN assignment, including the current state and if the VLAN is set as native. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port_vlan_assignment import PortVlanAssignment +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + assignment_id = 'assignment_id_example' # str | Assignment ID + include = ["port","virtual_network"] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) (default to ["port","virtual_network"]) + + try: + # Show a particular Port VLAN assignment's details + api_response = api_instance.find_port_vlan_assignment_by_port_id_and_assignment_id(id, assignment_id, include=include) + print("The response of PortsApi->find_port_vlan_assignment_by_port_id_and_assignment_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->find_port_vlan_assignment_by_port_id_and_assignment_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **assignment_id** | **str**| Assignment ID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] [default to ["port","virtual_network"]] + +### Return type + +[**PortVlanAssignment**](PortVlanAssignment.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_port_vlan_assignments** +> PortVlanAssignmentList find_port_vlan_assignments(id, include=include) + +List Current VLAN assignments for a port + +Show the port's current VLAN assignments, including if this VLAN is set as native, and the current state of the assignment (ex. 'assigned' or 'unassigning') + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port_vlan_assignment_list import PortVlanAssignmentList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + include = ["port","virtual_network"] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) (default to ["port","virtual_network"]) + + try: + # List Current VLAN assignments for a port + api_response = api_instance.find_port_vlan_assignments(id, include=include) + print("The response of PortsApi->find_port_vlan_assignments:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->find_port_vlan_assignments: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] [default to ["port","virtual_network"]] + +### Return type + +[**PortVlanAssignmentList**](PortVlanAssignmentList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **unassign_port** +> Port unassign_port(id, port_assign_input, include=include) + +Unassign a port + +Unassign a port for a hardware. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.models.port_assign_input import PortAssignInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.PortsApi(api_client) + id = 'id_example' # str | Port UUID + port_assign_input = equinix.services.metalv1.PortAssignInput() # PortAssignInput | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Unassign a port + api_response = api_instance.unassign_port(id, port_assign_input, include=include) + print("The response of PortsApi->unassign_port:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PortsApi->unassign_port: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Port UUID | + **port_assign_input** | [**PortAssignInput**](PortAssignInput.md)| Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Project.md b/equinix/services/metalv1/docs/Project.md new file mode 100644 index 00000000..65c5193b --- /dev/null +++ b/equinix/services/metalv1/docs/Project.md @@ -0,0 +1,49 @@ +# Project + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**backend_transfer_enabled** | **bool** | | [optional] +**bgp_config** | [**Href**](Href.md) | | [optional] +**created_at** | **datetime** | | [optional] +**customdata** | **object** | | [optional] +**devices** | [**List[Href]**](Href.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**invitations** | [**List[Href]**](Href.md) | | [optional] +**max_devices** | **object** | | [optional] +**members** | [**List[Href]**](Href.md) | | [optional] +**memberships** | [**List[Href]**](Href.md) | | [optional] +**name** | **str** | The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. | [optional] +**network_status** | **object** | | [optional] +**organization** | [**Href**](Href.md) | | [optional] +**payment_method** | [**Href**](Href.md) | | [optional] +**ssh_keys** | [**List[Href]**](Href.md) | | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers. | [optional] +**updated_at** | **datetime** | | [optional] +**url** | **str** | | [optional] +**volumes** | [**List[Href]**](Href.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.project import Project + +# TODO update the JSON string below +json = "{}" +# create an instance of Project from a JSON string +project_instance = Project.from_json(json) +# print the JSON string representation of the object +print(Project.to_json()) + +# convert the object into a dict +project_dict = project_instance.to_dict() +# create an instance of Project from a dict +project_form_dict = project.from_dict(project_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/ProjectCreateFromRootInput.md b/equinix/services/metalv1/docs/ProjectCreateFromRootInput.md new file mode 100644 index 00000000..1cb68bc4 --- /dev/null +++ b/equinix/services/metalv1/docs/ProjectCreateFromRootInput.md @@ -0,0 +1,35 @@ +# ProjectCreateFromRootInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customdata** | **object** | | [optional] +**href** | **str** | | [optional] +**name** | **str** | The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. | +**organization_id** | **str** | | [optional] +**payment_method_id** | **str** | | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | The type of the project. If no type is specified the project type will automatically be `default` Projects of type 'vmce' are part of an in development feature and not available to all customers. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.project_create_from_root_input import ProjectCreateFromRootInput + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectCreateFromRootInput from a JSON string +project_create_from_root_input_instance = ProjectCreateFromRootInput.from_json(json) +# print the JSON string representation of the object +print(ProjectCreateFromRootInput.to_json()) + +# convert the object into a dict +project_create_from_root_input_dict = project_create_from_root_input_instance.to_dict() +# create an instance of ProjectCreateFromRootInput from a dict +project_create_from_root_input_form_dict = project_create_from_root_input.from_dict(project_create_from_root_input_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/ProjectCreateInput.md b/equinix/services/metalv1/docs/ProjectCreateInput.md new file mode 100644 index 00000000..c9473243 --- /dev/null +++ b/equinix/services/metalv1/docs/ProjectCreateInput.md @@ -0,0 +1,34 @@ +# ProjectCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customdata** | **object** | | [optional] +**href** | **str** | | [optional] +**name** | **str** | The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. | +**payment_method_id** | **str** | | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | The type of the project. If no type is specified the project type will automatically be `default` Projects of type 'vmce' are part of an in development feature and not available to all customers. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.project_create_input import ProjectCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectCreateInput from a JSON string +project_create_input_instance = ProjectCreateInput.from_json(json) +# print the JSON string representation of the object +print(ProjectCreateInput.to_json()) + +# convert the object into a dict +project_create_input_dict = project_create_input_instance.to_dict() +# create an instance of ProjectCreateInput from a dict +project_create_input_form_dict = project_create_input.from_dict(project_create_input_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/ProjectIdName.md b/equinix/services/metalv1/docs/ProjectIdName.md new file mode 100644 index 00000000..16001e0c --- /dev/null +++ b/equinix/services/metalv1/docs/ProjectIdName.md @@ -0,0 +1,31 @@ +# ProjectIdName + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.project_id_name import ProjectIdName + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectIdName from a JSON string +project_id_name_instance = ProjectIdName.from_json(json) +# print the JSON string representation of the object +print(ProjectIdName.to_json()) + +# convert the object into a dict +project_id_name_dict = project_id_name_instance.to_dict() +# create an instance of ProjectIdName from a dict +project_id_name_form_dict = project_id_name.from_dict(project_id_name_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/ProjectList.md b/equinix/services/metalv1/docs/ProjectList.md new file mode 100644 index 00000000..35bf35d2 --- /dev/null +++ b/equinix/services/metalv1/docs/ProjectList.md @@ -0,0 +1,31 @@ +# ProjectList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] +**projects** | [**List[Project]**](Project.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.project_list import ProjectList + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectList from a JSON string +project_list_instance = ProjectList.from_json(json) +# print the JSON string representation of the object +print(ProjectList.to_json()) + +# convert the object into a dict +project_list_dict = project_list_instance.to_dict() +# create an instance of ProjectList from a dict +project_list_form_dict = project_list.from_dict(project_list_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/ProjectUpdateInput.md b/equinix/services/metalv1/docs/ProjectUpdateInput.md new file mode 100644 index 00000000..d4066d86 --- /dev/null +++ b/equinix/services/metalv1/docs/ProjectUpdateInput.md @@ -0,0 +1,34 @@ +# ProjectUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**backend_transfer_enabled** | **bool** | | [optional] +**customdata** | **object** | | [optional] +**href** | **str** | | [optional] +**name** | **str** | The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. | [optional] +**payment_method_id** | **str** | | [optional] +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.project_update_input import ProjectUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectUpdateInput from a JSON string +project_update_input_instance = ProjectUpdateInput.from_json(json) +# print the JSON string representation of the object +print(ProjectUpdateInput.to_json()) + +# convert the object into a dict +project_update_input_dict = project_update_input_instance.to_dict() +# create an instance of ProjectUpdateInput from a dict +project_update_input_form_dict = project_update_input.from_dict(project_update_input_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/ProjectUsage.md b/equinix/services/metalv1/docs/ProjectUsage.md new file mode 100644 index 00000000..d52381cd --- /dev/null +++ b/equinix/services/metalv1/docs/ProjectUsage.md @@ -0,0 +1,38 @@ +# ProjectUsage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**facility** | **str** | | [optional] +**href** | **str** | | [optional] +**name** | **str** | | [optional] +**plan** | **str** | | [optional] +**plan_version** | **str** | | [optional] +**price** | **str** | | [optional] +**quantity** | **str** | | [optional] +**total** | **str** | | [optional] +**type** | **str** | | [optional] +**unit** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.project_usage import ProjectUsage + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectUsage from a JSON string +project_usage_instance = ProjectUsage.from_json(json) +# print the JSON string representation of the object +print(ProjectUsage.to_json()) + +# convert the object into a dict +project_usage_dict = project_usage_instance.to_dict() +# create an instance of ProjectUsage from a dict +project_usage_form_dict = project_usage.from_dict(project_usage_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/ProjectUsageList.md b/equinix/services/metalv1/docs/ProjectUsageList.md new file mode 100644 index 00000000..3b3be8dc --- /dev/null +++ b/equinix/services/metalv1/docs/ProjectUsageList.md @@ -0,0 +1,30 @@ +# ProjectUsageList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**usages** | [**List[ProjectUsage]**](ProjectUsage.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.project_usage_list import ProjectUsageList + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectUsageList from a JSON string +project_usage_list_instance = ProjectUsageList.from_json(json) +# print the JSON string representation of the object +print(ProjectUsageList.to_json()) + +# convert the object into a dict +project_usage_list_dict = project_usage_list_instance.to_dict() +# create an instance of ProjectUsageList from a dict +project_usage_list_form_dict = project_usage_list.from_dict(project_usage_list_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/ProjectsApi.md b/equinix/services/metalv1/docs/ProjectsApi.md new file mode 100644 index 00000000..38bb1766 --- /dev/null +++ b/equinix/services/metalv1/docs/ProjectsApi.md @@ -0,0 +1,955 @@ +# equinix.services.metalv1.ProjectsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_project**](ProjectsApi.md#create_project) | **POST** /projects | Create a project +[**create_project_invitation**](ProjectsApi.md#create_project_invitation) | **POST** /projects/{project_id}/invitations | Create an invitation for a project +[**create_transfer_request**](ProjectsApi.md#create_transfer_request) | **POST** /projects/{id}/transfers | Create a transfer request +[**delete_project**](ProjectsApi.md#delete_project) | **DELETE** /projects/{id} | Delete the project +[**find_ip_reservation_customdata**](ProjectsApi.md#find_ip_reservation_customdata) | **GET** /projects/{project_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Reservation +[**find_project_by_id**](ProjectsApi.md#find_project_by_id) | **GET** /projects/{id} | Retrieve a project +[**find_project_customdata**](ProjectsApi.md#find_project_customdata) | **GET** /projects/{id}/customdata | Retrieve the custom metadata of a project +[**find_project_invitations**](ProjectsApi.md#find_project_invitations) | **GET** /projects/{project_id}/invitations | Retrieve project invitations +[**find_project_memberships**](ProjectsApi.md#find_project_memberships) | **GET** /projects/{project_id}/memberships | Retrieve project memberships +[**find_projects**](ProjectsApi.md#find_projects) | **GET** /projects | Retrieve all projects +[**find_projects_all_pages**](ProjectsApi.md#find_projects_all_pages) | **GET** /projects | Retrieve all projects, fetches all the pages +[**update_project**](ProjectsApi.md#update_project) | **PUT** /projects/{id} | Update the project + + +# **create_project** +> Project create_project(project_create_from_root_input, include=include, exclude=exclude) + +Create a project + +Creates a new project for the user's default organization. If the user does not have a default organization, the API will look for a personal organization belonging to the user with the name \"{User's Full Name} Projects\" to associate the project with. If that organization does not exist a new organization named \"{User's Full Name} Projects\" will be created and the new project will be tied to that organization. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.project_create_from_root_input import ProjectCreateFromRootInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + project_create_from_root_input = equinix.services.metalv1.ProjectCreateFromRootInput() # ProjectCreateFromRootInput | Project to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create a project + api_response = api_instance.create_project(project_create_from_root_input, include=include, exclude=exclude) + print("The response of ProjectsApi->create_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->create_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_create_from_root_input** | [**ProjectCreateFromRootInput**](ProjectCreateFromRootInput.md)| Project to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Project**](Project.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_project_invitation** +> Invitation create_project_invitation(project_id, invitation_input, include=include) + +Create an invitation for a project + +In order to add a user to a project, they must first be invited. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.invitation import Invitation +from equinix.services.metalv1.models.invitation_input import InvitationInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + project_id = 'project_id_example' # str | Project UUID + invitation_input = equinix.services.metalv1.InvitationInput() # InvitationInput | Invitation to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create an invitation for a project + api_response = api_instance.create_project_invitation(project_id, invitation_input, include=include) + print("The response of ProjectsApi->create_project_invitation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->create_project_invitation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Project UUID | + **invitation_input** | [**InvitationInput**](InvitationInput.md)| Invitation to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**Invitation**](Invitation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_transfer_request** +> TransferRequest create_transfer_request(id, transfer_request_input, include=include) + +Create a transfer request + +Organization owners can transfer their projects to other organizations. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.transfer_request import TransferRequest +from equinix.services.metalv1.models.transfer_request_input import TransferRequestInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + id = 'id_example' # str | UUID of the project to be transferred + transfer_request_input = equinix.services.metalv1.TransferRequestInput() # TransferRequestInput | Transfer Request to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create a transfer request + api_response = api_instance.create_transfer_request(id, transfer_request_input, include=include) + print("The response of ProjectsApi->create_transfer_request:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->create_transfer_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| UUID of the project to be transferred | + **transfer_request_input** | [**TransferRequestInput**](TransferRequestInput.md)| Transfer Request to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**TransferRequest**](TransferRequest.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_project** +> delete_project(id) + +Delete the project + +Deletes the project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + id = 'id_example' # str | Project UUID + + try: + # Delete the project + api_instance.delete_project(id) + except Exception as e: + print("Exception when calling ProjectsApi->delete_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_ip_reservation_customdata** +> find_ip_reservation_customdata(project_id, id) + +Retrieve the custom metadata of an IP Reservation + +Provides the custom metadata stored for this IP Reservation in json format + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + project_id = 'project_id_example' # str | Project UUID + id = 'id_example' # str | Ip Reservation UUID + + try: + # Retrieve the custom metadata of an IP Reservation + api_instance.find_ip_reservation_customdata(project_id, id) + except Exception as e: + print("Exception when calling ProjectsApi->find_ip_reservation_customdata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Project UUID | + **id** | **str**| Ip Reservation UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_by_id** +> Project find_project_by_id(id, include=include, exclude=exclude) + +Retrieve a project + +Returns a single project if the user has access + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + id = 'id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve a project + api_response = api_instance.find_project_by_id(id, include=include, exclude=exclude) + print("The response of ProjectsApi->find_project_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->find_project_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Project**](Project.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_customdata** +> find_project_customdata(id) + +Retrieve the custom metadata of a project + +Provides the custom metadata stored for this project in json format + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + id = 'id_example' # str | Project UUID + + try: + # Retrieve the custom metadata of a project + api_instance.find_project_customdata(id) + except Exception as e: + print("Exception when calling ProjectsApi->find_project_customdata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_invitations** +> InvitationList find_project_invitations(project_id, include=include, page=page, per_page=per_page) + +Retrieve project invitations + +Returns all invitations in a project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.invitation_list import InvitationList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + project_id = 'project_id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve project invitations + api_response = api_instance.find_project_invitations(project_id, include=include, page=page, per_page=per_page) + print("The response of ProjectsApi->find_project_invitations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->find_project_invitations: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**InvitationList**](InvitationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_memberships** +> MembershipList find_project_memberships(project_id, search=search, include=include, page=page, per_page=per_page) + +Retrieve project memberships + +Returns all memberships in a project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.membership_list import MembershipList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + project_id = 'project_id_example' # str | Project UUID + search = 'search_example' # str | Search by member full name, id and email. (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve project memberships + api_response = api_instance.find_project_memberships(project_id, search=search, include=include, page=page, per_page=per_page) + print("The response of ProjectsApi->find_project_memberships:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->find_project_memberships: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Project UUID | + **search** | **str**| Search by member full name, id and email. | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**MembershipList**](MembershipList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_projects** +> ProjectList find_projects(name=name, include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve all projects + +Returns a collection of projects that the current user is a member of. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.project_list import ProjectList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + name = 'name_example' # str | Filter results by name. (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve all projects + api_response = api_instance.find_projects(name=name, include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of ProjectsApi->find_projects:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->find_projects: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| Filter results by name. | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**ProjectList**](ProjectList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_projects_all_pages** +> ProjectList find_projects_all_pages(name=name, include=include, exclude=exclude, per_page=per_page) +Just like [**find_projects**](ProjectsApi.md#find_projects) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_projects**](ProjectsApi.md#find_projects). +# **update_project** +> Project update_project(id, project_update_input, include=include, exclude=exclude) + +Update the project + +Updates the project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.project_update_input import ProjectUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.ProjectsApi(api_client) + id = 'id_example' # str | Project UUID + project_update_input = equinix.services.metalv1.ProjectUpdateInput() # ProjectUpdateInput | Project to update + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Update the project + api_response = api_instance.update_project(id, project_update_input, include=include, exclude=exclude) + print("The response of ProjectsApi->update_project:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectsApi->update_project: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **project_update_input** | [**ProjectUpdateInput**](ProjectUpdateInput.md)| Project to update | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Project**](Project.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Raid.md b/equinix/services/metalv1/docs/Raid.md new file mode 100644 index 00000000..efa9cbb4 --- /dev/null +++ b/equinix/services/metalv1/docs/Raid.md @@ -0,0 +1,32 @@ +# Raid + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices** | **List[str]** | | [optional] +**href** | **str** | | [optional] +**level** | **str** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.raid import Raid + +# TODO update the JSON string below +json = "{}" +# create an instance of Raid from a JSON string +raid_instance = Raid.from_json(json) +# print the JSON string representation of the object +print(Raid.to_json()) + +# convert the object into a dict +raid_dict = raid_instance.to_dict() +# create an instance of Raid from a dict +raid_form_dict = raid.from_dict(raid_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/RecoveryCodeList.md b/equinix/services/metalv1/docs/RecoveryCodeList.md new file mode 100644 index 00000000..524653b7 --- /dev/null +++ b/equinix/services/metalv1/docs/RecoveryCodeList.md @@ -0,0 +1,30 @@ +# RecoveryCodeList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**recovery_codes** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList + +# TODO update the JSON string below +json = "{}" +# create an instance of RecoveryCodeList from a JSON string +recovery_code_list_instance = RecoveryCodeList.from_json(json) +# print the JSON string representation of the object +print(RecoveryCodeList.to_json()) + +# convert the object into a dict +recovery_code_list_dict = recovery_code_list_instance.to_dict() +# create an instance of RecoveryCodeList from a dict +recovery_code_list_form_dict = recovery_code_list.from_dict(recovery_code_list_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/RequestIPReservation201Response.md b/equinix/services/metalv1/docs/RequestIPReservation201Response.md new file mode 100644 index 00000000..3a55568a --- /dev/null +++ b/equinix/services/metalv1/docs/RequestIPReservation201Response.md @@ -0,0 +1,59 @@ +# RequestIPReservation201Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addon** | **bool** | | [optional] +**address** | **str** | | [optional] +**address_family** | **int** | | [optional] +**assignments** | [**List[Href]**](Href.md) | | [optional] +**available** | **str** | | [optional] +**bill** | **bool** | | [optional] +**cidr** | **int** | | [optional] +**created_at** | **datetime** | | [optional] +**customdata** | **object** | | [optional] +**details** | **str** | | [optional] +**enabled** | **bool** | | [optional] +**facility** | [**IPReservationFacility**](IPReservationFacility.md) | | [optional] +**gateway** | **str** | | [optional] +**global_ip** | **bool** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**manageable** | **bool** | | [optional] +**management** | **bool** | | [optional] +**metal_gateway** | [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] +**metro** | [**Metro**](Metro.md) | | [optional] +**netmask** | **str** | | [optional] +**network** | **str** | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**project_lite** | [**Project**](Project.md) | | [optional] +**public** | **bool** | | [optional] +**requested_by** | [**Href**](Href.md) | | [optional] +**state** | **str** | | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | | +**created_by** | [**Href**](Href.md) | | [optional] +**vrf** | [**Vrf**](Vrf.md) | | + +## Example + +```python +from equinix.services.metalv1.models.request_ip_reservation201_response import RequestIPReservation201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of RequestIPReservation201Response from a JSON string +request_ip_reservation201_response_instance = RequestIPReservation201Response.from_json(json) +# print the JSON string representation of the object +print(RequestIPReservation201Response.to_json()) + +# convert the object into a dict +request_ip_reservation201_response_dict = request_ip_reservation201_response_instance.to_dict() +# create an instance of RequestIPReservation201Response from a dict +request_ip_reservation201_response_form_dict = request_ip_reservation201_response.from_dict(request_ip_reservation201_response_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/RequestIPReservationRequest.md b/equinix/services/metalv1/docs/RequestIPReservationRequest.md new file mode 100644 index 00000000..8004d652 --- /dev/null +++ b/equinix/services/metalv1/docs/RequestIPReservationRequest.md @@ -0,0 +1,41 @@ +# RequestIPReservationRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**comments** | **str** | | [optional] +**customdata** | **object** | | [optional] +**details** | **str** | | [optional] +**facility** | **str** | | [optional] +**fail_on_approval_required** | **bool** | | [optional] +**href** | **str** | | [optional] +**metro** | **str** | The code of the metro you are requesting the IP reservation in. | [optional] +**quantity** | **int** | | +**tags** | **List[str]** | | [optional] +**type** | **str** | Must be set to 'vrf' | +**cidr** | **int** | The size of the VRF IP Reservation's subnet. The following subnet sizes are supported: - IPv4: between 22 - 29 inclusive - IPv6: exactly 64 | +**network** | **str** | The starting address for this VRF IP Reservation's subnet. Both IPv4 and IPv6 are supported. | +**vrf_id** | **str** | The ID of the VRF in which this VRF IP Reservation is created. The VRF must have an existing IP Range that contains the requested subnet. This field may be aliased as just 'vrf'. | + +## Example + +```python +from equinix.services.metalv1.models.request_ip_reservation_request import RequestIPReservationRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of RequestIPReservationRequest from a JSON string +request_ip_reservation_request_instance = RequestIPReservationRequest.from_json(json) +# print the JSON string representation of the object +print(RequestIPReservationRequest.to_json()) + +# convert the object into a dict +request_ip_reservation_request_dict = request_ip_reservation_request_instance.to_dict() +# create an instance of RequestIPReservationRequest from a dict +request_ip_reservation_request_form_dict = request_ip_reservation_request.from_dict(request_ip_reservation_request_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/SSHKey.md b/equinix/services/metalv1/docs/SSHKey.md new file mode 100644 index 00000000..b8b7ebde --- /dev/null +++ b/equinix/services/metalv1/docs/SSHKey.md @@ -0,0 +1,37 @@ +# SSHKey + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**entity** | [**Href**](Href.md) | | [optional] +**fingerprint** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**key** | **str** | | [optional] +**label** | **str** | | [optional] +**tags** | **List[str]** | | [optional] +**updated_at** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ssh_key import SSHKey + +# TODO update the JSON string below +json = "{}" +# create an instance of SSHKey from a JSON string +ssh_key_instance = SSHKey.from_json(json) +# print the JSON string representation of the object +print(SSHKey.to_json()) + +# convert the object into a dict +ssh_key_dict = ssh_key_instance.to_dict() +# create an instance of SSHKey from a dict +ssh_key_form_dict = ssh_key.from_dict(ssh_key_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/SSHKeyCreateInput.md b/equinix/services/metalv1/docs/SSHKeyCreateInput.md new file mode 100644 index 00000000..153f88a0 --- /dev/null +++ b/equinix/services/metalv1/docs/SSHKeyCreateInput.md @@ -0,0 +1,33 @@ +# SSHKeyCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**instances_ids** | **List[str]** | List of instance UUIDs to associate SSH key with, when empty array is sent all instances belonging to entity will be included | [optional] +**key** | **str** | | [optional] +**label** | **str** | | [optional] +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ssh_key_create_input import SSHKeyCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of SSHKeyCreateInput from a JSON string +ssh_key_create_input_instance = SSHKeyCreateInput.from_json(json) +# print the JSON string representation of the object +print(SSHKeyCreateInput.to_json()) + +# convert the object into a dict +ssh_key_create_input_dict = ssh_key_create_input_instance.to_dict() +# create an instance of SSHKeyCreateInput from a dict +ssh_key_create_input_form_dict = ssh_key_create_input.from_dict(ssh_key_create_input_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/SSHKeyInput.md b/equinix/services/metalv1/docs/SSHKeyInput.md new file mode 100644 index 00000000..209733da --- /dev/null +++ b/equinix/services/metalv1/docs/SSHKeyInput.md @@ -0,0 +1,32 @@ +# SSHKeyInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**key** | **str** | | [optional] +**label** | **str** | | [optional] +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ssh_key_input import SSHKeyInput + +# TODO update the JSON string below +json = "{}" +# create an instance of SSHKeyInput from a JSON string +ssh_key_input_instance = SSHKeyInput.from_json(json) +# print the JSON string representation of the object +print(SSHKeyInput.to_json()) + +# convert the object into a dict +ssh_key_input_dict = ssh_key_input_instance.to_dict() +# create an instance of SSHKeyInput from a dict +ssh_key_input_form_dict = ssh_key_input.from_dict(ssh_key_input_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/SSHKeyList.md b/equinix/services/metalv1/docs/SSHKeyList.md new file mode 100644 index 00000000..19f61ff8 --- /dev/null +++ b/equinix/services/metalv1/docs/SSHKeyList.md @@ -0,0 +1,30 @@ +# SSHKeyList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**ssh_keys** | [**List[SSHKey]**](SSHKey.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.ssh_key_list import SSHKeyList + +# TODO update the JSON string below +json = "{}" +# create an instance of SSHKeyList from a JSON string +ssh_key_list_instance = SSHKeyList.from_json(json) +# print the JSON string representation of the object +print(SSHKeyList.to_json()) + +# convert the object into a dict +ssh_key_list_dict = ssh_key_list_instance.to_dict() +# create an instance of SSHKeyList from a dict +ssh_key_list_form_dict = ssh_key_list.from_dict(ssh_key_list_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/SSHKeysApi.md b/equinix/services/metalv1/docs/SSHKeysApi.md new file mode 100644 index 00000000..41d490dd --- /dev/null +++ b/equinix/services/metalv1/docs/SSHKeysApi.md @@ -0,0 +1,679 @@ +# equinix.services.metalv1.SSHKeysApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_project_ssh_key**](SSHKeysApi.md#create_project_ssh_key) | **POST** /projects/{id}/ssh-keys | Create a ssh key for the given project +[**create_ssh_key**](SSHKeysApi.md#create_ssh_key) | **POST** /ssh-keys | Create a ssh key for the current user +[**delete_ssh_key**](SSHKeysApi.md#delete_ssh_key) | **DELETE** /ssh-keys/{id} | Delete the ssh key +[**find_device_ssh_keys**](SSHKeysApi.md#find_device_ssh_keys) | **GET** /devices/{id}/ssh-keys | Retrieve a device's ssh keys +[**find_project_ssh_keys**](SSHKeysApi.md#find_project_ssh_keys) | **GET** /projects/{id}/ssh-keys | Retrieve a project's ssh keys +[**find_ssh_key_by_id**](SSHKeysApi.md#find_ssh_key_by_id) | **GET** /ssh-keys/{id} | Retrieve a ssh key +[**find_ssh_keys**](SSHKeysApi.md#find_ssh_keys) | **GET** /ssh-keys | Retrieve all ssh keys +[**update_ssh_key**](SSHKeysApi.md#update_ssh_key) | **PUT** /ssh-keys/{id} | Update the ssh key + + +# **create_project_ssh_key** +> SSHKey create_project_ssh_key(id, ssh_key_create_input, include=include) + +Create a ssh key for the given project + +Creates a ssh key. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ssh_key import SSHKey +from equinix.services.metalv1.models.ssh_key_create_input import SSHKeyCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SSHKeysApi(api_client) + id = 'id_example' # str | Project UUID + ssh_key_create_input = equinix.services.metalv1.SSHKeyCreateInput() # SSHKeyCreateInput | ssh key to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create a ssh key for the given project + api_response = api_instance.create_project_ssh_key(id, ssh_key_create_input, include=include) + print("The response of SSHKeysApi->create_project_ssh_key:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SSHKeysApi->create_project_ssh_key: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **ssh_key_create_input** | [**SSHKeyCreateInput**](SSHKeyCreateInput.md)| ssh key to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**SSHKey**](SSHKey.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_ssh_key** +> SSHKey create_ssh_key(ssh_key_create_input, include=include) + +Create a ssh key for the current user + +Creates a ssh key. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ssh_key import SSHKey +from equinix.services.metalv1.models.ssh_key_create_input import SSHKeyCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SSHKeysApi(api_client) + ssh_key_create_input = equinix.services.metalv1.SSHKeyCreateInput() # SSHKeyCreateInput | ssh key to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create a ssh key for the current user + api_response = api_instance.create_ssh_key(ssh_key_create_input, include=include) + print("The response of SSHKeysApi->create_ssh_key:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SSHKeysApi->create_ssh_key: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ssh_key_create_input** | [**SSHKeyCreateInput**](SSHKeyCreateInput.md)| ssh key to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**SSHKey**](SSHKey.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_ssh_key** +> delete_ssh_key(id) + +Delete the ssh key + +Deletes the ssh key. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SSHKeysApi(api_client) + id = 'id_example' # str | ssh key UUID + + try: + # Delete the ssh key + api_instance.delete_ssh_key(id) + except Exception as e: + print("Exception when calling SSHKeysApi->delete_ssh_key: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| ssh key UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_device_ssh_keys** +> SSHKeyList find_device_ssh_keys(id, search_string=search_string, include=include) + +Retrieve a device's ssh keys + +Returns a collection of the device's ssh keys. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ssh_key_list import SSHKeyList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SSHKeysApi(api_client) + id = 'id_example' # str | Project UUID + search_string = 'search_string_example' # str | Search by key, label, or fingerprint (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a device's ssh keys + api_response = api_instance.find_device_ssh_keys(id, search_string=search_string, include=include) + print("The response of SSHKeysApi->find_device_ssh_keys:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SSHKeysApi->find_device_ssh_keys: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **search_string** | **str**| Search by key, label, or fingerprint | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**SSHKeyList**](SSHKeyList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_ssh_keys** +> SSHKeyList find_project_ssh_keys(id, query=query, include=include) + +Retrieve a project's ssh keys + +Returns a collection of the project's ssh keys. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ssh_key_list import SSHKeyList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SSHKeysApi(api_client) + id = 'id_example' # str | Project UUID + query = 'query_example' # str | Search by key, label, or fingerprint (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a project's ssh keys + api_response = api_instance.find_project_ssh_keys(id, query=query, include=include) + print("The response of SSHKeysApi->find_project_ssh_keys:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SSHKeysApi->find_project_ssh_keys: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **query** | **str**| Search by key, label, or fingerprint | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**SSHKeyList**](SSHKeyList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_ssh_key_by_id** +> SSHKey find_ssh_key_by_id(id, include=include) + +Retrieve a ssh key + +Returns a single ssh key if the user has access + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ssh_key import SSHKey +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SSHKeysApi(api_client) + id = 'id_example' # str | SSH Key UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a ssh key + api_response = api_instance.find_ssh_key_by_id(id, include=include) + print("The response of SSHKeysApi->find_ssh_key_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SSHKeysApi->find_ssh_key_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| SSH Key UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**SSHKey**](SSHKey.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_ssh_keys** +> SSHKeyList find_ssh_keys(search=search, include=include) + +Retrieve all ssh keys + +Returns a collection of the user’s ssh keys. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ssh_key_list import SSHKeyList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SSHKeysApi(api_client) + search = 'search_example' # str | Search by key, label, or fingerprint (optional) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve all ssh keys + api_response = api_instance.find_ssh_keys(search=search, include=include) + print("The response of SSHKeysApi->find_ssh_keys:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SSHKeysApi->find_ssh_keys: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **search** | **str**| Search by key, label, or fingerprint | [optional] + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**SSHKeyList**](SSHKeyList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_ssh_key** +> SSHKey update_ssh_key(id, ssh_key_input, include=include) + +Update the ssh key + +Updates the ssh key. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.ssh_key import SSHKey +from equinix.services.metalv1.models.ssh_key_input import SSHKeyInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SSHKeysApi(api_client) + id = 'id_example' # str | SSH Key UUID + ssh_key_input = equinix.services.metalv1.SSHKeyInput() # SSHKeyInput | ssh key to update + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Update the ssh key + api_response = api_instance.update_ssh_key(id, ssh_key_input, include=include) + print("The response of SSHKeysApi->update_ssh_key:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SSHKeysApi->update_ssh_key: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| SSH Key UUID | + **ssh_key_input** | [**SSHKeyInput**](SSHKeyInput.md)| ssh key to update | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**SSHKey**](SSHKey.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/SelfServiceReservationItemRequest.md b/equinix/services/metalv1/docs/SelfServiceReservationItemRequest.md new file mode 100644 index 00000000..4aa461f8 --- /dev/null +++ b/equinix/services/metalv1/docs/SelfServiceReservationItemRequest.md @@ -0,0 +1,33 @@ +# SelfServiceReservationItemRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**metro_id** | **str** | Metro ID of the item. | [optional] +**plan_id** | **str** | Plan ID of the item. | [optional] +**quantity** | **int** | Number of items. | [optional] +**term** | **str** | Contract term of the item. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.self_service_reservation_item_request import SelfServiceReservationItemRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfServiceReservationItemRequest from a JSON string +self_service_reservation_item_request_instance = SelfServiceReservationItemRequest.from_json(json) +# print the JSON string representation of the object +print(SelfServiceReservationItemRequest.to_json()) + +# convert the object into a dict +self_service_reservation_item_request_dict = self_service_reservation_item_request_instance.to_dict() +# create an instance of SelfServiceReservationItemRequest from a dict +self_service_reservation_item_request_form_dict = self_service_reservation_item_request.from_dict(self_service_reservation_item_request_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/SelfServiceReservationItemResponse.md b/equinix/services/metalv1/docs/SelfServiceReservationItemResponse.md new file mode 100644 index 00000000..2c728b2c --- /dev/null +++ b/equinix/services/metalv1/docs/SelfServiceReservationItemResponse.md @@ -0,0 +1,41 @@ +# SelfServiceReservationItemResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**metro_code** | **str** | | [optional] +**metro_id** | **str** | | [optional] +**metro_name** | **str** | | [optional] +**plan** | [**Plan**](Plan.md) | | [optional] +**plan_categories** | **List[str]** | | [optional] +**plan_id** | **str** | | [optional] +**plan_name** | **str** | | [optional] +**plan_slug** | **str** | | [optional] +**quantity** | **int** | | [optional] +**term** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.self_service_reservation_item_response import SelfServiceReservationItemResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfServiceReservationItemResponse from a JSON string +self_service_reservation_item_response_instance = SelfServiceReservationItemResponse.from_json(json) +# print the JSON string representation of the object +print(SelfServiceReservationItemResponse.to_json()) + +# convert the object into a dict +self_service_reservation_item_response_dict = self_service_reservation_item_response_instance.to_dict() +# create an instance of SelfServiceReservationItemResponse from a dict +self_service_reservation_item_response_form_dict = self_service_reservation_item_response.from_dict(self_service_reservation_item_response_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/SelfServiceReservationList.md b/equinix/services/metalv1/docs/SelfServiceReservationList.md new file mode 100644 index 00000000..cf03e473 --- /dev/null +++ b/equinix/services/metalv1/docs/SelfServiceReservationList.md @@ -0,0 +1,30 @@ +# SelfServiceReservationList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**reservations** | [**List[SelfServiceReservationResponse]**](SelfServiceReservationResponse.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.self_service_reservation_list import SelfServiceReservationList + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfServiceReservationList from a JSON string +self_service_reservation_list_instance = SelfServiceReservationList.from_json(json) +# print the JSON string representation of the object +print(SelfServiceReservationList.to_json()) + +# convert the object into a dict +self_service_reservation_list_dict = self_service_reservation_list_instance.to_dict() +# create an instance of SelfServiceReservationList from a dict +self_service_reservation_list_form_dict = self_service_reservation_list.from_dict(self_service_reservation_list_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/SelfServiceReservationResponse.md b/equinix/services/metalv1/docs/SelfServiceReservationResponse.md new file mode 100644 index 00000000..4b15e35b --- /dev/null +++ b/equinix/services/metalv1/docs/SelfServiceReservationResponse.md @@ -0,0 +1,40 @@ +# SelfServiceReservationResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**href** | **str** | | [optional] +**item** | [**List[SelfServiceReservationItemResponse]**](SelfServiceReservationItemResponse.md) | | [optional] +**notes** | **str** | | [optional] +**organization** | **str** | | [optional] +**organization_id** | **str** | | [optional] +**period** | [**CreateSelfServiceReservationRequestPeriod**](CreateSelfServiceReservationRequestPeriod.md) | | [optional] +**project** | **str** | | [optional] +**project_id** | **str** | | [optional] +**start_date** | **datetime** | | [optional] +**status** | **str** | | [optional] +**total_cost** | **int** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.self_service_reservation_response import SelfServiceReservationResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfServiceReservationResponse from a JSON string +self_service_reservation_response_instance = SelfServiceReservationResponse.from_json(json) +# print the JSON string representation of the object +print(SelfServiceReservationResponse.to_json()) + +# convert the object into a dict +self_service_reservation_response_dict = self_service_reservation_response_instance.to_dict() +# create an instance of SelfServiceReservationResponse from a dict +self_service_reservation_response_form_dict = self_service_reservation_response.from_dict(self_service_reservation_response_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/SelfServiceReservationsApi.md b/equinix/services/metalv1/docs/SelfServiceReservationsApi.md new file mode 100644 index 00000000..0f7e790b --- /dev/null +++ b/equinix/services/metalv1/docs/SelfServiceReservationsApi.md @@ -0,0 +1,261 @@ +# equinix.services.metalv1.SelfServiceReservationsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_self_service_reservation**](SelfServiceReservationsApi.md#create_self_service_reservation) | **POST** /projects/{project_id}/self-service/reservations | Create a reservation +[**find_self_service_reservation**](SelfServiceReservationsApi.md#find_self_service_reservation) | **GET** /projects/{project_id}/self-service/reservations/{id} | Retrieve a reservation +[**find_self_service_reservations**](SelfServiceReservationsApi.md#find_self_service_reservations) | **GET** /projects/{project_id}/self-service/reservations | Retrieve all reservations + + +# **create_self_service_reservation** +> SelfServiceReservationResponse create_self_service_reservation(project_id, create_self_service_reservation_request) + +Create a reservation + +Creates a reservation. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.create_self_service_reservation_request import CreateSelfServiceReservationRequest +from equinix.services.metalv1.models.self_service_reservation_response import SelfServiceReservationResponse +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SelfServiceReservationsApi(api_client) + project_id = 'project_id_example' # str | Project UUID + create_self_service_reservation_request = equinix.services.metalv1.CreateSelfServiceReservationRequest() # CreateSelfServiceReservationRequest | reservation to create + + try: + # Create a reservation + api_response = api_instance.create_self_service_reservation(project_id, create_self_service_reservation_request) + print("The response of SelfServiceReservationsApi->create_self_service_reservation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SelfServiceReservationsApi->create_self_service_reservation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Project UUID | + **create_self_service_reservation_request** | [**CreateSelfServiceReservationRequest**](CreateSelfServiceReservationRequest.md)| reservation to create | + +### Return type + +[**SelfServiceReservationResponse**](SelfServiceReservationResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_self_service_reservation** +> SelfServiceReservationResponse find_self_service_reservation(id, project_id) + +Retrieve a reservation + +Returns a reservation + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.self_service_reservation_response import SelfServiceReservationResponse +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SelfServiceReservationsApi(api_client) + id = 'id_example' # str | Reservation short_id + project_id = 'project_id_example' # str | Project UUID + + try: + # Retrieve a reservation + api_response = api_instance.find_self_service_reservation(id, project_id) + print("The response of SelfServiceReservationsApi->find_self_service_reservation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SelfServiceReservationsApi->find_self_service_reservation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Reservation short_id | + **project_id** | **str**| Project UUID | + +### Return type + +[**SelfServiceReservationResponse**](SelfServiceReservationResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_self_service_reservations** +> SelfServiceReservationList find_self_service_reservations(project_id, page=page, per_page=per_page, categories=categories) + +Retrieve all reservations + +Returns all reservations. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.self_service_reservation_list import SelfServiceReservationList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SelfServiceReservationsApi(api_client) + project_id = 'project_id_example' # str | Project UUID + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + categories = ['categories_example'] # List[str] | Filter reservations by items category (optional) + + try: + # Retrieve all reservations + api_response = api_instance.find_self_service_reservations(project_id, page=page, per_page=per_page, categories=categories) + print("The response of SelfServiceReservationsApi->find_self_service_reservations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SelfServiceReservationsApi->find_self_service_reservations: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **project_id** | **str**| Project UUID | + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + **categories** | [**List[str]**](str.md)| Filter reservations by items category | [optional] + +### Return type + +[**SelfServiceReservationList**](SelfServiceReservationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/ServerInfo.md b/equinix/services/metalv1/docs/ServerInfo.md new file mode 100644 index 00000000..c70a2892 --- /dev/null +++ b/equinix/services/metalv1/docs/ServerInfo.md @@ -0,0 +1,33 @@ +# ServerInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**facility** | **str** | | [optional] +**href** | **str** | | [optional] +**metro** | **str** | The metro ID or code to check the capacity in. | [optional] +**plan** | **str** | The plan ID or slug to check the capacity of. | [optional] +**quantity** | **str** | The number of servers to check the capacity of. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.server_info import ServerInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of ServerInfo from a JSON string +server_info_instance = ServerInfo.from_json(json) +# print the JSON string representation of the object +print(ServerInfo.to_json()) + +# convert the object into a dict +server_info_dict = server_info_instance.to_dict() +# create an instance of ServerInfo from a dict +server_info_form_dict = server_info.from_dict(server_info_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/SharedPortVCVlanCreateInput.md b/equinix/services/metalv1/docs/SharedPortVCVlanCreateInput.md new file mode 100644 index 00000000..ad36d0aa --- /dev/null +++ b/equinix/services/metalv1/docs/SharedPortVCVlanCreateInput.md @@ -0,0 +1,38 @@ +# SharedPortVCVlanCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contact_email** | **str** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**metro** | **str** | A Metro ID or code. When creating 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), or shared connections, 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. | +**name** | **str** | | +**project** | **str** | | +**speed** | **str** | A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | | +**vlans** | **List[int]** | A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. | + +## Example + +```python +from equinix.services.metalv1.models.shared_port_vc_vlan_create_input import SharedPortVCVlanCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of SharedPortVCVlanCreateInput from a JSON string +shared_port_vc_vlan_create_input_instance = SharedPortVCVlanCreateInput.from_json(json) +# print the JSON string representation of the object +print(SharedPortVCVlanCreateInput.to_json()) + +# convert the object into a dict +shared_port_vc_vlan_create_input_dict = shared_port_vc_vlan_create_input_instance.to_dict() +# create an instance of SharedPortVCVlanCreateInput from a dict +shared_port_vc_vlan_create_input_form_dict = shared_port_vc_vlan_create_input.from_dict(shared_port_vc_vlan_create_input_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/SpotMarketApi.md b/equinix/services/metalv1/docs/SpotMarketApi.md new file mode 100644 index 00000000..bcbe6354 --- /dev/null +++ b/equinix/services/metalv1/docs/SpotMarketApi.md @@ -0,0 +1,594 @@ +# equinix.services.metalv1.SpotMarketApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_spot_market_request**](SpotMarketApi.md#create_spot_market_request) | **POST** /projects/{id}/spot-market-requests | Create a spot market request +[**delete_spot_market_request**](SpotMarketApi.md#delete_spot_market_request) | **DELETE** /spot-market-requests/{id} | Delete the spot market request +[**find_metro_spot_market_prices**](SpotMarketApi.md#find_metro_spot_market_prices) | **GET** /market/spot/prices/metros | Get current spot market prices for metros +[**find_spot_market_prices**](SpotMarketApi.md#find_spot_market_prices) | **GET** /market/spot/prices | Get current spot market prices +[**find_spot_market_prices_history**](SpotMarketApi.md#find_spot_market_prices_history) | **GET** /market/spot/prices/history | Get spot market prices for a given period of time +[**find_spot_market_request_by_id**](SpotMarketApi.md#find_spot_market_request_by_id) | **GET** /spot-market-requests/{id} | Retrieve a spot market request +[**list_spot_market_requests**](SpotMarketApi.md#list_spot_market_requests) | **GET** /projects/{id}/spot-market-requests | List spot market requests + + +# **create_spot_market_request** +> SpotMarketRequest create_spot_market_request(id, spot_market_request_create_input) + +Create a spot market request + +Creates a new spot market request. Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan. The features attribute allows you to optionally specify what features your server should have. For example, if you require a server with a TPM chip, you may specify `{ \"features\": { \"tpm\": \"required\" } }` (or `{ \"features\": [\"tpm\"] }` in shorthand). The request will fail if there are no available servers matching your criteria. 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 (see the example request below). The request will not fail if we have no servers with that feature in our inventory. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.spot_market_request import SpotMarketRequest +from equinix.services.metalv1.models.spot_market_request_create_input import SpotMarketRequestCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SpotMarketApi(api_client) + id = 'id_example' # str | Project UUID + spot_market_request_create_input = equinix.services.metalv1.SpotMarketRequestCreateInput() # SpotMarketRequestCreateInput | Spot Market Request to create + + try: + # Create a spot market request + api_response = api_instance.create_spot_market_request(id, spot_market_request_create_input) + print("The response of SpotMarketApi->create_spot_market_request:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SpotMarketApi->create_spot_market_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **spot_market_request_create_input** | [**SpotMarketRequestCreateInput**](SpotMarketRequestCreateInput.md)| Spot Market Request to create | + +### Return type + +[**SpotMarketRequest**](SpotMarketRequest.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_spot_market_request** +> delete_spot_market_request(id, force_termination=force_termination) + +Delete the spot market request + +Deletes the spot market request. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SpotMarketApi(api_client) + id = 'id_example' # str | SpotMarketRequest UUID + force_termination = True # bool | Terminate associated spot instances (optional) + + try: + # Delete the spot market request + api_instance.delete_spot_market_request(id, force_termination=force_termination) + except Exception as e: + print("Exception when calling SpotMarketApi->delete_spot_market_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| SpotMarketRequest UUID | + **force_termination** | **bool**| Terminate associated spot instances | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_metro_spot_market_prices** +> SpotMarketPricesPerMetroList find_metro_spot_market_prices(metro=metro, plan=plan) + +Get current spot market prices for metros + +Get Equinix Metal current spot market prices for all metros. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.spot_market_prices_per_metro_list import SpotMarketPricesPerMetroList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SpotMarketApi(api_client) + metro = 'metro_example' # str | Metro to filter spot market prices (optional) + plan = 'plan_example' # str | Plan to filter spot market prices (optional) + + try: + # Get current spot market prices for metros + api_response = api_instance.find_metro_spot_market_prices(metro=metro, plan=plan) + print("The response of SpotMarketApi->find_metro_spot_market_prices:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SpotMarketApi->find_metro_spot_market_prices: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **metro** | **str**| Metro to filter spot market prices | [optional] + **plan** | **str**| Plan to filter spot market prices | [optional] + +### Return type + +[**SpotMarketPricesPerMetroList**](SpotMarketPricesPerMetroList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_spot_market_prices** +> SpotMarketPricesList find_spot_market_prices(facility=facility, plan=plan) + +Get current spot market prices + +Get Equinix Metal current spot market prices. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.spot_market_prices_list import SpotMarketPricesList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SpotMarketApi(api_client) + facility = 'facility_example' # str | Facility to check spot market prices (optional) + plan = 'plan_example' # str | Plan to check spot market prices (optional) + + try: + # Get current spot market prices + api_response = api_instance.find_spot_market_prices(facility=facility, plan=plan) + print("The response of SpotMarketApi->find_spot_market_prices:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SpotMarketApi->find_spot_market_prices: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **facility** | **str**| Facility to check spot market prices | [optional] + **plan** | **str**| Plan to check spot market prices | [optional] + +### Return type + +[**SpotMarketPricesList**](SpotMarketPricesList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_spot_market_prices_history** +> SpotPricesHistoryReport find_spot_market_prices_history(facility, plan, var_from, until, metro=metro) + +Get spot market prices for a given period of time + +Get spot market prices for a given plan and facility in a fixed period of time *Note: In the `200` response, the property `datapoints` contains arrays of `[float, integer]`.* + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.spot_prices_history_report import SpotPricesHistoryReport +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SpotMarketApi(api_client) + facility = 'facility_example' # str | Facility to check spot market prices + plan = 'plan_example' # str | Plan to check spot market prices + var_from = 'var_from_example' # str | Timestamp from range + until = 'until_example' # str | Timestamp to range + metro = 'metro_example' # str | Metro to check spot market price history (optional) + + try: + # Get spot market prices for a given period of time + api_response = api_instance.find_spot_market_prices_history(facility, plan, var_from, until, metro=metro) + print("The response of SpotMarketApi->find_spot_market_prices_history:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SpotMarketApi->find_spot_market_prices_history: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **facility** | **str**| Facility to check spot market prices | + **plan** | **str**| Plan to check spot market prices | + **var_from** | **str**| Timestamp from range | + **until** | **str**| Timestamp to range | + **metro** | **str**| Metro to check spot market price history | [optional] + +### Return type + +[**SpotPricesHistoryReport**](SpotPricesHistoryReport.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_spot_market_request_by_id** +> SpotMarketRequest find_spot_market_request_by_id(id, include=include) + +Retrieve a spot market request + +Returns a single spot market request + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.spot_market_request import SpotMarketRequest +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SpotMarketApi(api_client) + id = 'id_example' # str | SpotMarketRequest UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Retrieve a spot market request + api_response = api_instance.find_spot_market_request_by_id(id, include=include) + print("The response of SpotMarketApi->find_spot_market_request_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SpotMarketApi->find_spot_market_request_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| SpotMarketRequest UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**SpotMarketRequest**](SpotMarketRequest.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **list_spot_market_requests** +> SpotMarketRequestList list_spot_market_requests(id) + +List spot market requests + +View all spot market requests for a given project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.spot_market_request_list import SpotMarketRequestList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SpotMarketApi(api_client) + id = 'id_example' # str | Project UUID + + try: + # List spot market requests + api_response = api_instance.list_spot_market_requests(id) + print("The response of SpotMarketApi->list_spot_market_requests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SpotMarketApi->list_spot_market_requests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + +### Return type + +[**SpotMarketRequestList**](SpotMarketRequestList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/SpotMarketPricesList.md b/equinix/services/metalv1/docs/SpotMarketPricesList.md new file mode 100644 index 00000000..8c315dec --- /dev/null +++ b/equinix/services/metalv1/docs/SpotMarketPricesList.md @@ -0,0 +1,30 @@ +# SpotMarketPricesList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**spot_market_prices** | [**SpotPricesReport**](SpotPricesReport.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_market_prices_list import SpotMarketPricesList + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotMarketPricesList from a JSON string +spot_market_prices_list_instance = SpotMarketPricesList.from_json(json) +# print the JSON string representation of the object +print(SpotMarketPricesList.to_json()) + +# convert the object into a dict +spot_market_prices_list_dict = spot_market_prices_list_instance.to_dict() +# create an instance of SpotMarketPricesList from a dict +spot_market_prices_list_form_dict = spot_market_prices_list.from_dict(spot_market_prices_list_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/SpotMarketPricesPerMetroList.md b/equinix/services/metalv1/docs/SpotMarketPricesPerMetroList.md new file mode 100644 index 00000000..bf58aa02 --- /dev/null +++ b/equinix/services/metalv1/docs/SpotMarketPricesPerMetroList.md @@ -0,0 +1,30 @@ +# SpotMarketPricesPerMetroList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**spot_market_prices** | [**SpotMarketPricesPerMetroReport**](SpotMarketPricesPerMetroReport.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_market_prices_per_metro_list import SpotMarketPricesPerMetroList + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotMarketPricesPerMetroList from a JSON string +spot_market_prices_per_metro_list_instance = SpotMarketPricesPerMetroList.from_json(json) +# print the JSON string representation of the object +print(SpotMarketPricesPerMetroList.to_json()) + +# convert the object into a dict +spot_market_prices_per_metro_list_dict = spot_market_prices_per_metro_list_instance.to_dict() +# create an instance of SpotMarketPricesPerMetroList from a dict +spot_market_prices_per_metro_list_form_dict = spot_market_prices_per_metro_list.from_dict(spot_market_prices_per_metro_list_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/SpotMarketPricesPerMetroReport.md b/equinix/services/metalv1/docs/SpotMarketPricesPerMetroReport.md new file mode 100644 index 00000000..37049825 --- /dev/null +++ b/equinix/services/metalv1/docs/SpotMarketPricesPerMetroReport.md @@ -0,0 +1,36 @@ +# SpotMarketPricesPerMetroReport + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**am** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**ch** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**da** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**href** | **str** | | [optional] +**la** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**ny** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**sg** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**sv** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_market_prices_per_metro_report import SpotMarketPricesPerMetroReport + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotMarketPricesPerMetroReport from a JSON string +spot_market_prices_per_metro_report_instance = SpotMarketPricesPerMetroReport.from_json(json) +# print the JSON string representation of the object +print(SpotMarketPricesPerMetroReport.to_json()) + +# convert the object into a dict +spot_market_prices_per_metro_report_dict = spot_market_prices_per_metro_report_instance.to_dict() +# create an instance of SpotMarketPricesPerMetroReport from a dict +spot_market_prices_per_metro_report_form_dict = spot_market_prices_per_metro_report.from_dict(spot_market_prices_per_metro_report_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/SpotMarketRequest.md b/equinix/services/metalv1/docs/SpotMarketRequest.md new file mode 100644 index 00000000..93790779 --- /dev/null +++ b/equinix/services/metalv1/docs/SpotMarketRequest.md @@ -0,0 +1,39 @@ +# SpotMarketRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**devices_max** | **int** | | [optional] +**devices_min** | **int** | | [optional] +**end_at** | **datetime** | | [optional] +**facilities** | [**Href**](Href.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**instances** | [**Href**](Href.md) | | [optional] +**max_bid_price** | **float** | | [optional] +**metro** | [**SpotMarketRequestMetro**](SpotMarketRequestMetro.md) | | [optional] +**project** | [**Href**](Href.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_market_request import SpotMarketRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotMarketRequest from a JSON string +spot_market_request_instance = SpotMarketRequest.from_json(json) +# print the JSON string representation of the object +print(SpotMarketRequest.to_json()) + +# convert the object into a dict +spot_market_request_dict = spot_market_request_instance.to_dict() +# create an instance of SpotMarketRequest from a dict +spot_market_request_form_dict = spot_market_request.from_dict(spot_market_request_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/SpotMarketRequestCreateInput.md b/equinix/services/metalv1/docs/SpotMarketRequestCreateInput.md new file mode 100644 index 00000000..f15bd7b6 --- /dev/null +++ b/equinix/services/metalv1/docs/SpotMarketRequestCreateInput.md @@ -0,0 +1,36 @@ +# SpotMarketRequestCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**devices_max** | **int** | | [optional] +**devices_min** | **int** | | [optional] +**end_at** | **datetime** | | [optional] +**facilities** | **List[str]** | | [optional] +**href** | **str** | | [optional] +**instance_parameters** | [**SpotMarketRequestCreateInputInstanceParameters**](SpotMarketRequestCreateInputInstanceParameters.md) | | [optional] +**max_bid_price** | **float** | | [optional] +**metro** | **str** | The metro ID or code the spot market request will be created in. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_market_request_create_input import SpotMarketRequestCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotMarketRequestCreateInput from a JSON string +spot_market_request_create_input_instance = SpotMarketRequestCreateInput.from_json(json) +# print the JSON string representation of the object +print(SpotMarketRequestCreateInput.to_json()) + +# convert the object into a dict +spot_market_request_create_input_dict = spot_market_request_create_input_instance.to_dict() +# create an instance of SpotMarketRequestCreateInput from a dict +spot_market_request_create_input_form_dict = spot_market_request_create_input.from_dict(spot_market_request_create_input_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/SpotMarketRequestCreateInputInstanceParameters.md b/equinix/services/metalv1/docs/SpotMarketRequestCreateInputInstanceParameters.md new file mode 100644 index 00000000..95b8931e --- /dev/null +++ b/equinix/services/metalv1/docs/SpotMarketRequestCreateInputInstanceParameters.md @@ -0,0 +1,47 @@ +# SpotMarketRequestCreateInputInstanceParameters + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**always_pxe** | **bool** | | [optional] +**billing_cycle** | **str** | | [optional] +**customdata** | **object** | | [optional] +**description** | **str** | | [optional] +**features** | **List[str]** | | [optional] +**hostname** | **str** | | [optional] +**hostnames** | **List[str]** | | [optional] +**href** | **str** | | [optional] +**locked** | **bool** | Whether the device should be locked, preventing accidental deletion. | [optional] +**no_ssh_keys** | **bool** | | [optional] +**operating_system** | **str** | | [optional] +**plan** | **str** | | [optional] +**private_ipv4_subnet_size** | **int** | | [optional] +**project_ssh_keys** | **List[str]** | | [optional] +**public_ipv4_subnet_size** | **int** | | [optional] +**tags** | **List[str]** | | [optional] +**termination_time** | **datetime** | | [optional] +**user_ssh_keys** | **List[str]** | The UUIDs of users whose SSH keys should be included on the provisioned device. | [optional] +**userdata** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_market_request_create_input_instance_parameters import SpotMarketRequestCreateInputInstanceParameters + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotMarketRequestCreateInputInstanceParameters from a JSON string +spot_market_request_create_input_instance_parameters_instance = SpotMarketRequestCreateInputInstanceParameters.from_json(json) +# print the JSON string representation of the object +print(SpotMarketRequestCreateInputInstanceParameters.to_json()) + +# convert the object into a dict +spot_market_request_create_input_instance_parameters_dict = spot_market_request_create_input_instance_parameters_instance.to_dict() +# create an instance of SpotMarketRequestCreateInputInstanceParameters from a dict +spot_market_request_create_input_instance_parameters_form_dict = spot_market_request_create_input_instance_parameters.from_dict(spot_market_request_create_input_instance_parameters_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/SpotMarketRequestList.md b/equinix/services/metalv1/docs/SpotMarketRequestList.md new file mode 100644 index 00000000..de2d02ba --- /dev/null +++ b/equinix/services/metalv1/docs/SpotMarketRequestList.md @@ -0,0 +1,30 @@ +# SpotMarketRequestList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**spot_market_requests** | [**List[SpotMarketRequest]**](SpotMarketRequest.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_market_request_list import SpotMarketRequestList + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotMarketRequestList from a JSON string +spot_market_request_list_instance = SpotMarketRequestList.from_json(json) +# print the JSON string representation of the object +print(SpotMarketRequestList.to_json()) + +# convert the object into a dict +spot_market_request_list_dict = spot_market_request_list_instance.to_dict() +# create an instance of SpotMarketRequestList from a dict +spot_market_request_list_form_dict = spot_market_request_list.from_dict(spot_market_request_list_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/SpotMarketRequestMetro.md b/equinix/services/metalv1/docs/SpotMarketRequestMetro.md new file mode 100644 index 00000000..76ecde80 --- /dev/null +++ b/equinix/services/metalv1/docs/SpotMarketRequestMetro.md @@ -0,0 +1,33 @@ +# SpotMarketRequestMetro + + +## 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.spot_market_request_metro import SpotMarketRequestMetro + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotMarketRequestMetro from a JSON string +spot_market_request_metro_instance = SpotMarketRequestMetro.from_json(json) +# print the JSON string representation of the object +print(SpotMarketRequestMetro.to_json()) + +# convert the object into a dict +spot_market_request_metro_dict = spot_market_request_metro_instance.to_dict() +# create an instance of SpotMarketRequestMetro from a dict +spot_market_request_metro_form_dict = spot_market_request_metro.from_dict(spot_market_request_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/SpotPricesDatapoints.md b/equinix/services/metalv1/docs/SpotPricesDatapoints.md new file mode 100644 index 00000000..9bb443e5 --- /dev/null +++ b/equinix/services/metalv1/docs/SpotPricesDatapoints.md @@ -0,0 +1,30 @@ +# SpotPricesDatapoints + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**datapoints** | **List[List[float]]** | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_prices_datapoints import SpotPricesDatapoints + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotPricesDatapoints from a JSON string +spot_prices_datapoints_instance = SpotPricesDatapoints.from_json(json) +# print the JSON string representation of the object +print(SpotPricesDatapoints.to_json()) + +# convert the object into a dict +spot_prices_datapoints_dict = spot_prices_datapoints_instance.to_dict() +# create an instance of SpotPricesDatapoints from a dict +spot_prices_datapoints_form_dict = spot_prices_datapoints.from_dict(spot_prices_datapoints_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/SpotPricesHistoryReport.md b/equinix/services/metalv1/docs/SpotPricesHistoryReport.md new file mode 100644 index 00000000..cbfd5003 --- /dev/null +++ b/equinix/services/metalv1/docs/SpotPricesHistoryReport.md @@ -0,0 +1,30 @@ +# SpotPricesHistoryReport + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**prices_history** | [**SpotPricesDatapoints**](SpotPricesDatapoints.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_prices_history_report import SpotPricesHistoryReport + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotPricesHistoryReport from a JSON string +spot_prices_history_report_instance = SpotPricesHistoryReport.from_json(json) +# print the JSON string representation of the object +print(SpotPricesHistoryReport.to_json()) + +# convert the object into a dict +spot_prices_history_report_dict = spot_prices_history_report_instance.to_dict() +# create an instance of SpotPricesHistoryReport from a dict +spot_prices_history_report_form_dict = spot_prices_history_report.from_dict(spot_prices_history_report_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/SpotPricesPerBaremetal.md b/equinix/services/metalv1/docs/SpotPricesPerBaremetal.md new file mode 100644 index 00000000..908f20bb --- /dev/null +++ b/equinix/services/metalv1/docs/SpotPricesPerBaremetal.md @@ -0,0 +1,30 @@ +# SpotPricesPerBaremetal + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**price** | **float** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_prices_per_baremetal import SpotPricesPerBaremetal + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotPricesPerBaremetal from a JSON string +spot_prices_per_baremetal_instance = SpotPricesPerBaremetal.from_json(json) +# print the JSON string representation of the object +print(SpotPricesPerBaremetal.to_json()) + +# convert the object into a dict +spot_prices_per_baremetal_dict = spot_prices_per_baremetal_instance.to_dict() +# create an instance of SpotPricesPerBaremetal from a dict +spot_prices_per_baremetal_form_dict = spot_prices_per_baremetal.from_dict(spot_prices_per_baremetal_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/SpotPricesPerFacility.md b/equinix/services/metalv1/docs/SpotPricesPerFacility.md new file mode 100644 index 00000000..71f39f5d --- /dev/null +++ b/equinix/services/metalv1/docs/SpotPricesPerFacility.md @@ -0,0 +1,38 @@ +# SpotPricesPerFacility + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**baremetal_0** | [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**baremetal_1** | [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**baremetal_2** | [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**baremetal_2a** | [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**baremetal_2a2** | [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**baremetal_3** | [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**baremetal_s** | [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**c2_medium_x86** | [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**href** | **str** | | [optional] +**m2_xlarge_x86** | [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_prices_per_facility import SpotPricesPerFacility + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotPricesPerFacility from a JSON string +spot_prices_per_facility_instance = SpotPricesPerFacility.from_json(json) +# print the JSON string representation of the object +print(SpotPricesPerFacility.to_json()) + +# convert the object into a dict +spot_prices_per_facility_dict = spot_prices_per_facility_instance.to_dict() +# create an instance of SpotPricesPerFacility from a dict +spot_prices_per_facility_form_dict = spot_prices_per_facility.from_dict(spot_prices_per_facility_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/SpotPricesPerNewFacility.md b/equinix/services/metalv1/docs/SpotPricesPerNewFacility.md new file mode 100644 index 00000000..d024d2b6 --- /dev/null +++ b/equinix/services/metalv1/docs/SpotPricesPerNewFacility.md @@ -0,0 +1,30 @@ +# SpotPricesPerNewFacility + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**baremetal_1e** | [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_prices_per_new_facility import SpotPricesPerNewFacility + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotPricesPerNewFacility from a JSON string +spot_prices_per_new_facility_instance = SpotPricesPerNewFacility.from_json(json) +# print the JSON string representation of the object +print(SpotPricesPerNewFacility.to_json()) + +# convert the object into a dict +spot_prices_per_new_facility_dict = spot_prices_per_new_facility_instance.to_dict() +# create an instance of SpotPricesPerNewFacility from a dict +spot_prices_per_new_facility_form_dict = spot_prices_per_new_facility.from_dict(spot_prices_per_new_facility_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/SpotPricesReport.md b/equinix/services/metalv1/docs/SpotPricesReport.md new file mode 100644 index 00000000..a001ff2d --- /dev/null +++ b/equinix/services/metalv1/docs/SpotPricesReport.md @@ -0,0 +1,43 @@ +# SpotPricesReport + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ams1** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**atl1** | [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**dfw1** | [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**ewr1** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**fra1** | [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**href** | **str** | | [optional] +**iad1** | [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**lax1** | [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**nrt1** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**ord1** | [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**sea1** | [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**sin1** | [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**sjc1** | [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**syd1** | [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**yyz1** | [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.spot_prices_report import SpotPricesReport + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotPricesReport from a JSON string +spot_prices_report_instance = SpotPricesReport.from_json(json) +# print the JSON string representation of the object +print(SpotPricesReport.to_json()) + +# convert the object into a dict +spot_prices_report_dict = spot_prices_report_instance.to_dict() +# create an instance of SpotPricesReport from a dict +spot_prices_report_form_dict = spot_prices_report.from_dict(spot_prices_report_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/Storage.md b/equinix/services/metalv1/docs/Storage.md new file mode 100644 index 00000000..03f14ecb --- /dev/null +++ b/equinix/services/metalv1/docs/Storage.md @@ -0,0 +1,32 @@ +# Storage + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**disks** | [**List[Disk]**](Disk.md) | | [optional] +**filesystems** | [**List[Filesystem]**](Filesystem.md) | | [optional] +**href** | **str** | | [optional] +**raid** | [**List[Raid]**](Raid.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.storage import Storage + +# TODO update the JSON string below +json = "{}" +# create an instance of Storage from a JSON string +storage_instance = Storage.from_json(json) +# print the JSON string representation of the object +print(Storage.to_json()) + +# convert the object into a dict +storage_dict = storage_instance.to_dict() +# create an instance of Storage from a dict +storage_form_dict = storage.from_dict(storage_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/SupportRequestApi.md b/equinix/services/metalv1/docs/SupportRequestApi.md new file mode 100644 index 00000000..27a8b92d --- /dev/null +++ b/equinix/services/metalv1/docs/SupportRequestApi.md @@ -0,0 +1,89 @@ +# equinix.services.metalv1.SupportRequestApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**request_support**](SupportRequestApi.md#request_support) | **POST** /support-requests | Create a support ticket + + +# **request_support** +> request_support(support_request_input) + +Create a support ticket + +Support Ticket. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.support_request_input import SupportRequestInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.SupportRequestApi(api_client) + support_request_input = equinix.services.metalv1.SupportRequestInput() # SupportRequestInput | Support Request to create + + try: + # Create a support ticket + api_instance.request_support(support_request_input) + except Exception as e: + print("Exception when calling SupportRequestApi->request_support: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **support_request_input** | [**SupportRequestInput**](SupportRequestInput.md)| Support Request to create | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/SupportRequestInput.md b/equinix/services/metalv1/docs/SupportRequestInput.md new file mode 100644 index 00000000..e467fd5d --- /dev/null +++ b/equinix/services/metalv1/docs/SupportRequestInput.md @@ -0,0 +1,34 @@ +# SupportRequestInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device_id** | **str** | | [optional] +**href** | **str** | | [optional] +**message** | **str** | | +**priority** | **str** | | [optional] +**project_id** | **str** | | [optional] +**subject** | **str** | | + +## Example + +```python +from equinix.services.metalv1.models.support_request_input import SupportRequestInput + +# TODO update the JSON string below +json = "{}" +# create an instance of SupportRequestInput from a JSON string +support_request_input_instance = SupportRequestInput.from_json(json) +# print the JSON string representation of the object +print(SupportRequestInput.to_json()) + +# convert the object into a dict +support_request_input_dict = support_request_input_instance.to_dict() +# create an instance of SupportRequestInput from a dict +support_request_input_form_dict = support_request_input.from_dict(support_request_input_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/TransferRequest.md b/equinix/services/metalv1/docs/TransferRequest.md new file mode 100644 index 00000000..ab1f2069 --- /dev/null +++ b/equinix/services/metalv1/docs/TransferRequest.md @@ -0,0 +1,34 @@ +# TransferRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**project** | [**Href**](Href.md) | | [optional] +**target_organization** | [**Href**](Href.md) | | [optional] +**updated_at** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.transfer_request import TransferRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of TransferRequest from a JSON string +transfer_request_instance = TransferRequest.from_json(json) +# print the JSON string representation of the object +print(TransferRequest.to_json()) + +# convert the object into a dict +transfer_request_dict = transfer_request_instance.to_dict() +# create an instance of TransferRequest from a dict +transfer_request_form_dict = transfer_request.from_dict(transfer_request_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/TransferRequestInput.md b/equinix/services/metalv1/docs/TransferRequestInput.md new file mode 100644 index 00000000..93b22d5c --- /dev/null +++ b/equinix/services/metalv1/docs/TransferRequestInput.md @@ -0,0 +1,30 @@ +# TransferRequestInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**target_organization_id** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.transfer_request_input import TransferRequestInput + +# TODO update the JSON string below +json = "{}" +# create an instance of TransferRequestInput from a JSON string +transfer_request_input_instance = TransferRequestInput.from_json(json) +# print the JSON string representation of the object +print(TransferRequestInput.to_json()) + +# convert the object into a dict +transfer_request_input_dict = transfer_request_input_instance.to_dict() +# create an instance of TransferRequestInput from a dict +transfer_request_input_form_dict = transfer_request_input.from_dict(transfer_request_input_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/TransferRequestList.md b/equinix/services/metalv1/docs/TransferRequestList.md new file mode 100644 index 00000000..aed33ac3 --- /dev/null +++ b/equinix/services/metalv1/docs/TransferRequestList.md @@ -0,0 +1,30 @@ +# TransferRequestList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**transfers** | [**List[TransferRequest]**](TransferRequest.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.transfer_request_list import TransferRequestList + +# TODO update the JSON string below +json = "{}" +# create an instance of TransferRequestList from a JSON string +transfer_request_list_instance = TransferRequestList.from_json(json) +# print the JSON string representation of the object +print(TransferRequestList.to_json()) + +# convert the object into a dict +transfer_request_list_dict = transfer_request_list_instance.to_dict() +# create an instance of TransferRequestList from a dict +transfer_request_list_form_dict = transfer_request_list.from_dict(transfer_request_list_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/TransferRequestsApi.md b/equinix/services/metalv1/docs/TransferRequestsApi.md new file mode 100644 index 00000000..9cc2f872 --- /dev/null +++ b/equinix/services/metalv1/docs/TransferRequestsApi.md @@ -0,0 +1,250 @@ +# equinix.services.metalv1.TransferRequestsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**accept_transfer_request**](TransferRequestsApi.md#accept_transfer_request) | **PUT** /transfers/{id} | Accept a transfer request +[**decline_transfer_request**](TransferRequestsApi.md#decline_transfer_request) | **DELETE** /transfers/{id} | Decline a transfer request +[**find_transfer_request_by_id**](TransferRequestsApi.md#find_transfer_request_by_id) | **GET** /transfers/{id} | View a transfer request + + +# **accept_transfer_request** +> accept_transfer_request(id) + +Accept a transfer request + +Accept a transfer request. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.TransferRequestsApi(api_client) + id = 'id_example' # str | Transfer request UUID + + try: + # Accept a transfer request + api_instance.accept_transfer_request(id) + except Exception as e: + print("Exception when calling TransferRequestsApi->accept_transfer_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Transfer request UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **decline_transfer_request** +> decline_transfer_request(id) + +Decline a transfer request + +Decline a transfer request. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.TransferRequestsApi(api_client) + id = 'id_example' # str | Transfer request UUID + + try: + # Decline a transfer request + api_instance.decline_transfer_request(id) + except Exception as e: + print("Exception when calling TransferRequestsApi->decline_transfer_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Transfer request UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_transfer_request_by_id** +> TransferRequest find_transfer_request_by_id(id, include=include) + +View a transfer request + +Returns a single transfer request. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.transfer_request import TransferRequest +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.TransferRequestsApi(api_client) + id = 'id_example' # str | Transfer request UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # View a transfer request + api_response = api_instance.find_transfer_request_by_id(id, include=include) + print("The response of TransferRequestsApi->find_transfer_request_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransferRequestsApi->find_transfer_request_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Transfer request UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +[**TransferRequest**](TransferRequest.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/TwoFactorAuthApi.md b/equinix/services/metalv1/docs/TwoFactorAuthApi.md new file mode 100644 index 00000000..8e7a6796 --- /dev/null +++ b/equinix/services/metalv1/docs/TwoFactorAuthApi.md @@ -0,0 +1,302 @@ +# equinix.services.metalv1.TwoFactorAuthApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**disable_tfa_app**](TwoFactorAuthApi.md#disable_tfa_app) | **DELETE** /user/otp/app | Disable two factor authentication +[**disable_tfa_sms**](TwoFactorAuthApi.md#disable_tfa_sms) | **DELETE** /user/otp/sms | Disable two factor authentication +[**enable_tfa_app**](TwoFactorAuthApi.md#enable_tfa_app) | **POST** /user/otp/app | Enable two factor auth using app +[**enable_tfa_sms**](TwoFactorAuthApi.md#enable_tfa_sms) | **POST** /user/otp/sms | Enable two factor auth using sms + + +# **disable_tfa_app** +> disable_tfa_app() + +Disable two factor authentication + +Disables two factor authentication. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.TwoFactorAuthApi(api_client) + + try: + # Disable two factor authentication + api_instance.disable_tfa_app() + except Exception as e: + print("Exception when calling TwoFactorAuthApi->disable_tfa_app: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **disable_tfa_sms** +> disable_tfa_sms() + +Disable two factor authentication + +Disables two factor authentication. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.TwoFactorAuthApi(api_client) + + try: + # Disable two factor authentication + api_instance.disable_tfa_sms() + except Exception as e: + print("Exception when calling TwoFactorAuthApi->disable_tfa_sms: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **enable_tfa_app** +> enable_tfa_app() + +Enable two factor auth using app + +Enables two factor authentication using authenticator app. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.TwoFactorAuthApi(api_client) + + try: + # Enable two factor auth using app + api_instance.enable_tfa_app() + except Exception as e: + print("Exception when calling TwoFactorAuthApi->enable_tfa_app: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **enable_tfa_sms** +> enable_tfa_sms() + +Enable two factor auth using sms + +Enables two factor authentication with sms. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.TwoFactorAuthApi(api_client) + + try: + # Enable two factor auth using sms + api_instance.enable_tfa_sms() + except Exception as e: + print("Exception when calling TwoFactorAuthApi->enable_tfa_sms: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/UpdateEmailInput.md b/equinix/services/metalv1/docs/UpdateEmailInput.md new file mode 100644 index 00000000..10410539 --- /dev/null +++ b/equinix/services/metalv1/docs/UpdateEmailInput.md @@ -0,0 +1,30 @@ +# UpdateEmailInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**default** | **bool** | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.update_email_input import UpdateEmailInput + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateEmailInput from a JSON string +update_email_input_instance = UpdateEmailInput.from_json(json) +# print the JSON string representation of the object +print(UpdateEmailInput.to_json()) + +# convert the object into a dict +update_email_input_dict = update_email_input_instance.to_dict() +# create an instance of UpdateEmailInput from a dict +update_email_input_form_dict = update_email_input.from_dict(update_email_input_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/UsagesApi.md b/equinix/services/metalv1/docs/UsagesApi.md new file mode 100644 index 00000000..012c11e5 --- /dev/null +++ b/equinix/services/metalv1/docs/UsagesApi.md @@ -0,0 +1,178 @@ +# equinix.services.metalv1.UsagesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**find_device_usages**](UsagesApi.md#find_device_usages) | **GET** /devices/{id}/usages | Retrieve all usages for device +[**find_project_usage**](UsagesApi.md#find_project_usage) | **GET** /projects/{id}/usages | Retrieve all usages for project + + +# **find_device_usages** +> DeviceUsageList find_device_usages(id, created_after=created_after, created_before=created_before) + +Retrieve all usages for device + +Returns all usages for a device. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.device_usage_list import DeviceUsageList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UsagesApi(api_client) + id = 'id_example' # str | Device UUID + created_after = 'created_after_example' # str | Filter usages created after this date (optional) + created_before = 'created_before_example' # str | Filter usages created before this date (optional) + + try: + # Retrieve all usages for device + api_response = api_instance.find_device_usages(id, created_after=created_after, created_before=created_before) + print("The response of UsagesApi->find_device_usages:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsagesApi->find_device_usages: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Device UUID | + **created_after** | **str**| Filter usages created after this date | [optional] + **created_before** | **str**| Filter usages created before this date | [optional] + +### Return type + +[**DeviceUsageList**](DeviceUsageList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_project_usage** +> ProjectUsageList find_project_usage(id, created_after=created_after, created_before=created_before) + +Retrieve all usages for project + +Returns all usages for a project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.project_usage_list import ProjectUsageList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UsagesApi(api_client) + id = 'id_example' # str | Project UUID + created_after = 'created_after_example' # str | Filter usages created after this date (optional) + created_before = 'created_before_example' # str | Filter usages created before this date (optional) + + try: + # Retrieve all usages for project + api_response = api_instance.find_project_usage(id, created_after=created_after, created_before=created_before) + print("The response of UsagesApi->find_project_usage:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsagesApi->find_project_usage: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **created_after** | **str**| Filter usages created after this date | [optional] + **created_before** | **str**| Filter usages created before this date | [optional] + +### Return type + +[**ProjectUsageList**](ProjectUsageList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/User.md b/equinix/services/metalv1/docs/User.md new file mode 100644 index 00000000..b15a9007 --- /dev/null +++ b/equinix/services/metalv1/docs/User.md @@ -0,0 +1,50 @@ +# User + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avatar_thumb_url** | **str** | | [optional] +**avatar_url** | **str** | | [optional] +**created_at** | **datetime** | | [optional] +**customdata** | **object** | | [optional] +**default_organization_id** | **str** | | [optional] +**default_project_id** | **str** | | [optional] +**email** | **str** | | [optional] +**emails** | [**List[Href]**](Href.md) | | [optional] +**first_name** | **str** | | [optional] +**fraud_score** | **str** | | [optional] +**full_name** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**last_login_at** | **datetime** | | [optional] +**last_name** | **str** | | [optional] +**max_organizations** | **int** | | [optional] +**max_projects** | **int** | | [optional] +**phone_number** | **str** | | [optional] +**short_id** | **str** | | [optional] +**timezone** | **str** | | [optional] +**two_factor_auth** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.user import User + +# TODO update the JSON string below +json = "{}" +# create an instance of User from a JSON string +user_instance = User.from_json(json) +# print the JSON string representation of the object +print(User.to_json()) + +# convert the object into a dict +user_dict = user_instance.to_dict() +# create an instance of User from a dict +user_form_dict = user.from_dict(user_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/UserCreateInput.md b/equinix/services/metalv1/docs/UserCreateInput.md new file mode 100644 index 00000000..4f353fb1 --- /dev/null +++ b/equinix/services/metalv1/docs/UserCreateInput.md @@ -0,0 +1,45 @@ +# UserCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**company_name** | **str** | | [optional] +**company_url** | **str** | | [optional] +**customdata** | **object** | | [optional] +**emails** | [**List[EmailInput]**](EmailInput.md) | | +**first_name** | **str** | | +**href** | **str** | | [optional] +**invitation_id** | **str** | | [optional] +**last_name** | **str** | | +**level** | **str** | | [optional] +**nonce** | **str** | | [optional] +**password** | **str** | | [optional] +**phone_number** | **str** | | [optional] +**social_accounts** | **object** | | [optional] +**timezone** | **str** | | [optional] +**title** | **str** | | [optional] +**two_factor_auth** | **str** | | [optional] +**verified_at** | **datetime** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.user_create_input import UserCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of UserCreateInput from a JSON string +user_create_input_instance = UserCreateInput.from_json(json) +# print the JSON string representation of the object +print(UserCreateInput.to_json()) + +# convert the object into a dict +user_create_input_dict = user_create_input_instance.to_dict() +# create an instance of UserCreateInput from a dict +user_create_input_form_dict = user_create_input.from_dict(user_create_input_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/UserLimited.md b/equinix/services/metalv1/docs/UserLimited.md new file mode 100644 index 00000000..d48e7caa --- /dev/null +++ b/equinix/services/metalv1/docs/UserLimited.md @@ -0,0 +1,33 @@ +# UserLimited + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avatar_thumb_url** | **str** | Avatar thumbnail URL of the User | [optional] +**avatar_url** | **str** | Avatar URL of the User | [optional] +**full_name** | **str** | Full name of the User | [optional] +**href** | **str** | API URL uniquely representing the User | [optional] +**id** | **str** | ID of the User | + +## Example + +```python +from equinix.services.metalv1.models.user_limited import UserLimited + +# TODO update the JSON string below +json = "{}" +# create an instance of UserLimited from a JSON string +user_limited_instance = UserLimited.from_json(json) +# print the JSON string representation of the object +print(UserLimited.to_json()) + +# convert the object into a dict +user_limited_dict = user_limited_instance.to_dict() +# create an instance of UserLimited from a dict +user_limited_form_dict = user_limited.from_dict(user_limited_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/UserList.md b/equinix/services/metalv1/docs/UserList.md new file mode 100644 index 00000000..d2bc51b0 --- /dev/null +++ b/equinix/services/metalv1/docs/UserList.md @@ -0,0 +1,31 @@ +# UserList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] +**users** | [**List[User]**](User.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.user_list import UserList + +# TODO update the JSON string below +json = "{}" +# create an instance of UserList from a JSON string +user_list_instance = UserList.from_json(json) +# print the JSON string representation of the object +print(UserList.to_json()) + +# convert the object into a dict +user_list_dict = user_list_instance.to_dict() +# create an instance of UserList from a dict +user_list_form_dict = user_list.from_dict(user_list_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/UserLite.md b/equinix/services/metalv1/docs/UserLite.md new file mode 100644 index 00000000..040f900f --- /dev/null +++ b/equinix/services/metalv1/docs/UserLite.md @@ -0,0 +1,38 @@ +# UserLite + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avatar_thumb_url** | **str** | Avatar thumbnail URL of the User | [optional] +**created_at** | **datetime** | When the user was created | [optional] +**email** | **str** | Primary email address of the User | [optional] +**first_name** | **str** | First name of the User | [optional] +**full_name** | **str** | Full name of the User | [optional] +**href** | **str** | API URL uniquely representing the User | [optional] +**id** | **str** | ID of the User | +**last_name** | **str** | Last name of the User | [optional] +**short_id** | **str** | Short ID of the User | +**updated_at** | **datetime** | When the user details were last updated | [optional] + +## Example + +```python +from equinix.services.metalv1.models.user_lite import UserLite + +# TODO update the JSON string below +json = "{}" +# create an instance of UserLite from a JSON string +user_lite_instance = UserLite.from_json(json) +# print the JSON string representation of the object +print(UserLite.to_json()) + +# convert the object into a dict +user_lite_dict = user_lite_instance.to_dict() +# create an instance of UserLite from a dict +user_lite_form_dict = user_lite.from_dict(user_lite_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/UserUpdateInput.md b/equinix/services/metalv1/docs/UserUpdateInput.md new file mode 100644 index 00000000..f889b0c6 --- /dev/null +++ b/equinix/services/metalv1/docs/UserUpdateInput.md @@ -0,0 +1,35 @@ +# UserUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customdata** | **object** | | [optional] +**first_name** | **str** | | [optional] +**href** | **str** | | [optional] +**last_name** | **str** | | [optional] +**password** | **str** | | [optional] +**phone_number** | **str** | | [optional] +**timezone** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.user_update_input import UserUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of UserUpdateInput from a JSON string +user_update_input_instance = UserUpdateInput.from_json(json) +# print the JSON string representation of the object +print(UserUpdateInput.to_json()) + +# convert the object into a dict +user_update_input_dict = user_update_input_instance.to_dict() +# create an instance of UserUpdateInput from a dict +user_update_input_form_dict = user_update_input.from_dict(user_update_input_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/UserVerificationTokensApi.md b/equinix/services/metalv1/docs/UserVerificationTokensApi.md new file mode 100644 index 00000000..930a240f --- /dev/null +++ b/equinix/services/metalv1/docs/UserVerificationTokensApi.md @@ -0,0 +1,169 @@ +# equinix.services.metalv1.UserVerificationTokensApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**consume_verification_request**](UserVerificationTokensApi.md#consume_verification_request) | **PUT** /verify-email | Verify a user using an email verification token +[**create_validation_request**](UserVerificationTokensApi.md#create_validation_request) | **POST** /verify-email | Create an email verification request + + +# **consume_verification_request** +> consume_verification_request(verify_email, include=include) + +Verify a user using an email verification token + +Consumes an email verification token and verifies the user associated with it. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.verify_email import VerifyEmail +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UserVerificationTokensApi(api_client) + verify_email = equinix.services.metalv1.VerifyEmail() # VerifyEmail | Email to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Verify a user using an email verification token + api_instance.consume_verification_request(verify_email, include=include) + except Exception as e: + print("Exception when calling UserVerificationTokensApi->consume_verification_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **verify_email** | [**VerifyEmail**](VerifyEmail.md)| Email to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_validation_request** +> create_validation_request(login, include=include) + +Create an email verification request + +Creates an email verification request + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UserVerificationTokensApi(api_client) + login = 'login_example' # str | Email for verification request + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create an email verification request + api_instance.create_validation_request(login, include=include) + except Exception as e: + print("Exception when calling UserVerificationTokensApi->create_validation_request: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **login** | **str**| Email for verification request | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/Userdata.md b/equinix/services/metalv1/docs/Userdata.md new file mode 100644 index 00000000..94caec34 --- /dev/null +++ b/equinix/services/metalv1/docs/Userdata.md @@ -0,0 +1,30 @@ +# Userdata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**userdata** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.userdata import Userdata + +# TODO update the JSON string below +json = "{}" +# create an instance of Userdata from a JSON string +userdata_instance = Userdata.from_json(json) +# print the JSON string representation of the object +print(Userdata.to_json()) + +# convert the object into a dict +userdata_dict = userdata_instance.to_dict() +# create an instance of Userdata from a dict +userdata_form_dict = userdata.from_dict(userdata_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/UserdataApi.md b/equinix/services/metalv1/docs/UserdataApi.md new file mode 100644 index 00000000..e98a5024 --- /dev/null +++ b/equinix/services/metalv1/docs/UserdataApi.md @@ -0,0 +1,86 @@ +# equinix.services.metalv1.UserdataApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**validate_userdata**](UserdataApi.md#validate_userdata) | **POST** /userdata/validate | Validate user data + + +# **validate_userdata** +> validate_userdata(userdata=userdata) + +Validate user data + +Validates user data (Userdata) + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UserdataApi(api_client) + userdata = 'userdata_example' # str | Userdata to validate (optional) + + try: + # Validate user data + api_instance.validate_userdata(userdata=userdata) + except Exception as e: + print("Exception when calling UserdataApi->validate_userdata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userdata** | **str**| Userdata to validate | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/UsersApi.md b/equinix/services/metalv1/docs/UsersApi.md new file mode 100644 index 00000000..d771f2dd --- /dev/null +++ b/equinix/services/metalv1/docs/UsersApi.md @@ -0,0 +1,600 @@ +# equinix.services.metalv1.UsersApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UsersApi.md#create_user) | **POST** /users | Create a user +[**find_current_user**](UsersApi.md#find_current_user) | **GET** /user | Retrieve the current user +[**find_invitations**](UsersApi.md#find_invitations) | **GET** /invitations | Retrieve current user invitations +[**find_user_by_id**](UsersApi.md#find_user_by_id) | **GET** /users/{id} | Retrieve a user +[**find_user_customdata**](UsersApi.md#find_user_customdata) | **GET** /users/{id}/customdata | Retrieve the custom metadata of a user +[**find_users**](UsersApi.md#find_users) | **GET** /users | Retrieve all users +[**find_users_all_pages**](UsersApi.md#find_users_all_pages) | **GET** /users | Retrieve all users, fetches all the pages +[**update_current_user**](UsersApi.md#update_current_user) | **PUT** /user | Update the current user + + +# **create_user** +> create_user(user_create_input, include=include, exclude=exclude) + +Create a user + +Creates a user. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.user_create_input import UserCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UsersApi(api_client) + user_create_input = equinix.services.metalv1.UserCreateInput() # UserCreateInput | User to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create a user + api_instance.create_user(user_create_input, include=include, exclude=exclude) + except Exception as e: + print("Exception when calling UsersApi->create_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_create_input** | [**UserCreateInput**](UserCreateInput.md)| User to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | accepted | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_current_user** +> User find_current_user(include=include, exclude=exclude) + +Retrieve the current user + +Returns the user object for the currently logged-in user. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.user import User +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UsersApi(api_client) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve the current user + api_response = api_instance.find_current_user(include=include, exclude=exclude) + print("The response of UsersApi->find_current_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->find_current_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**User**](User.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_invitations** +> InvitationList find_invitations(include=include, page=page, per_page=per_page) + +Retrieve current user invitations + +Returns all invitations in current user. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.invitation_list import InvitationList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UsersApi(api_client) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve current user invitations + api_response = api_instance.find_invitations(include=include, page=page, per_page=per_page) + print("The response of UsersApi->find_invitations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->find_invitations: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**InvitationList**](InvitationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_user_by_id** +> User find_user_by_id(id, include=include, exclude=exclude) + +Retrieve a user + +Returns a single user if the user has access + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.user import User +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UsersApi(api_client) + id = 'id_example' # str | User UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve a user + api_response = api_instance.find_user_by_id(id, include=include, exclude=exclude) + print("The response of UsersApi->find_user_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->find_user_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| User UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**User**](User.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_user_customdata** +> find_user_customdata(id) + +Retrieve the custom metadata of a user + +Provides the custom metadata stored for this user in json format + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UsersApi(api_client) + id = 'id_example' # str | User UUID + + try: + # Retrieve the custom metadata of a user + api_instance.find_user_customdata(id) + except Exception as e: + print("Exception when calling UsersApi->find_user_customdata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| User UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_users** +> UserList find_users(include=include, exclude=exclude, page=page, per_page=per_page) + +Retrieve all users + +Returns a list of users that the are accessible to the current user (all users in the current user’s projects, essentially). + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.user_list import UserList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UsersApi(api_client) + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page = 1 # int | Page to return (optional) (default to 1) + per_page = 10 # int | Items returned per page (optional) (default to 10) + + try: + # Retrieve all users + api_response = api_instance.find_users(include=include, exclude=exclude, page=page, per_page=per_page) + print("The response of UsersApi->find_users:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->find_users: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **page** | **int**| Page to return | [optional] [default to 1] + **per_page** | **int**| Items returned per page | [optional] [default to 10] + +### Return type + +[**UserList**](UserList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_users_all_pages** +> UserList find_users_all_pages(include=include, exclude=exclude, per_page=per_page) +Just like [**find_users**](UsersApi.md#find_users) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**find_users**](UsersApi.md#find_users). +# **update_current_user** +> User update_current_user(user_update_input, include=include, exclude=exclude) + +Update the current user + +Updates the currently logged-in user. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.user import User +from equinix.services.metalv1.models.user_update_input import UserUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.UsersApi(api_client) + user_update_input = equinix.services.metalv1.UserUpdateInput() # UserUpdateInput | User to update + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Update the current user + api_response = api_instance.update_current_user(user_update_input, include=include, exclude=exclude) + print("The response of UsersApi->update_current_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UsersApi->update_current_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_update_input** | [**UserUpdateInput**](UserUpdateInput.md)| User to update | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**User**](User.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/VLANsApi.md b/equinix/services/metalv1/docs/VLANsApi.md new file mode 100644 index 00000000..f7bdf06c --- /dev/null +++ b/equinix/services/metalv1/docs/VLANsApi.md @@ -0,0 +1,450 @@ +# equinix.services.metalv1.VLANsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_virtual_network**](VLANsApi.md#create_virtual_network) | **POST** /projects/{id}/virtual-networks | Create a virtual network +[**delete_virtual_network**](VLANsApi.md#delete_virtual_network) | **DELETE** /virtual-networks/{id} | Delete a virtual network +[**find_virtual_networks**](VLANsApi.md#find_virtual_networks) | **GET** /projects/{id}/virtual-networks | Retrieve all virtual networks +[**get_virtual_network**](VLANsApi.md#get_virtual_network) | **GET** /virtual-networks/{id} | Get a virtual network +[**update_virtual_network**](VLANsApi.md#update_virtual_network) | **PUT** /virtual-networks/{id} | Updates the virtual network + + +# **create_virtual_network** +> VirtualNetwork create_virtual_network(id, virtual_network_create_input, include=include, exclude=exclude) + +Create a virtual network + +Creates an virtual network. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.virtual_network import VirtualNetwork +from equinix.services.metalv1.models.virtual_network_create_input import VirtualNetworkCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VLANsApi(api_client) + id = 'id_example' # str | Project UUID + virtual_network_create_input = equinix.services.metalv1.VirtualNetworkCreateInput() # VirtualNetworkCreateInput | Virtual Network to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create a virtual network + api_response = api_instance.create_virtual_network(id, virtual_network_create_input, include=include, exclude=exclude) + print("The response of VLANsApi->create_virtual_network:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VLANsApi->create_virtual_network: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **virtual_network_create_input** | [**VirtualNetworkCreateInput**](VirtualNetworkCreateInput.md)| Virtual Network to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VirtualNetwork**](VirtualNetwork.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_virtual_network** +> delete_virtual_network(id, include=include, exclude=exclude) + +Delete a virtual network + +Deletes a virtual network. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VLANsApi(api_client) + id = 'id_example' # str | Virtual Network UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Delete a virtual network + api_instance.delete_virtual_network(id, include=include, exclude=exclude) + except Exception as e: + print("Exception when calling VLANsApi->delete_virtual_network: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Virtual Network UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_virtual_networks** +> VirtualNetworkList find_virtual_networks(id, include=include, exclude=exclude, facility=facility, metro=metro) + +Retrieve all virtual networks + +Provides a list of virtual networks for a single project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.virtual_network_list import VirtualNetworkList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VLANsApi(api_client) + id = 'id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + facility = 'facility_example' # str | Filter by Facility ID (uuid) or Facility Code (optional) + metro = 'metro_example' # str | Filter by Metro ID (uuid) or Metro Code (optional) + + try: + # Retrieve all virtual networks + api_response = api_instance.find_virtual_networks(id, include=include, exclude=exclude, facility=facility, metro=metro) + print("The response of VLANsApi->find_virtual_networks:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VLANsApi->find_virtual_networks: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **facility** | **str**| Filter by Facility ID (uuid) or Facility Code | [optional] + **metro** | **str**| Filter by Metro ID (uuid) or Metro Code | [optional] + +### Return type + +[**VirtualNetworkList**](VirtualNetworkList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_virtual_network** +> VirtualNetwork get_virtual_network(id, include=include, exclude=exclude) + +Get a virtual network + +Get a virtual network. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.virtual_network import VirtualNetwork +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VLANsApi(api_client) + id = 'id_example' # str | Virtual Network UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Get a virtual network + api_response = api_instance.get_virtual_network(id, include=include, exclude=exclude) + print("The response of VLANsApi->get_virtual_network:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VLANsApi->get_virtual_network: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Virtual Network UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VirtualNetwork**](VirtualNetwork.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_virtual_network** +> VirtualNetwork update_virtual_network(id, virtual_network_update_input, include=include, exclude=exclude) + +Updates the virtual network + +Updates the virtual network. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.virtual_network import VirtualNetwork +from equinix.services.metalv1.models.virtual_network_update_input import VirtualNetworkUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VLANsApi(api_client) + id = 'id_example' # str | Virtual Network UUID + virtual_network_update_input = equinix.services.metalv1.VirtualNetworkUpdateInput() # VirtualNetworkUpdateInput | Virtual network to update + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Updates the virtual network + api_response = api_instance.update_virtual_network(id, virtual_network_update_input, include=include, exclude=exclude) + print("The response of VLANsApi->update_virtual_network:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VLANsApi->update_virtual_network: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Virtual Network UUID | + **virtual_network_update_input** | [**VirtualNetworkUpdateInput**](VirtualNetworkUpdateInput.md)| Virtual network to update | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VirtualNetwork**](VirtualNetwork.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | +**429** | too many requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/VRFsApi.md b/equinix/services/metalv1/docs/VRFsApi.md new file mode 100644 index 00000000..d92c2f06 --- /dev/null +++ b/equinix/services/metalv1/docs/VRFsApi.md @@ -0,0 +1,1381 @@ +# equinix.services.metalv1.VRFsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**bgp_dynamic_neighbors_id_get**](VRFsApi.md#bgp_dynamic_neighbors_id_get) | **GET** /bgp-dynamic-neighbors/{id} | Retrieve a BGP Dynamic Neighbor +[**create_vrf**](VRFsApi.md#create_vrf) | **POST** /projects/{id}/vrfs | Create a new VRF in the specified project +[**create_vrf_route**](VRFsApi.md#create_vrf_route) | **POST** /vrfs/{id}/routes | Create a VRF route +[**delete_bgp_dynamic_neighbor_by_id**](VRFsApi.md#delete_bgp_dynamic_neighbor_by_id) | **DELETE** /bgp-dynamic-neighbors/{id} | Delete a VRF BGP Dynamic Neighbor +[**delete_vrf**](VRFsApi.md#delete_vrf) | **DELETE** /vrfs/{id} | Delete the VRF +[**delete_vrf_route_by_id**](VRFsApi.md#delete_vrf_route_by_id) | **DELETE** /routes/{id} | Delete a VRF Route +[**find_vrf_by_id**](VRFsApi.md#find_vrf_by_id) | **GET** /vrfs/{id} | Retrieve a VRF +[**find_vrf_ip_reservation**](VRFsApi.md#find_vrf_ip_reservation) | **GET** /vrfs/{vrf_id}/ips/{id} | Retrieve the Specified VRF IP Reservation +[**find_vrf_ip_reservations**](VRFsApi.md#find_vrf_ip_reservations) | **GET** /vrfs/{id}/ips | Retrieve all VRF IP Reservations in the VRF +[**find_vrf_route_by_id**](VRFsApi.md#find_vrf_route_by_id) | **GET** /routes/{id} | Retrieve a VRF Route +[**find_vrfs**](VRFsApi.md#find_vrfs) | **GET** /projects/{id}/vrfs | Retrieve all VRFs in the project +[**get_vrf_bgp_neighbors**](VRFsApi.md#get_vrf_bgp_neighbors) | **GET** /vrfs/{id}/bgp-neighbors | Retrieve BGP neighbor states for the VRF +[**get_vrf_learned_routes**](VRFsApi.md#get_vrf_learned_routes) | **GET** /vrfs/{id}/learned-routes | Retrieve learned L3 routes within the VRF +[**get_vrf_routes**](VRFsApi.md#get_vrf_routes) | **GET** /vrfs/{id}/routes | Retrieve all routes in the VRF +[**update_vrf**](VRFsApi.md#update_vrf) | **PUT** /vrfs/{id} | Update the VRF +[**update_vrf_route_by_id**](VRFsApi.md#update_vrf_route_by_id) | **PUT** /routes/{id} | Update a VRF Route + + +# **bgp_dynamic_neighbors_id_get** +> BgpDynamicNeighbor bgp_dynamic_neighbors_id_get(id, include=include, exclude=exclude) + +Retrieve a BGP Dynamic Neighbor + +Return a single BGP Dynamic Neighbor resource + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_dynamic_neighbor import BgpDynamicNeighbor +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | BGP Dynamic Neighbor UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve a BGP Dynamic Neighbor + api_response = api_instance.bgp_dynamic_neighbors_id_get(id, include=include, exclude=exclude) + print("The response of VRFsApi->bgp_dynamic_neighbors_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->bgp_dynamic_neighbors_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| BGP Dynamic Neighbor UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**BgpDynamicNeighbor**](BgpDynamicNeighbor.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_vrf** +> Vrf create_vrf(id, vrf_create_input, include=include, exclude=exclude) + +Create a new VRF in the specified project + +Creates a new VRF in the specified project + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf import Vrf +from equinix.services.metalv1.models.vrf_create_input import VrfCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | Project UUID + vrf_create_input = equinix.services.metalv1.VrfCreateInput() # VrfCreateInput | VRF to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create a new VRF in the specified project + api_response = api_instance.create_vrf(id, vrf_create_input, include=include, exclude=exclude) + print("The response of VRFsApi->create_vrf:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->create_vrf: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **vrf_create_input** | [**VrfCreateInput**](VrfCreateInput.md)| VRF to create | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Vrf**](Vrf.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | created | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **create_vrf_route** +> VrfRoute create_vrf_route(id, vrf_route_create_input, include=include, exclude=exclude) + +Create a VRF route + +Create a route in a VRF. Currently only static default routes are supported. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf_route import VrfRoute +from equinix.services.metalv1.models.vrf_route_create_input import VrfRouteCreateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF UUID + vrf_route_create_input = equinix.services.metalv1.VrfRouteCreateInput() # VrfRouteCreateInput | + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Create a VRF route + api_response = api_instance.create_vrf_route(id, vrf_route_create_input, include=include, exclude=exclude) + print("The response of VRFsApi->create_vrf_route:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->create_vrf_route: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF UUID | + **vrf_route_create_input** | [**VrfRouteCreateInput**](VrfRouteCreateInput.md)| | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VrfRoute**](VrfRoute.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_bgp_dynamic_neighbor_by_id** +> BgpDynamicNeighbor delete_bgp_dynamic_neighbor_by_id(id, include=include, exclude=exclude) + +Delete a VRF BGP Dynamic Neighbor + +Trigger the removal of a BGP Neighbor range from a VRF + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.bgp_dynamic_neighbor import BgpDynamicNeighbor +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | BGP Dynamic Neighbor UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Delete a VRF BGP Dynamic Neighbor + api_response = api_instance.delete_bgp_dynamic_neighbor_by_id(id, include=include, exclude=exclude) + print("The response of VRFsApi->delete_bgp_dynamic_neighbor_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->delete_bgp_dynamic_neighbor_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| BGP Dynamic Neighbor UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**BgpDynamicNeighbor**](BgpDynamicNeighbor.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Accepted | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_vrf** +> delete_vrf(id) + +Delete the VRF + +Deletes the VRF + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF UUID + + try: + # Delete the VRF + api_instance.delete_vrf(id) + except Exception as e: + print("Exception when calling VRFsApi->delete_vrf: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF UUID | + +### Return type + +void (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | no content | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_vrf_route_by_id** +> VrfRoute delete_vrf_route_by_id(id, include=include, exclude=exclude) + +Delete a VRF Route + +Trigger the deletion of a VRF Route resource. The status of the route will update to 'deleting', and the route resource will remain accessible while background operations remove the route from the network. Once the route has been removed from the network, the resource will be fully deleted. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf_route import VrfRoute +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF Route UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Delete a VRF Route + api_response = api_instance.delete_vrf_route_by_id(id, include=include, exclude=exclude) + print("The response of VRFsApi->delete_vrf_route_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->delete_vrf_route_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF Route UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VrfRoute**](VrfRoute.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Accepted | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_vrf_by_id** +> Vrf find_vrf_by_id(id, include=include, exclude=exclude) + +Retrieve a VRF + +Returns a single VRF resource + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf import Vrf +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve a VRF + api_response = api_instance.find_vrf_by_id(id, include=include, exclude=exclude) + print("The response of VRFsApi->find_vrf_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->find_vrf_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Vrf**](Vrf.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_vrf_ip_reservation** +> VrfIpReservation find_vrf_ip_reservation(vrf_id, id, include=include, exclude=exclude) + +Retrieve the Specified VRF IP Reservation + +Returns the specified IP Reservation for the VRF. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf_ip_reservation import VrfIpReservation +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + vrf_id = 'vrf_id_example' # str | VRF UUID + id = 'id_example' # str | IP UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve the Specified VRF IP Reservation + api_response = api_instance.find_vrf_ip_reservation(vrf_id, id, include=include, exclude=exclude) + print("The response of VRFsApi->find_vrf_ip_reservation:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->find_vrf_ip_reservation: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **vrf_id** | **str**| VRF UUID | + **id** | **str**| IP UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VrfIpReservation**](VrfIpReservation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_vrf_ip_reservations** +> VrfIpReservationList find_vrf_ip_reservations(id, include=include, exclude=exclude) + +Retrieve all VRF IP Reservations in the VRF + +Returns the list of VRF IP Reservations for the VRF. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf_ip_reservation_list import VrfIpReservationList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve all VRF IP Reservations in the VRF + api_response = api_instance.find_vrf_ip_reservations(id, include=include, exclude=exclude) + print("The response of VRFsApi->find_vrf_ip_reservations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->find_vrf_ip_reservations: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VrfIpReservationList**](VrfIpReservationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_vrf_route_by_id** +> VrfRoute find_vrf_route_by_id(id, include=include, exclude=exclude) + +Retrieve a VRF Route + +Returns a single VRF Route resource + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf_route import VrfRoute +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF Route UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve a VRF Route + api_response = api_instance.find_vrf_route_by_id(id, include=include, exclude=exclude) + print("The response of VRFsApi->find_vrf_route_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->find_vrf_route_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF Route UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VrfRoute**](VrfRoute.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **find_vrfs** +> VrfList find_vrfs(id, include=include, exclude=exclude, metro=metro) + +Retrieve all VRFs in the project + +Returns the list of VRFs for a single project. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf_list import VrfList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | Project UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + metro = 'metro_example' # str | Filter by Metro ID (uuid) or Metro Code (optional) + + try: + # Retrieve all VRFs in the project + api_response = api_instance.find_vrfs(id, include=include, exclude=exclude, metro=metro) + print("The response of VRFsApi->find_vrfs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->find_vrfs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Project UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + **metro** | **str**| Filter by Metro ID (uuid) or Metro Code | [optional] + +### Return type + +[**VrfList**](VrfList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_vrf_bgp_neighbors** +> VrfBGPNeighborsList get_vrf_bgp_neighbors(id) + +Retrieve BGP neighbor states for the VRF + +Provides BGP peering information such as the IP and state of the neighbor. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf_bgp_neighbors_list import VrfBGPNeighborsList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF UUID + + try: + # Retrieve BGP neighbor states for the VRF + api_response = api_instance.get_vrf_bgp_neighbors(id) + print("The response of VRFsApi->get_vrf_bgp_neighbors:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->get_vrf_bgp_neighbors: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF UUID | + +### Return type + +[**VrfBGPNeighborsList**](VrfBGPNeighborsList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_vrf_learned_routes** +> VrfLearnedRoutesList get_vrf_learned_routes(id) + +Retrieve learned L3 routes within the VRF + +Provides information about learned routes for the VRF. The VRF builds this information dynamically though BGP from other routers in the network. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf_learned_routes_list import VrfLearnedRoutesList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF UUID + + try: + # Retrieve learned L3 routes within the VRF + api_response = api_instance.get_vrf_learned_routes(id) + print("The response of VRFsApi->get_vrf_learned_routes:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->get_vrf_learned_routes: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF UUID | + +### Return type + +[**VrfLearnedRoutesList**](VrfLearnedRoutesList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**403** | forbidden | - | +**404** | not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_vrf_routes** +> VrfRouteList get_vrf_routes(id, include=include, exclude=exclude) + +Retrieve all routes in the VRF + +Returns the list of routes for the VRF + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf_route_list import VrfRouteList +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF UUID + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Retrieve all routes in the VRF + api_response = api_instance.get_vrf_routes(id, include=include, exclude=exclude) + print("The response of VRFsApi->get_vrf_routes:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->get_vrf_routes: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF UUID | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VrfRouteList**](VrfRouteList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_vrf** +> Vrf update_vrf(id, vrf_update_input, include=include, exclude=exclude) + +Update the VRF + +Updates the VRF. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf import Vrf +from equinix.services.metalv1.models.vrf_update_input import VrfUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF UUID + vrf_update_input = equinix.services.metalv1.VrfUpdateInput() # VrfUpdateInput | VRF to update + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Update the VRF + api_response = api_instance.update_vrf(id, vrf_update_input, include=include, exclude=exclude) + print("The response of VRFsApi->update_vrf:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->update_vrf: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF UUID | + **vrf_update_input** | [**VrfUpdateInput**](VrfUpdateInput.md)| VRF to update | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**Vrf**](Vrf.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | ok | - | +**401** | unauthorized | - | +**403** | forbidden | - | +**404** | not found | - | +**422** | unprocessable entity | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_vrf_route_by_id** +> VrfRoute update_vrf_route_by_id(id, vrf_route_update_input, include=include, exclude=exclude) + +Update a VRF Route + +Requests a VRF Route be redeployed across the network. Updating the prefix or next-hop address on a route is not currently supported. + +### Example + +* Api Key Authentication (x_auth_token): + +```python +import equinix.services.metalv1 +from equinix.services.metalv1.models.vrf_route import VrfRoute +from equinix.services.metalv1.models.vrf_route_update_input import VrfRouteUpdateInput +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.VRFsApi(api_client) + id = 'id_example' # str | VRF Route UUID + vrf_route_update_input = equinix.services.metalv1.VrfRouteUpdateInput() # VrfRouteUpdateInput | + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude = ['exclude_example'] # List[str] | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + try: + # Update a VRF Route + api_response = api_instance.update_vrf_route_by_id(id, vrf_route_update_input, include=include, exclude=exclude) + print("The response of VRFsApi->update_vrf_route_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VRFsApi->update_vrf_route_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| VRF Route UUID | + **vrf_route_update_input** | [**VrfRouteUpdateInput**](VrfRouteUpdateInput.md)| | + **include** | [**List[str]**](str.md)| Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [optional] + **exclude** | [**List[str]**](str.md)| Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [optional] + +### Return type + +[**VrfRoute**](VrfRoute.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Accepted | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**422** | Unprocessable Entity | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/equinix/services/metalv1/docs/VerifyEmail.md b/equinix/services/metalv1/docs/VerifyEmail.md new file mode 100644 index 00000000..c3e0971f --- /dev/null +++ b/equinix/services/metalv1/docs/VerifyEmail.md @@ -0,0 +1,30 @@ +# VerifyEmail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**user_token** | **str** | User verification token | + +## Example + +```python +from equinix.services.metalv1.models.verify_email import VerifyEmail + +# TODO update the JSON string below +json = "{}" +# create an instance of VerifyEmail from a JSON string +verify_email_instance = VerifyEmail.from_json(json) +# print the JSON string representation of the object +print(VerifyEmail.to_json()) + +# convert the object into a dict +verify_email_dict = verify_email_instance.to_dict() +# create an instance of VerifyEmail from a dict +verify_email_form_dict = verify_email.from_dict(verify_email_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/VirtualCircuit.md b/equinix/services/metalv1/docs/VirtualCircuit.md new file mode 100644 index 00000000..c8ecd443 --- /dev/null +++ b/equinix/services/metalv1/docs/VirtualCircuit.md @@ -0,0 +1,55 @@ +# VirtualCircuit + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bill** | **bool** | True if the Virtual Circuit is being billed. Currently, only Virtual Circuits of Fabric VCs (Metal Billed) will be billed. Usage will start the first time the Virtual Circuit becomes active, and will not stop until it is deleted from Metal. | [optional] [default to False] +**bill_type** | **str** | Fabric Billed if the Virtual Circuit is billed by Fabric. Metal Billed if the Virtual Circuit is billed by Metal. Legacy Virtual Circuits will have a value of nil. | [optional] +**created_at** | **datetime** | | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**nni_vlan** | **int** | | [optional] +**port** | [**InterconnectionPort**](InterconnectionPort.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**provider_connection_id** | **str** | This field is relevant if using the `shared_port_vlan_to_csp` interconnection type. Once activated on the CSP, this field should contain the resource name that the virtual circuit is connected to on the provider's end. | [optional] +**speed** | **int** | integer representing bps speed | [optional] +**status** | **str** | The status changes of a VRF virtual circuit are generally the same as Virtual Circuits that aren't in a VRF. However, for VRF Virtual Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' once the Fabric service token associated with the virtual circuit has been redeemed on Fabric, and Metal has found the associated Fabric connection. At this point, users can update the subnet, MD5 password, customer IP and/or metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, we require all peering details to be set on creation of a VRF Virtual Circuit. The status will change to `changing_peering_details` whenever an active VRF Virtual Circuit has any of its peering details updated. | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] +**virtual_network** | [**Href**](Href.md) | | [optional] +**vnid** | **int** | | [optional] +**customer_ip** | **str** | An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**customer_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, the last usable IP address in the subnet IPv6 will be used. | [optional] +**md5** | **str** | The MD5 password for the BGP peering in plaintext (not a checksum). | [optional] +**metal_ip** | **str** | An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**metal_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, the first usable IPv6 address in the subnet IPv6 will be used. | [optional] +**peer_asn** | **int** | The peer ASN that will be used with the VRF on the Virtual Circuit. | [optional] +**subnet** | **str** | The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. | [optional] +**subnet_ipv6** | **str** | The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined IP Range for the VRF. | [optional] +**vrf** | [**Vrf**](Vrf.md) | | + +## Example + +```python +from equinix.services.metalv1.models.virtual_circuit import VirtualCircuit + +# TODO update the JSON string below +json = "{}" +# create an instance of VirtualCircuit from a JSON string +virtual_circuit_instance = VirtualCircuit.from_json(json) +# print the JSON string representation of the object +print(VirtualCircuit.to_json()) + +# convert the object into a dict +virtual_circuit_dict = virtual_circuit_instance.to_dict() +# create an instance of VirtualCircuit from a dict +virtual_circuit_form_dict = virtual_circuit.from_dict(virtual_circuit_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/VirtualCircuitCreateInput.md b/equinix/services/metalv1/docs/VirtualCircuitCreateInput.md new file mode 100644 index 00000000..e5419075 --- /dev/null +++ b/equinix/services/metalv1/docs/VirtualCircuitCreateInput.md @@ -0,0 +1,45 @@ +# VirtualCircuitCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**name** | **str** | | [optional] +**nni_vlan** | **int** | | +**project_id** | **str** | | +**speed** | **str** | speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps') | [optional] +**tags** | **List[str]** | | [optional] +**vnid** | **str** | A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project (sent as integer). | [optional] +**customer_ip** | **str** | An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**customer_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, the last usable IP address in the subnet IPv6 will be used. | [optional] +**md5** | **str** | The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character | [optional] +**metal_ip** | **str** | An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**metal_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, the first usable IPv6 address in the subnet IPv6 will be used. | [optional] +**peer_asn** | **int** | The peer ASN that will be used with the VRF on the Virtual Circuit. | +**subnet** | **str** | The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. The subnet specified must be contained within an already-defined IP Range for the VRF. | +**subnet_ipv6** | **str** | The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined IP Range for the VRF. | [optional] +**vrf** | **str** | The UUID of the VRF that will be associated with the Virtual Circuit. | + +## Example + +```python +from equinix.services.metalv1.models.virtual_circuit_create_input import VirtualCircuitCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VirtualCircuitCreateInput from a JSON string +virtual_circuit_create_input_instance = VirtualCircuitCreateInput.from_json(json) +# print the JSON string representation of the object +print(VirtualCircuitCreateInput.to_json()) + +# convert the object into a dict +virtual_circuit_create_input_dict = virtual_circuit_create_input_instance.to_dict() +# create an instance of VirtualCircuitCreateInput from a dict +virtual_circuit_create_input_form_dict = virtual_circuit_create_input.from_dict(virtual_circuit_create_input_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/VirtualCircuitList.md b/equinix/services/metalv1/docs/VirtualCircuitList.md new file mode 100644 index 00000000..3e84dc28 --- /dev/null +++ b/equinix/services/metalv1/docs/VirtualCircuitList.md @@ -0,0 +1,30 @@ +# VirtualCircuitList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**virtual_circuits** | [**List[VirtualCircuit]**](VirtualCircuit.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.virtual_circuit_list import VirtualCircuitList + +# TODO update the JSON string below +json = "{}" +# create an instance of VirtualCircuitList from a JSON string +virtual_circuit_list_instance = VirtualCircuitList.from_json(json) +# print the JSON string representation of the object +print(VirtualCircuitList.to_json()) + +# convert the object into a dict +virtual_circuit_list_dict = virtual_circuit_list_instance.to_dict() +# create an instance of VirtualCircuitList from a dict +virtual_circuit_list_form_dict = virtual_circuit_list.from_dict(virtual_circuit_list_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/VirtualCircuitUpdateInput.md b/equinix/services/metalv1/docs/VirtualCircuitUpdateInput.md new file mode 100644 index 00000000..b2b75302 --- /dev/null +++ b/equinix/services/metalv1/docs/VirtualCircuitUpdateInput.md @@ -0,0 +1,42 @@ +# VirtualCircuitUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**name** | **str** | | [optional] +**speed** | **str** | Speed can be changed only if it is an interconnection on a Dedicated Port | [optional] +**tags** | **List[str]** | | [optional] +**vnid** | **str** | A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project. | [optional] +**customer_ip** | **str** | An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**customer_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, the last usable IP address in the subnet IPv6 will be used. | [optional] +**md5** | **str** | The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character | [optional] +**metal_ip** | **str** | An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**metal_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, the first usable IPv6 address in the subnet IPv6 will be used. | [optional] +**peer_asn** | **int** | The peer ASN that will be used with the VRF on the Virtual Circuit. | [optional] +**subnet** | **str** | The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. | [optional] +**subnet_ipv6** | **str** | The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined IP Range for the VRF. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.virtual_circuit_update_input import VirtualCircuitUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VirtualCircuitUpdateInput from a JSON string +virtual_circuit_update_input_instance = VirtualCircuitUpdateInput.from_json(json) +# print the JSON string representation of the object +print(VirtualCircuitUpdateInput.to_json()) + +# convert the object into a dict +virtual_circuit_update_input_dict = virtual_circuit_update_input_instance.to_dict() +# create an instance of VirtualCircuitUpdateInput from a dict +virtual_circuit_update_input_form_dict = virtual_circuit_update_input.from_dict(virtual_circuit_update_input_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/VirtualNetwork.md b/equinix/services/metalv1/docs/VirtualNetwork.md new file mode 100644 index 00000000..650c1442 --- /dev/null +++ b/equinix/services/metalv1/docs/VirtualNetwork.md @@ -0,0 +1,41 @@ +# VirtualNetwork + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assigned_to** | [**Project**](Project.md) | | [optional] +**assigned_to_virtual_circuit** | **bool** | True if the virtual network is attached to a virtual circuit. False if not. | [optional] +**created_at** | **datetime** | | [optional] +**description** | **str** | | [optional] +**facility** | [**Href**](Href.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**instances** | [**List[Device]**](Device.md) | A list of instances with ports currently associated to this Virtual Network. | [optional] +**metal_gateways** | [**List[MetalGatewayLite]**](MetalGatewayLite.md) | A list of metal gateways currently associated to this Virtual Network. | [optional] +**metro** | [**Metro**](Metro.md) | | [optional] +**metro_code** | **str** | The Metro code of the metro in which this Virtual Network is defined. | [optional] +**tags** | **List[str]** | | [optional] +**vxlan** | **int** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.virtual_network import VirtualNetwork + +# TODO update the JSON string below +json = "{}" +# create an instance of VirtualNetwork from a JSON string +virtual_network_instance = VirtualNetwork.from_json(json) +# print the JSON string representation of the object +print(VirtualNetwork.to_json()) + +# convert the object into a dict +virtual_network_dict = virtual_network_instance.to_dict() +# create an instance of VirtualNetwork from a dict +virtual_network_form_dict = virtual_network.from_dict(virtual_network_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/VirtualNetworkCreateInput.md b/equinix/services/metalv1/docs/VirtualNetworkCreateInput.md new file mode 100644 index 00000000..585fe30b --- /dev/null +++ b/equinix/services/metalv1/docs/VirtualNetworkCreateInput.md @@ -0,0 +1,34 @@ +# VirtualNetworkCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**facility** | **str** | The UUID (or facility code) for the Facility in which to create this Virtual network. | [optional] +**href** | **str** | | [optional] +**metro** | **str** | The UUID (or metro code) for the Metro in which to create this Virtual Network. | [optional] +**tags** | **List[str]** | | [optional] +**vxlan** | **int** | VLAN ID between 2-3999. Must be unique for the project within the Metro in which this Virtual Network is being created. If no value is specified, the next-available VLAN ID in the range 1000-1999 will be automatically selected. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.virtual_network_create_input import VirtualNetworkCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VirtualNetworkCreateInput from a JSON string +virtual_network_create_input_instance = VirtualNetworkCreateInput.from_json(json) +# print the JSON string representation of the object +print(VirtualNetworkCreateInput.to_json()) + +# convert the object into a dict +virtual_network_create_input_dict = virtual_network_create_input_instance.to_dict() +# create an instance of VirtualNetworkCreateInput from a dict +virtual_network_create_input_form_dict = virtual_network_create_input.from_dict(virtual_network_create_input_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/VirtualNetworkList.md b/equinix/services/metalv1/docs/VirtualNetworkList.md new file mode 100644 index 00000000..5ace1e37 --- /dev/null +++ b/equinix/services/metalv1/docs/VirtualNetworkList.md @@ -0,0 +1,30 @@ +# VirtualNetworkList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**virtual_networks** | [**List[VirtualNetwork]**](VirtualNetwork.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.virtual_network_list import VirtualNetworkList + +# TODO update the JSON string below +json = "{}" +# create an instance of VirtualNetworkList from a JSON string +virtual_network_list_instance = VirtualNetworkList.from_json(json) +# print the JSON string representation of the object +print(VirtualNetworkList.to_json()) + +# convert the object into a dict +virtual_network_list_dict = virtual_network_list_instance.to_dict() +# create an instance of VirtualNetworkList from a dict +virtual_network_list_form_dict = virtual_network_list.from_dict(virtual_network_list_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/VirtualNetworkUpdateInput.md b/equinix/services/metalv1/docs/VirtualNetworkUpdateInput.md new file mode 100644 index 00000000..da1a5d1f --- /dev/null +++ b/equinix/services/metalv1/docs/VirtualNetworkUpdateInput.md @@ -0,0 +1,31 @@ +# VirtualNetworkUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.virtual_network_update_input import VirtualNetworkUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VirtualNetworkUpdateInput from a JSON string +virtual_network_update_input_instance = VirtualNetworkUpdateInput.from_json(json) +# print the JSON string representation of the object +print(VirtualNetworkUpdateInput.to_json()) + +# convert the object into a dict +virtual_network_update_input_dict = virtual_network_update_input_instance.to_dict() +# create an instance of VirtualNetworkUpdateInput from a dict +virtual_network_update_input_form_dict = virtual_network_update_input.from_dict(virtual_network_update_input_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/VlanCSPConnectionCreateInput.md b/equinix/services/metalv1/docs/VlanCSPConnectionCreateInput.md new file mode 100644 index 00000000..4beb03d1 --- /dev/null +++ b/equinix/services/metalv1/docs/VlanCSPConnectionCreateInput.md @@ -0,0 +1,39 @@ +# VlanCSPConnectionCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contact_email** | **str** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. | [optional] +**description** | **str** | | [optional] +**fabric_provider** | [**VlanCSPConnectionCreateInputFabricProvider**](VlanCSPConnectionCreateInputFabricProvider.md) | | +**href** | **str** | | [optional] +**metro** | **str** | A Metro ID or code. When creating 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), or shared connections, 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. | +**name** | **str** | | +**project** | **str** | | +**speed** | **str** | A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | | +**vlans** | **List[int]** | A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. | + +## Example + +```python +from equinix.services.metalv1.models.vlan_csp_connection_create_input import VlanCSPConnectionCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VlanCSPConnectionCreateInput from a JSON string +vlan_csp_connection_create_input_instance = VlanCSPConnectionCreateInput.from_json(json) +# print the JSON string representation of the object +print(VlanCSPConnectionCreateInput.to_json()) + +# convert the object into a dict +vlan_csp_connection_create_input_dict = vlan_csp_connection_create_input_instance.to_dict() +# create an instance of VlanCSPConnectionCreateInput from a dict +vlan_csp_connection_create_input_form_dict = vlan_csp_connection_create_input.from_dict(vlan_csp_connection_create_input_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/VlanCSPConnectionCreateInputFabricProvider.md b/equinix/services/metalv1/docs/VlanCSPConnectionCreateInputFabricProvider.md new file mode 100644 index 00000000..08cd60f4 --- /dev/null +++ b/equinix/services/metalv1/docs/VlanCSPConnectionCreateInputFabricProvider.md @@ -0,0 +1,33 @@ +# VlanCSPConnectionCreateInputFabricProvider + +Configuration information for connecting to external cloud service provider. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_id** | **str** | AWS Account ID | +**href** | **str** | | [optional] +**location** | **str** | | [optional] +**type** | **str** | | + +## Example + +```python +from equinix.services.metalv1.models.vlan_csp_connection_create_input_fabric_provider import VlanCSPConnectionCreateInputFabricProvider + +# TODO update the JSON string below +json = "{}" +# create an instance of VlanCSPConnectionCreateInputFabricProvider from a JSON string +vlan_csp_connection_create_input_fabric_provider_instance = VlanCSPConnectionCreateInputFabricProvider.from_json(json) +# print the JSON string representation of the object +print(VlanCSPConnectionCreateInputFabricProvider.to_json()) + +# convert the object into a dict +vlan_csp_connection_create_input_fabric_provider_dict = vlan_csp_connection_create_input_fabric_provider_instance.to_dict() +# create an instance of VlanCSPConnectionCreateInputFabricProvider from a dict +vlan_csp_connection_create_input_fabric_provider_form_dict = vlan_csp_connection_create_input_fabric_provider.from_dict(vlan_csp_connection_create_input_fabric_provider_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/VlanFabricVcCreateInput.md b/equinix/services/metalv1/docs/VlanFabricVcCreateInput.md new file mode 100644 index 00000000..3a92c713 --- /dev/null +++ b/equinix/services/metalv1/docs/VlanFabricVcCreateInput.md @@ -0,0 +1,41 @@ +# VlanFabricVcCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contact_email** | **str** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. | [optional] +**description** | **str** | | [optional] +**facility_id** | **str** | | [optional] +**href** | **str** | | [optional] +**metro** | **str** | A Metro ID or code. When creating 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), or shared connections, 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. | +**name** | **str** | | +**project** | **str** | | [optional] +**redundancy** | **str** | Either 'primary' or 'redundant'. | +**service_token_type** | **str** | Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. | +**speed** | **str** | A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | When requesting for a Fabric VC, the value of this field should be 'shared'. | +**vlans** | **List[int]** | A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. | + +## Example + +```python +from equinix.services.metalv1.models.vlan_fabric_vc_create_input import VlanFabricVcCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VlanFabricVcCreateInput from a JSON string +vlan_fabric_vc_create_input_instance = VlanFabricVcCreateInput.from_json(json) +# print the JSON string representation of the object +print(VlanFabricVcCreateInput.to_json()) + +# convert the object into a dict +vlan_fabric_vc_create_input_dict = vlan_fabric_vc_create_input_instance.to_dict() +# create an instance of VlanFabricVcCreateInput from a dict +vlan_fabric_vc_create_input_form_dict = vlan_fabric_vc_create_input.from_dict(vlan_fabric_vc_create_input_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/VlanVirtualCircuit.md b/equinix/services/metalv1/docs/VlanVirtualCircuit.md new file mode 100644 index 00000000..26f05567 --- /dev/null +++ b/equinix/services/metalv1/docs/VlanVirtualCircuit.md @@ -0,0 +1,46 @@ +# VlanVirtualCircuit + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bill** | **bool** | True if the Virtual Circuit is being billed. Currently, only Virtual Circuits of Fabric VCs (Metal Billed) will be billed. Usage will start the first time the Virtual Circuit becomes active, and will not stop until it is deleted from Metal. | [optional] [default to False] +**bill_type** | **str** | Fabric Billed if the Virtual Circuit is billed by Fabric. Metal Billed if the Virtual Circuit is billed by Metal. Legacy Virtual Circuits will have a value of nil. | [optional] +**created_at** | **datetime** | | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**nni_vlan** | **int** | | [optional] +**port** | [**InterconnectionPort**](InterconnectionPort.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**provider_connection_id** | **str** | This field is relevant if using the `shared_port_vlan_to_csp` interconnection type. Once activated on the CSP, this field should contain the resource name that the virtual circuit is connected to on the provider's end. | [optional] +**speed** | **int** | For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual Circuits on Fabric VCs (both Metal and Fabric Billed) that have found their corresponding Fabric connection, this is the actual speed of the interconnection that was configured when setting up the interconnection on the Fabric Portal. Details on Fabric VCs are included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. | [optional] +**status** | **str** | The status of a Virtual Circuit is always 'pending' on creation. The status can turn to 'Waiting on Customer VLAN' if a Metro VLAN was not set yet on the Virtual Circuit and is the last step needed for full activation. For Dedicated interconnections, as long as the Dedicated Port has been associated to the Virtual Circuit and a NNI VNID has been set, it will turn to 'waiting_on_customer_vlan'. For Fabric VCs, it will only change to 'waiting_on_customer_vlan' once the corresponding Fabric connection has been found on the Fabric side. If the Fabric service token associated with the Virtual Circuit hasn't been redeemed on Fabric within the expiry time, it will change to an `expired` status. Once a Metro VLAN is set on the Virtual Circuit (which for Fabric VCs, can be set on creation of a Fabric VC) and the necessary set up is done, it will turn into 'Activating' status as it tries to activate the Virtual Circuit. Once the Virtual Circuit fully activates and is configured on the switch, it will turn to staus 'active'. For Fabric VCs (Metal Billed), we will start billing the moment the status of the Virtual Circuit turns to 'active'. If there are any changes to the VLAN after the Virtual Circuit is in an 'active' status, the status will show 'changing_vlan' if a new VLAN has been provided, or 'deactivating' if we are removing the VLAN. When a deletion request is issued for the Virtual Circuit, it will move to a 'deleting' status, and we will immediately unconfigure the switch for the Virtual Circuit and issue a deletion on any associated Fabric connections. Any associated Metro VLANs on the virtual circuit will also be unassociated after the switch has been successfully unconfigured. If there are any associated Fabric connections, we will only fully delete the Virtual Circuit once we have checked that the Fabric connection was fully deprovisioned on Fabric. | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] +**virtual_network** | [**Href**](Href.md) | | [optional] +**vnid** | **int** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vlan_virtual_circuit import VlanVirtualCircuit + +# TODO update the JSON string below +json = "{}" +# create an instance of VlanVirtualCircuit from a JSON string +vlan_virtual_circuit_instance = VlanVirtualCircuit.from_json(json) +# print the JSON string representation of the object +print(VlanVirtualCircuit.to_json()) + +# convert the object into a dict +vlan_virtual_circuit_dict = vlan_virtual_circuit_instance.to_dict() +# create an instance of VlanVirtualCircuit from a dict +vlan_virtual_circuit_form_dict = vlan_virtual_circuit.from_dict(vlan_virtual_circuit_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/VlanVirtualCircuitCreateInput.md b/equinix/services/metalv1/docs/VlanVirtualCircuitCreateInput.md new file mode 100644 index 00000000..b7346346 --- /dev/null +++ b/equinix/services/metalv1/docs/VlanVirtualCircuitCreateInput.md @@ -0,0 +1,36 @@ +# VlanVirtualCircuitCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**name** | **str** | | [optional] +**nni_vlan** | **int** | | [optional] +**project_id** | **str** | | +**speed** | **str** | speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps') | [optional] +**tags** | **List[str]** | | [optional] +**vnid** | **str** | A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project (sent as integer). | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vlan_virtual_circuit_create_input import VlanVirtualCircuitCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VlanVirtualCircuitCreateInput from a JSON string +vlan_virtual_circuit_create_input_instance = VlanVirtualCircuitCreateInput.from_json(json) +# print the JSON string representation of the object +print(VlanVirtualCircuitCreateInput.to_json()) + +# convert the object into a dict +vlan_virtual_circuit_create_input_dict = vlan_virtual_circuit_create_input_instance.to_dict() +# create an instance of VlanVirtualCircuitCreateInput from a dict +vlan_virtual_circuit_create_input_form_dict = vlan_virtual_circuit_create_input.from_dict(vlan_virtual_circuit_create_input_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/VlanVirtualCircuitUpdateInput.md b/equinix/services/metalv1/docs/VlanVirtualCircuitUpdateInput.md new file mode 100644 index 00000000..23b75496 --- /dev/null +++ b/equinix/services/metalv1/docs/VlanVirtualCircuitUpdateInput.md @@ -0,0 +1,34 @@ +# VlanVirtualCircuitUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**name** | **str** | | [optional] +**speed** | **str** | Speed can be changed only if it is an interconnection on a Dedicated Port | [optional] +**tags** | **List[str]** | | [optional] +**vnid** | **str** | A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vlan_virtual_circuit_update_input import VlanVirtualCircuitUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VlanVirtualCircuitUpdateInput from a JSON string +vlan_virtual_circuit_update_input_instance = VlanVirtualCircuitUpdateInput.from_json(json) +# print the JSON string representation of the object +print(VlanVirtualCircuitUpdateInput.to_json()) + +# convert the object into a dict +vlan_virtual_circuit_update_input_dict = vlan_virtual_circuit_update_input_instance.to_dict() +# create an instance of VlanVirtualCircuitUpdateInput from a dict +vlan_virtual_circuit_update_input_form_dict = vlan_virtual_circuit_update_input.from_dict(vlan_virtual_circuit_update_input_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/Vrf.md b/equinix/services/metalv1/docs/Vrf.md new file mode 100644 index 00000000..7b68276c --- /dev/null +++ b/equinix/services/metalv1/docs/Vrf.md @@ -0,0 +1,45 @@ +# Vrf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bgp_dynamic_neighbors_bfd_enabled** | **bool** | Toggle BFD on dynamic bgp neighbors sessions | [optional] +**bgp_dynamic_neighbors_enabled** | **bool** | Toggle to enable the dynamic bgp neighbors feature on the VRF | [optional] +**bgp_dynamic_neighbors_export_route_map** | **bool** | Toggle to export the VRF route-map to the dynamic bgp neighbors | [optional] +**bill** | **bool** | True if the VRF is being billed. Usage will start when the first VRF Virtual Circuit is active, and will only stop when the VRF has been deleted. | [optional] [default to False] +**created_at** | **datetime** | | [optional] +**created_by** | [**User**](User.md) | | [optional] +**description** | **str** | Optional field that can be set to describe the VRF | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**ip_ranges** | **List[str]** | A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/59\"]. | [optional] +**local_asn** | **int** | A 4-byte ASN associated with the VRF. | [optional] +**metro** | [**Metro**](Metro.md) | | [optional] +**name** | **str** | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**tags** | **List[str]** | | [optional] +**updated_at** | **datetime** | | [optional] +**virtual_circuits** | [**List[VrfVirtualCircuit]**](VrfVirtualCircuit.md) | Virtual circuits that are in the VRF | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf import Vrf + +# TODO update the JSON string below +json = "{}" +# create an instance of Vrf from a JSON string +vrf_instance = Vrf.from_json(json) +# print the JSON string representation of the object +print(Vrf.to_json()) + +# convert the object into a dict +vrf_dict = vrf_instance.to_dict() +# create an instance of Vrf from a dict +vrf_form_dict = vrf.from_dict(vrf_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/VrfBGPNeighbors.md b/equinix/services/metalv1/docs/VrfBGPNeighbors.md new file mode 100644 index 00000000..92713a8a --- /dev/null +++ b/equinix/services/metalv1/docs/VrfBGPNeighbors.md @@ -0,0 +1,32 @@ +# VrfBGPNeighbors + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**peer_as** | **int** | The ASN of the peer that advertised the prefix. | [optional] +**peer_ip** | **str** | | [optional] +**state** | **str** | The current status of the connection to the BGP peer. State is either up or down. | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_bgp_neighbors import VrfBGPNeighbors + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfBGPNeighbors from a JSON string +vrf_bgp_neighbors_instance = VrfBGPNeighbors.from_json(json) +# print the JSON string representation of the object +print(VrfBGPNeighbors.to_json()) + +# convert the object into a dict +vrf_bgp_neighbors_dict = vrf_bgp_neighbors_instance.to_dict() +# create an instance of VrfBGPNeighbors from a dict +vrf_bgp_neighbors_form_dict = vrf_bgp_neighbors.from_dict(vrf_bgp_neighbors_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/VrfBGPNeighborsList.md b/equinix/services/metalv1/docs/VrfBGPNeighborsList.md new file mode 100644 index 00000000..569e274d --- /dev/null +++ b/equinix/services/metalv1/docs/VrfBGPNeighborsList.md @@ -0,0 +1,30 @@ +# VrfBGPNeighborsList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bgp_neighbors** | [**List[VrfBGPNeighbors]**](VrfBGPNeighbors.md) | | [optional] +**href** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_bgp_neighbors_list import VrfBGPNeighborsList + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfBGPNeighborsList from a JSON string +vrf_bgp_neighbors_list_instance = VrfBGPNeighborsList.from_json(json) +# print the JSON string representation of the object +print(VrfBGPNeighborsList.to_json()) + +# convert the object into a dict +vrf_bgp_neighbors_list_dict = vrf_bgp_neighbors_list_instance.to_dict() +# create an instance of VrfBGPNeighborsList from a dict +vrf_bgp_neighbors_list_form_dict = vrf_bgp_neighbors_list.from_dict(vrf_bgp_neighbors_list_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/VrfCreateInput.md b/equinix/services/metalv1/docs/VrfCreateInput.md new file mode 100644 index 00000000..5fdd31a3 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfCreateInput.md @@ -0,0 +1,38 @@ +# VrfCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bgp_dynamic_neighbors_bfd_enabled** | **bool** | Toggle BFD on dynamic bgp neighbors sessions | [optional] +**bgp_dynamic_neighbors_enabled** | **bool** | Toggle to enable the dynamic bgp neighbors feature on the VRF | [optional] +**bgp_dynamic_neighbors_export_route_map** | **bool** | Toggle to export the VRF route-map to the dynamic bgp neighbors | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**ip_ranges** | **List[str]** | A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/59\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /59 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. | [optional] +**local_asn** | **int** | | [optional] +**metro** | **str** | The UUID (or metro code) for the Metro in which to create this VRF. | +**name** | **str** | | +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_create_input import VrfCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfCreateInput from a JSON string +vrf_create_input_instance = VrfCreateInput.from_json(json) +# print the JSON string representation of the object +print(VrfCreateInput.to_json()) + +# convert the object into a dict +vrf_create_input_dict = vrf_create_input_instance.to_dict() +# create an instance of VrfCreateInput from a dict +vrf_create_input_form_dict = vrf_create_input.from_dict(vrf_create_input_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/VrfFabricVcCreateInput.md b/equinix/services/metalv1/docs/VrfFabricVcCreateInput.md new file mode 100644 index 00000000..ae0a9a90 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfFabricVcCreateInput.md @@ -0,0 +1,41 @@ +# VrfFabricVcCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contact_email** | **str** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. | [optional] +**description** | **str** | | [optional] +**facility_id** | **str** | | [optional] +**href** | **str** | | [optional] +**metro** | **str** | A Metro ID or code. When creating 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), or shared connections, 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. | +**name** | **str** | | +**project** | **str** | | [optional] +**redundancy** | **str** | Either 'primary' or 'redundant'. | +**service_token_type** | **str** | Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. | +**speed** | **str** | A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | When requesting for a Fabric VC, the value of this field should be 'shared'. | +**vrfs** | **List[str]** | This field holds a list of VRF UUIDs that will be set automatically on the virtual circuits of Fabric VCs on creation, and can hold up to two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. The first UUID will be set on the primary virtual circuit, while the second UUID will be set on the secondary. The two UUIDs can be the same if both the primary and secondary virtual circuits will be in the same VRF. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. | + +## Example + +```python +from equinix.services.metalv1.models.vrf_fabric_vc_create_input import VrfFabricVcCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfFabricVcCreateInput from a JSON string +vrf_fabric_vc_create_input_instance = VrfFabricVcCreateInput.from_json(json) +# print the JSON string representation of the object +print(VrfFabricVcCreateInput.to_json()) + +# convert the object into a dict +vrf_fabric_vc_create_input_dict = vrf_fabric_vc_create_input_instance.to_dict() +# create an instance of VrfFabricVcCreateInput from a dict +vrf_fabric_vc_create_input_form_dict = vrf_fabric_vc_create_input.from_dict(vrf_fabric_vc_create_input_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/VrfIpReservation.md b/equinix/services/metalv1/docs/VrfIpReservation.md new file mode 100644 index 00000000..74c011d5 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfIpReservation.md @@ -0,0 +1,52 @@ +# VrfIpReservation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | [optional] +**address_family** | **int** | | [optional] +**bill** | **bool** | | [optional] +**cidr** | **int** | | [optional] +**created_at** | **datetime** | | [optional] +**created_by** | [**Href**](Href.md) | | [optional] +**customdata** | **object** | | [optional] +**details** | **str** | | [optional] +**gateway** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**manageable** | **bool** | | [optional] +**management** | **bool** | | [optional] +**metal_gateway** | [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] +**metro** | [**Metro**](Metro.md) | | [optional] +**netmask** | **str** | | [optional] +**network** | **str** | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**project_lite** | [**Project**](Project.md) | | [optional] +**public** | **bool** | | [optional] +**state** | **str** | | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | | +**vrf** | [**Vrf**](Vrf.md) | | + +## Example + +```python +from equinix.services.metalv1.models.vrf_ip_reservation import VrfIpReservation + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfIpReservation from a JSON string +vrf_ip_reservation_instance = VrfIpReservation.from_json(json) +# print the JSON string representation of the object +print(VrfIpReservation.to_json()) + +# convert the object into a dict +vrf_ip_reservation_dict = vrf_ip_reservation_instance.to_dict() +# create an instance of VrfIpReservation from a dict +vrf_ip_reservation_form_dict = vrf_ip_reservation.from_dict(vrf_ip_reservation_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/VrfIpReservationCreateInput.md b/equinix/services/metalv1/docs/VrfIpReservationCreateInput.md new file mode 100644 index 00000000..bf681f9a --- /dev/null +++ b/equinix/services/metalv1/docs/VrfIpReservationCreateInput.md @@ -0,0 +1,36 @@ +# VrfIpReservationCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cidr** | **int** | The size of the VRF IP Reservation's subnet. The following subnet sizes are supported: - IPv4: between 22 - 29 inclusive - IPv6: exactly 64 | +**customdata** | **object** | | [optional] +**details** | **str** | | [optional] +**href** | **str** | | [optional] +**network** | **str** | The starting address for this VRF IP Reservation's subnet. Both IPv4 and IPv6 are supported. | +**tags** | **List[str]** | | [optional] +**type** | **str** | Must be set to 'vrf' | +**vrf_id** | **str** | The ID of the VRF in which this VRF IP Reservation is created. The VRF must have an existing IP Range that contains the requested subnet. This field may be aliased as just 'vrf'. | + +## Example + +```python +from equinix.services.metalv1.models.vrf_ip_reservation_create_input import VrfIpReservationCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfIpReservationCreateInput from a JSON string +vrf_ip_reservation_create_input_instance = VrfIpReservationCreateInput.from_json(json) +# print the JSON string representation of the object +print(VrfIpReservationCreateInput.to_json()) + +# convert the object into a dict +vrf_ip_reservation_create_input_dict = vrf_ip_reservation_create_input_instance.to_dict() +# create an instance of VrfIpReservationCreateInput from a dict +vrf_ip_reservation_create_input_form_dict = vrf_ip_reservation_create_input.from_dict(vrf_ip_reservation_create_input_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/VrfIpReservationList.md b/equinix/services/metalv1/docs/VrfIpReservationList.md new file mode 100644 index 00000000..c66dc620 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfIpReservationList.md @@ -0,0 +1,30 @@ +# VrfIpReservationList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**ip_addresses** | [**List[VrfIpReservation]**](VrfIpReservation.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_ip_reservation_list import VrfIpReservationList + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfIpReservationList from a JSON string +vrf_ip_reservation_list_instance = VrfIpReservationList.from_json(json) +# print the JSON string representation of the object +print(VrfIpReservationList.to_json()) + +# convert the object into a dict +vrf_ip_reservation_list_dict = vrf_ip_reservation_list_instance.to_dict() +# create an instance of VrfIpReservationList from a dict +vrf_ip_reservation_list_form_dict = vrf_ip_reservation_list.from_dict(vrf_ip_reservation_list_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/VrfLearnedRoutes.md b/equinix/services/metalv1/docs/VrfLearnedRoutes.md new file mode 100644 index 00000000..53c991b7 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfLearnedRoutes.md @@ -0,0 +1,31 @@ +# VrfLearnedRoutes + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**origin_as** | **int** | The ASN of the peer that advertised the prefix. | [optional] +**prefix** | **str** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_learned_routes import VrfLearnedRoutes + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfLearnedRoutes from a JSON string +vrf_learned_routes_instance = VrfLearnedRoutes.from_json(json) +# print the JSON string representation of the object +print(VrfLearnedRoutes.to_json()) + +# convert the object into a dict +vrf_learned_routes_dict = vrf_learned_routes_instance.to_dict() +# create an instance of VrfLearnedRoutes from a dict +vrf_learned_routes_form_dict = vrf_learned_routes.from_dict(vrf_learned_routes_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/VrfLearnedRoutesList.md b/equinix/services/metalv1/docs/VrfLearnedRoutesList.md new file mode 100644 index 00000000..afeef8f0 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfLearnedRoutesList.md @@ -0,0 +1,30 @@ +# VrfLearnedRoutesList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**learned_routes** | [**List[VrfLearnedRoutes]**](VrfLearnedRoutes.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_learned_routes_list import VrfLearnedRoutesList + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfLearnedRoutesList from a JSON string +vrf_learned_routes_list_instance = VrfLearnedRoutesList.from_json(json) +# print the JSON string representation of the object +print(VrfLearnedRoutesList.to_json()) + +# convert the object into a dict +vrf_learned_routes_list_dict = vrf_learned_routes_list_instance.to_dict() +# create an instance of VrfLearnedRoutesList from a dict +vrf_learned_routes_list_form_dict = vrf_learned_routes_list.from_dict(vrf_learned_routes_list_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/VrfList.md b/equinix/services/metalv1/docs/VrfList.md new file mode 100644 index 00000000..19572163 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfList.md @@ -0,0 +1,31 @@ +# VrfList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] +**vrfs** | [**List[Vrf]**](Vrf.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_list import VrfList + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfList from a JSON string +vrf_list_instance = VrfList.from_json(json) +# print the JSON string representation of the object +print(VrfList.to_json()) + +# convert the object into a dict +vrf_list_dict = vrf_list_instance.to_dict() +# create an instance of VrfList from a dict +vrf_list_form_dict = vrf_list.from_dict(vrf_list_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/VrfMetalGateway.md b/equinix/services/metalv1/docs/VrfMetalGateway.md new file mode 100644 index 00000000..bbe7812a --- /dev/null +++ b/equinix/services/metalv1/docs/VrfMetalGateway.md @@ -0,0 +1,38 @@ +# VrfMetalGateway + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**created_by** | [**Href**](Href.md) | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**ip_reservation** | [**VrfIpReservation**](VrfIpReservation.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**state** | **str** | The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. | [optional] +**updated_at** | **datetime** | | [optional] +**virtual_network** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] +**vrf** | [**Vrf**](Vrf.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_metal_gateway import VrfMetalGateway + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfMetalGateway from a JSON string +vrf_metal_gateway_instance = VrfMetalGateway.from_json(json) +# print the JSON string representation of the object +print(VrfMetalGateway.to_json()) + +# convert the object into a dict +vrf_metal_gateway_dict = vrf_metal_gateway_instance.to_dict() +# create an instance of VrfMetalGateway from a dict +vrf_metal_gateway_form_dict = vrf_metal_gateway.from_dict(vrf_metal_gateway_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/VrfMetalGatewayCreateInput.md b/equinix/services/metalv1/docs/VrfMetalGatewayCreateInput.md new file mode 100644 index 00000000..d78f9e76 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfMetalGatewayCreateInput.md @@ -0,0 +1,31 @@ +# VrfMetalGatewayCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**ip_reservation_id** | **str** | The UUID an a VRF IP Reservation that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the VRF IP Reservation and the Virtual Network must reside in the same Metro. | +**virtual_network_id** | **str** | The UUID of a Metro Virtual Network that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the Virtual Network and the VRF IP Reservation must reside in the same metro. In the case of the IP reservation being an IPv6 based VRF IP Reservation, the Virtual Network must not already have an associated IPv6 based VRF IP Reservation. There can be exactly one IPv6 based VRF IP Reservation associated to a Virtual Network. | + +## Example + +```python +from equinix.services.metalv1.models.vrf_metal_gateway_create_input import VrfMetalGatewayCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfMetalGatewayCreateInput from a JSON string +vrf_metal_gateway_create_input_instance = VrfMetalGatewayCreateInput.from_json(json) +# print the JSON string representation of the object +print(VrfMetalGatewayCreateInput.to_json()) + +# convert the object into a dict +vrf_metal_gateway_create_input_dict = vrf_metal_gateway_create_input_instance.to_dict() +# create an instance of VrfMetalGatewayCreateInput from a dict +vrf_metal_gateway_create_input_form_dict = vrf_metal_gateway_create_input.from_dict(vrf_metal_gateway_create_input_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/VrfRoute.md b/equinix/services/metalv1/docs/VrfRoute.md new file mode 100644 index 00000000..e53a3080 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfRoute.md @@ -0,0 +1,40 @@ +# VrfRoute + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] [readonly] +**href** | **str** | | [optional] [readonly] +**id** | **str** | The unique identifier for the newly-created resource | [optional] [readonly] +**metal_gateway** | [**VrfMetalGateway**](VrfMetalGateway.md) | | [optional] +**next_hop** | **str** | The next-hop IPv4 address for the route | [optional] +**prefix** | **str** | The IPv4 prefix for the route, in CIDR-style notation | [optional] +**status** | **str** | The status of the route. Potential values are \"pending\", \"active\", \"deleting\", and \"error\", representing various lifecycle states of the route and whether or not it has been successfully configured on the network | [optional] [readonly] +**tags** | **List[str]** | | [optional] +**type** | **str** | VRF route type, like 'bgp', 'connected', and 'static'. Currently, only static routes are supported | [optional] [readonly] +**updated_at** | **datetime** | | [optional] [readonly] +**virtual_network** | [**VirtualNetwork**](VirtualNetwork.md) | | [optional] +**vrf** | [**Vrf**](Vrf.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_route import VrfRoute + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfRoute from a JSON string +vrf_route_instance = VrfRoute.from_json(json) +# print the JSON string representation of the object +print(VrfRoute.to_json()) + +# convert the object into a dict +vrf_route_dict = vrf_route_instance.to_dict() +# create an instance of VrfRoute from a dict +vrf_route_form_dict = vrf_route.from_dict(vrf_route_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/VrfRouteCreateInput.md b/equinix/services/metalv1/docs/VrfRouteCreateInput.md new file mode 100644 index 00000000..51f2fc41 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfRouteCreateInput.md @@ -0,0 +1,32 @@ +# VrfRouteCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**next_hop** | **str** | The IPv4 address within the VRF of the host that will handle this route | +**prefix** | **str** | The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be \"0.0.0.0/0\" | +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_route_create_input import VrfRouteCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfRouteCreateInput from a JSON string +vrf_route_create_input_instance = VrfRouteCreateInput.from_json(json) +# print the JSON string representation of the object +print(VrfRouteCreateInput.to_json()) + +# convert the object into a dict +vrf_route_create_input_dict = vrf_route_create_input_instance.to_dict() +# create an instance of VrfRouteCreateInput from a dict +vrf_route_create_input_form_dict = vrf_route_create_input.from_dict(vrf_route_create_input_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/VrfRouteList.md b/equinix/services/metalv1/docs/VrfRouteList.md new file mode 100644 index 00000000..1ed10e17 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfRouteList.md @@ -0,0 +1,31 @@ +# VrfRouteList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] +**routes** | [**List[VrfRoute]**](VrfRoute.md) | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_route_list import VrfRouteList + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfRouteList from a JSON string +vrf_route_list_instance = VrfRouteList.from_json(json) +# print the JSON string representation of the object +print(VrfRouteList.to_json()) + +# convert the object into a dict +vrf_route_list_dict = vrf_route_list_instance.to_dict() +# create an instance of VrfRouteList from a dict +vrf_route_list_form_dict = vrf_route_list.from_dict(vrf_route_list_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/VrfRouteUpdateInput.md b/equinix/services/metalv1/docs/VrfRouteUpdateInput.md new file mode 100644 index 00000000..b5ad613d --- /dev/null +++ b/equinix/services/metalv1/docs/VrfRouteUpdateInput.md @@ -0,0 +1,32 @@ +# VrfRouteUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**next_hop** | **str** | The IPv4 address within the VRF of the host that will handle this route | [optional] +**prefix** | **str** | The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be \"0.0.0.0/0\" | [optional] +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_route_update_input import VrfRouteUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfRouteUpdateInput from a JSON string +vrf_route_update_input_instance = VrfRouteUpdateInput.from_json(json) +# print the JSON string representation of the object +print(VrfRouteUpdateInput.to_json()) + +# convert the object into a dict +vrf_route_update_input_dict = vrf_route_update_input_instance.to_dict() +# create an instance of VrfRouteUpdateInput from a dict +vrf_route_update_input_form_dict = vrf_route_update_input.from_dict(vrf_route_update_input_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/VrfUpdateInput.md b/equinix/services/metalv1/docs/VrfUpdateInput.md new file mode 100644 index 00000000..45fea598 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfUpdateInput.md @@ -0,0 +1,37 @@ +# VrfUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bgp_dynamic_neighbors_bfd_enabled** | **bool** | Toggle BFD on dynamic bgp neighbors sessions | [optional] +**bgp_dynamic_neighbors_enabled** | **bool** | Toggle to enable the dynamic bgp neighbors feature on the VRF | [optional] +**bgp_dynamic_neighbors_export_route_map** | **bool** | Toggle to export the VRF route-map to the dynamic bgp neighbors | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**ip_ranges** | **List[str]** | A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/59\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /59 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\\'s associated Metal Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. Specifying a value of `[]` will remove all existing IP Ranges from the VRF. | [optional] +**local_asn** | **int** | The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance. | [optional] +**name** | **str** | | [optional] +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_update_input import VrfUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfUpdateInput from a JSON string +vrf_update_input_instance = VrfUpdateInput.from_json(json) +# print the JSON string representation of the object +print(VrfUpdateInput.to_json()) + +# convert the object into a dict +vrf_update_input_dict = vrf_update_input_instance.to_dict() +# create an instance of VrfUpdateInput from a dict +vrf_update_input_form_dict = vrf_update_input.from_dict(vrf_update_input_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/VrfVirtualCircuit.md b/equinix/services/metalv1/docs/VrfVirtualCircuit.md new file mode 100644 index 00000000..f73aabc1 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfVirtualCircuit.md @@ -0,0 +1,50 @@ +# VrfVirtualCircuit + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] +**customer_ip** | **str** | An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**customer_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, the last usable IP address in the subnet IPv6 will be used. | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**id** | **str** | | [optional] +**md5** | **str** | The MD5 password for the BGP peering in plaintext (not a checksum). | [optional] +**metal_ip** | **str** | An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**metal_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, the first usable IPv6 address in the subnet IPv6 will be used. | [optional] +**name** | **str** | | [optional] +**nni_vlan** | **int** | | [optional] +**peer_asn** | **int** | The peer ASN that will be used with the VRF on the Virtual Circuit. | [optional] +**port** | [**InterconnectionPort**](InterconnectionPort.md) | | [optional] +**project** | [**Project**](Project.md) | | [optional] +**speed** | **int** | integer representing bps speed | [optional] +**status** | **str** | The status changes of a VRF virtual circuit are generally the same as Virtual Circuits that aren't in a VRF. However, for VRF Virtual Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' once the Fabric service token associated with the virtual circuit has been redeemed on Fabric, and Metal has found the associated Fabric connection. At this point, users can update the subnet, MD5 password, customer IP and/or metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, we require all peering details to be set on creation of a VRF Virtual Circuit. The status will change to `changing_peering_details` whenever an active VRF Virtual Circuit has any of its peering details updated. | [optional] +**subnet** | **str** | The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. | [optional] +**subnet_ipv6** | **str** | The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined IP Range for the VRF. | [optional] +**tags** | **List[str]** | | [optional] +**type** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] +**vrf** | [**Vrf**](Vrf.md) | | + +## Example + +```python +from equinix.services.metalv1.models.vrf_virtual_circuit import VrfVirtualCircuit + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfVirtualCircuit from a JSON string +vrf_virtual_circuit_instance = VrfVirtualCircuit.from_json(json) +# print the JSON string representation of the object +print(VrfVirtualCircuit.to_json()) + +# convert the object into a dict +vrf_virtual_circuit_dict = vrf_virtual_circuit_instance.to_dict() +# create an instance of VrfVirtualCircuit from a dict +vrf_virtual_circuit_form_dict = vrf_virtual_circuit.from_dict(vrf_virtual_circuit_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/VrfVirtualCircuitCreateInput.md b/equinix/services/metalv1/docs/VrfVirtualCircuitCreateInput.md new file mode 100644 index 00000000..724ee66f --- /dev/null +++ b/equinix/services/metalv1/docs/VrfVirtualCircuitCreateInput.md @@ -0,0 +1,44 @@ +# VrfVirtualCircuitCreateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customer_ip** | **str** | An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**customer_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, the last usable IP address in the subnet IPv6 will be used. | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**md5** | **str** | The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character | [optional] +**metal_ip** | **str** | An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**metal_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, the first usable IPv6 address in the subnet IPv6 will be used. | [optional] +**name** | **str** | | [optional] +**nni_vlan** | **int** | | +**peer_asn** | **int** | The peer ASN that will be used with the VRF on the Virtual Circuit. | +**project_id** | **str** | | +**speed** | **str** | speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps') | [optional] +**subnet** | **str** | The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. The subnet specified must be contained within an already-defined IP Range for the VRF. | +**subnet_ipv6** | **str** | The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined IP Range for the VRF. | [optional] +**tags** | **List[str]** | | [optional] +**vrf** | **str** | The UUID of the VRF that will be associated with the Virtual Circuit. | + +## Example + +```python +from equinix.services.metalv1.models.vrf_virtual_circuit_create_input import VrfVirtualCircuitCreateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfVirtualCircuitCreateInput from a JSON string +vrf_virtual_circuit_create_input_instance = VrfVirtualCircuitCreateInput.from_json(json) +# print the JSON string representation of the object +print(VrfVirtualCircuitCreateInput.to_json()) + +# convert the object into a dict +vrf_virtual_circuit_create_input_dict = vrf_virtual_circuit_create_input_instance.to_dict() +# create an instance of VrfVirtualCircuitCreateInput from a dict +vrf_virtual_circuit_create_input_form_dict = vrf_virtual_circuit_create_input.from_dict(vrf_virtual_circuit_create_input_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/VrfVirtualCircuitUpdateInput.md b/equinix/services/metalv1/docs/VrfVirtualCircuitUpdateInput.md new file mode 100644 index 00000000..e3cbdcf5 --- /dev/null +++ b/equinix/services/metalv1/docs/VrfVirtualCircuitUpdateInput.md @@ -0,0 +1,41 @@ +# VrfVirtualCircuitUpdateInput + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customer_ip** | **str** | An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**customer_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, the last usable IP address in the subnet IPv6 will be used. | [optional] +**description** | **str** | | [optional] +**href** | **str** | | [optional] +**md5** | **str** | The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character | [optional] +**metal_ip** | **str** | An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**metal_ipv6** | **str** | An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, the first usable IPv6 address in the subnet IPv6 will be used. | [optional] +**name** | **str** | | [optional] +**peer_asn** | **int** | The peer ASN that will be used with the VRF on the Virtual Circuit. | [optional] +**speed** | **str** | Speed can be changed only if it is an interconnection on a Dedicated Port | [optional] +**subnet** | **str** | The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. | [optional] +**subnet_ipv6** | **str** | The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined IP Range for the VRF. | [optional] +**tags** | **List[str]** | | [optional] + +## Example + +```python +from equinix.services.metalv1.models.vrf_virtual_circuit_update_input import VrfVirtualCircuitUpdateInput + +# TODO update the JSON string below +json = "{}" +# create an instance of VrfVirtualCircuitUpdateInput from a JSON string +vrf_virtual_circuit_update_input_instance = VrfVirtualCircuitUpdateInput.from_json(json) +# print the JSON string representation of the object +print(VrfVirtualCircuitUpdateInput.to_json()) + +# convert the object into a dict +vrf_virtual_circuit_update_input_dict = vrf_virtual_circuit_update_input_instance.to_dict() +# create an instance of VrfVirtualCircuitUpdateInput from a dict +vrf_virtual_circuit_update_input_form_dict = vrf_virtual_circuit_update_input.from_dict(vrf_virtual_circuit_update_input_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/exceptions.py b/equinix/services/metalv1/exceptions.py new file mode 100644 index 00000000..8f4d09b1 --- /dev/null +++ b/equinix/services/metalv1/exceptions.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/equinix/services/metalv1/models/__init__.py b/equinix/services/metalv1/models/__init__.py new file mode 100644 index 00000000..69f12bdf --- /dev/null +++ b/equinix/services/metalv1/models/__init__.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +# flake8: noqa +""" + Metal API + + 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 models into model package +from equinix.services.metalv1.models.aws_fabric_provider import AWSFabricProvider +from equinix.services.metalv1.models.activate_hardware_reservation_request import ActivateHardwareReservationRequest +from equinix.services.metalv1.models.address import Address +from equinix.services.metalv1.models.attribute import Attribute +from equinix.services.metalv1.models.attribute_data import AttributeData +from equinix.services.metalv1.models.auth_token import AuthToken +from equinix.services.metalv1.models.auth_token_input import AuthTokenInput +from equinix.services.metalv1.models.auth_token_list import AuthTokenList +from equinix.services.metalv1.models.auth_token_project import AuthTokenProject +from equinix.services.metalv1.models.auth_token_user import AuthTokenUser +from equinix.services.metalv1.models.bgp_session_input import BGPSessionInput +from equinix.services.metalv1.models.batch import Batch +from equinix.services.metalv1.models.batches_list import BatchesList +from equinix.services.metalv1.models.bgp_config import BgpConfig +from equinix.services.metalv1.models.bgp_config_request_input import BgpConfigRequestInput +from equinix.services.metalv1.models.bgp_dynamic_neighbor import BgpDynamicNeighbor +from equinix.services.metalv1.models.bgp_dynamic_neighbor_create_input import BgpDynamicNeighborCreateInput +from equinix.services.metalv1.models.bgp_dynamic_neighbor_list import BgpDynamicNeighborList +from equinix.services.metalv1.models.bgp_neighbor_data import BgpNeighborData +from equinix.services.metalv1.models.bgp_route import BgpRoute +from equinix.services.metalv1.models.bgp_session import BgpSession +from equinix.services.metalv1.models.bgp_session_list import BgpSessionList +from equinix.services.metalv1.models.bgp_session_neighbors import BgpSessionNeighbors +from equinix.services.metalv1.models.bond_port_data import BondPortData +from equinix.services.metalv1.models.capacity_check_per_facility_info import CapacityCheckPerFacilityInfo +from equinix.services.metalv1.models.capacity_check_per_facility_list import CapacityCheckPerFacilityList +from equinix.services.metalv1.models.capacity_check_per_metro_info import CapacityCheckPerMetroInfo +from equinix.services.metalv1.models.capacity_check_per_metro_list import CapacityCheckPerMetroList +from equinix.services.metalv1.models.capacity_input import CapacityInput +from equinix.services.metalv1.models.capacity_level_per_baremetal import CapacityLevelPerBaremetal +from equinix.services.metalv1.models.capacity_list import CapacityList +from equinix.services.metalv1.models.component import Component +from equinix.services.metalv1.models.coordinates import Coordinates +from equinix.services.metalv1.models.create_device_request import CreateDeviceRequest +from equinix.services.metalv1.models.create_email_input import CreateEmailInput +from equinix.services.metalv1.models.create_metal_gateway_request import CreateMetalGatewayRequest +from equinix.services.metalv1.models.create_organization_interconnection_request import CreateOrganizationInterconnectionRequest +from equinix.services.metalv1.models.create_self_service_reservation_request import CreateSelfServiceReservationRequest +from equinix.services.metalv1.models.create_self_service_reservation_request_period import CreateSelfServiceReservationRequestPeriod +from equinix.services.metalv1.models.dedicated_port_create_input import DedicatedPortCreateInput +from equinix.services.metalv1.models.device import Device +from equinix.services.metalv1.models.device_action_input import DeviceActionInput +from equinix.services.metalv1.models.device_actions_inner import DeviceActionsInner +from equinix.services.metalv1.models.device_create_in_facility_input import DeviceCreateInFacilityInput +from equinix.services.metalv1.models.device_create_in_metro_input import DeviceCreateInMetroInput +from equinix.services.metalv1.models.device_create_input import DeviceCreateInput +from equinix.services.metalv1.models.device_created_by import DeviceCreatedBy +from equinix.services.metalv1.models.device_health_rollup import DeviceHealthRollup +from equinix.services.metalv1.models.device_list import DeviceList +from equinix.services.metalv1.models.device_metro import DeviceMetro +from equinix.services.metalv1.models.device_project_lite import DeviceProjectLite +from equinix.services.metalv1.models.device_update_input import DeviceUpdateInput +from equinix.services.metalv1.models.device_usage import DeviceUsage +from equinix.services.metalv1.models.device_usage_list import DeviceUsageList +from equinix.services.metalv1.models.disk import Disk +from equinix.services.metalv1.models.email import Email +from equinix.services.metalv1.models.email_input import EmailInput +from equinix.services.metalv1.models.entitlement import Entitlement +from equinix.services.metalv1.models.error import Error +from equinix.services.metalv1.models.event import Event +from equinix.services.metalv1.models.event_list import EventList +from equinix.services.metalv1.models.fabric_service_token import FabricServiceToken +from equinix.services.metalv1.models.facility import Facility +from equinix.services.metalv1.models.facility_input import FacilityInput +from equinix.services.metalv1.models.facility_input_facility import FacilityInputFacility +from equinix.services.metalv1.models.facility_list import FacilityList +from equinix.services.metalv1.models.filesystem import Filesystem +from equinix.services.metalv1.models.find_ip_address_by_id200_response import FindIPAddressById200Response +from equinix.services.metalv1.models.find_metal_gateway_by_id200_response import FindMetalGatewayById200Response +from equinix.services.metalv1.models.find_traffic_timeframe_parameter import FindTrafficTimeframeParameter +from equinix.services.metalv1.models.firmware_set import FirmwareSet +from equinix.services.metalv1.models.firmware_set_list_response import FirmwareSetListResponse +from equinix.services.metalv1.models.firmware_set_response import FirmwareSetResponse +from equinix.services.metalv1.models.global_bgp_range import GlobalBgpRange +from equinix.services.metalv1.models.global_bgp_range_list import GlobalBgpRangeList +from equinix.services.metalv1.models.hardware_reservation import HardwareReservation +from equinix.services.metalv1.models.hardware_reservation_list import HardwareReservationList +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.ip_address import IPAddress +from equinix.services.metalv1.models.ip_assignment import IPAssignment +from equinix.services.metalv1.models.ip_assignment_input import IPAssignmentInput +from equinix.services.metalv1.models.ip_assignment_list import IPAssignmentList +from equinix.services.metalv1.models.ip_assignment_metro import IPAssignmentMetro +from equinix.services.metalv1.models.ip_assignment_update_input import IPAssignmentUpdateInput +from equinix.services.metalv1.models.ip_availabilities_list import IPAvailabilitiesList +from equinix.services.metalv1.models.ip_reservation import IPReservation +from equinix.services.metalv1.models.ip_reservation_facility import IPReservationFacility +from equinix.services.metalv1.models.ip_reservation_list import IPReservationList +from equinix.services.metalv1.models.ip_reservation_list_ip_addresses_inner import IPReservationListIpAddressesInner +from equinix.services.metalv1.models.ip_reservation_metro import IPReservationMetro +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.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_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_providers_inner import InterconnectionMetroListMetrosInnerAllOfProvidersInner +from equinix.services.metalv1.models.interconnection_port import InterconnectionPort +from equinix.services.metalv1.models.interconnection_port_list import InterconnectionPortList +from equinix.services.metalv1.models.interconnection_pricing_list import InterconnectionPricingList +from equinix.services.metalv1.models.interconnection_pricing_list_provider_pricing_inner import InterconnectionPricingListProviderPricingInner +from equinix.services.metalv1.models.interconnection_pricing_list_provider_pricing_inner_tiers_inner import InterconnectionPricingListProviderPricingInnerTiersInner +from equinix.services.metalv1.models.interconnection_update_input import InterconnectionUpdateInput +from equinix.services.metalv1.models.invitation import Invitation +from equinix.services.metalv1.models.invitation_input import InvitationInput +from equinix.services.metalv1.models.invitation_list import InvitationList +from equinix.services.metalv1.models.invoice import Invoice +from equinix.services.metalv1.models.invoice_list import InvoiceList +from equinix.services.metalv1.models.license import License +from equinix.services.metalv1.models.license_create_input import LicenseCreateInput +from equinix.services.metalv1.models.license_list import LicenseList +from equinix.services.metalv1.models.license_update_input import LicenseUpdateInput +from equinix.services.metalv1.models.line_item import LineItem +from equinix.services.metalv1.models.line_item_adjustment import LineItemAdjustment +from equinix.services.metalv1.models.membership import Membership +from equinix.services.metalv1.models.membership_input import MembershipInput +from equinix.services.metalv1.models.membership_list import MembershipList +from equinix.services.metalv1.models.meta import Meta +from equinix.services.metalv1.models.metadata import Metadata +from equinix.services.metalv1.models.metadata_network import MetadataNetwork +from equinix.services.metalv1.models.metadata_network_network import MetadataNetworkNetwork +from equinix.services.metalv1.models.metadata_network_network_bonding import MetadataNetworkNetworkBonding +from equinix.services.metalv1.models.metal_gateway import MetalGateway +from equinix.services.metalv1.models.metal_gateway_create_input import MetalGatewayCreateInput +from equinix.services.metalv1.models.metal_gateway_elastic_ip_create_input import MetalGatewayElasticIpCreateInput +from equinix.services.metalv1.models.metal_gateway_list import MetalGatewayList +from equinix.services.metalv1.models.metal_gateway_list_metal_gateways_inner import MetalGatewayListMetalGatewaysInner +from equinix.services.metalv1.models.metal_gateway_lite import MetalGatewayLite +from equinix.services.metalv1.models.metro import Metro +from equinix.services.metalv1.models.metro_input import MetroInput +from equinix.services.metalv1.models.metro_list import MetroList +from equinix.services.metalv1.models.mount import Mount +from equinix.services.metalv1.models.move_hardware_reservation_request import MoveHardwareReservationRequest +from equinix.services.metalv1.models.new_password import NewPassword +from equinix.services.metalv1.models.operating_system import OperatingSystem +from equinix.services.metalv1.models.operating_system_list import OperatingSystemList +from equinix.services.metalv1.models.organization import Organization +from equinix.services.metalv1.models.organization_input import OrganizationInput +from equinix.services.metalv1.models.organization_list import OrganizationList +from equinix.services.metalv1.models.parent_block import ParentBlock +from equinix.services.metalv1.models.partition import Partition +from equinix.services.metalv1.models.payment_method import PaymentMethod +from equinix.services.metalv1.models.payment_method_billing_address import PaymentMethodBillingAddress +from equinix.services.metalv1.models.payment_method_create_input import PaymentMethodCreateInput +from equinix.services.metalv1.models.payment_method_list import PaymentMethodList +from equinix.services.metalv1.models.payment_method_update_input import PaymentMethodUpdateInput +from equinix.services.metalv1.models.plan import Plan +from equinix.services.metalv1.models.plan_available_in_inner import PlanAvailableInInner +from equinix.services.metalv1.models.plan_available_in_inner_price import PlanAvailableInInnerPrice +from equinix.services.metalv1.models.plan_available_in_metros_inner import PlanAvailableInMetrosInner +from equinix.services.metalv1.models.plan_id_name import PlanIdName +from equinix.services.metalv1.models.plan_list import PlanList +from equinix.services.metalv1.models.plan_specs import PlanSpecs +from equinix.services.metalv1.models.plan_specs_cpus_inner import PlanSpecsCpusInner +from equinix.services.metalv1.models.plan_specs_drives_inner import PlanSpecsDrivesInner +from equinix.services.metalv1.models.plan_specs_features import PlanSpecsFeatures +from equinix.services.metalv1.models.plan_specs_memory import PlanSpecsMemory +from equinix.services.metalv1.models.plan_specs_nics_inner import PlanSpecsNicsInner +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.models.port_assign_input import PortAssignInput +from equinix.services.metalv1.models.port_convert_layer3_input import PortConvertLayer3Input +from equinix.services.metalv1.models.port_convert_layer3_input_request_ips_inner import PortConvertLayer3InputRequestIpsInner +from equinix.services.metalv1.models.port_data import PortData +from equinix.services.metalv1.models.port_vlan_assignment import PortVlanAssignment +from equinix.services.metalv1.models.port_vlan_assignment_batch import PortVlanAssignmentBatch +from equinix.services.metalv1.models.port_vlan_assignment_batch_create_input import PortVlanAssignmentBatchCreateInput +from equinix.services.metalv1.models.port_vlan_assignment_batch_create_input_vlan_assignments_inner import PortVlanAssignmentBatchCreateInputVlanAssignmentsInner +from equinix.services.metalv1.models.port_vlan_assignment_batch_list import PortVlanAssignmentBatchList +from equinix.services.metalv1.models.port_vlan_assignment_batch_vlan_assignments_inner import PortVlanAssignmentBatchVlanAssignmentsInner +from equinix.services.metalv1.models.port_vlan_assignment_list import PortVlanAssignmentList +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.project_create_from_root_input import ProjectCreateFromRootInput +from equinix.services.metalv1.models.project_create_input import ProjectCreateInput +from equinix.services.metalv1.models.project_id_name import ProjectIdName +from equinix.services.metalv1.models.project_list import ProjectList +from equinix.services.metalv1.models.project_update_input import ProjectUpdateInput +from equinix.services.metalv1.models.project_usage import ProjectUsage +from equinix.services.metalv1.models.project_usage_list import ProjectUsageList +from equinix.services.metalv1.models.raid import Raid +from equinix.services.metalv1.models.recovery_code_list import RecoveryCodeList +from equinix.services.metalv1.models.request_ip_reservation201_response import RequestIPReservation201Response +from equinix.services.metalv1.models.request_ip_reservation_request import RequestIPReservationRequest +from equinix.services.metalv1.models.ssh_key import SSHKey +from equinix.services.metalv1.models.ssh_key_create_input import SSHKeyCreateInput +from equinix.services.metalv1.models.ssh_key_input import SSHKeyInput +from equinix.services.metalv1.models.ssh_key_list import SSHKeyList +from equinix.services.metalv1.models.self_service_reservation_item_request import SelfServiceReservationItemRequest +from equinix.services.metalv1.models.self_service_reservation_item_response import SelfServiceReservationItemResponse +from equinix.services.metalv1.models.self_service_reservation_list import SelfServiceReservationList +from equinix.services.metalv1.models.self_service_reservation_response import SelfServiceReservationResponse +from equinix.services.metalv1.models.server_info import ServerInfo +from equinix.services.metalv1.models.shared_port_vc_vlan_create_input import SharedPortVCVlanCreateInput +from equinix.services.metalv1.models.spot_market_prices_list import SpotMarketPricesList +from equinix.services.metalv1.models.spot_market_prices_per_metro_list import SpotMarketPricesPerMetroList +from equinix.services.metalv1.models.spot_market_prices_per_metro_report import SpotMarketPricesPerMetroReport +from equinix.services.metalv1.models.spot_market_request import SpotMarketRequest +from equinix.services.metalv1.models.spot_market_request_create_input import SpotMarketRequestCreateInput +from equinix.services.metalv1.models.spot_market_request_create_input_instance_parameters import SpotMarketRequestCreateInputInstanceParameters +from equinix.services.metalv1.models.spot_market_request_list import SpotMarketRequestList +from equinix.services.metalv1.models.spot_market_request_metro import SpotMarketRequestMetro +from equinix.services.metalv1.models.spot_prices_datapoints import SpotPricesDatapoints +from equinix.services.metalv1.models.spot_prices_history_report import SpotPricesHistoryReport +from equinix.services.metalv1.models.spot_prices_per_baremetal import SpotPricesPerBaremetal +from equinix.services.metalv1.models.spot_prices_per_facility import SpotPricesPerFacility +from equinix.services.metalv1.models.spot_prices_per_new_facility import SpotPricesPerNewFacility +from equinix.services.metalv1.models.spot_prices_report import SpotPricesReport +from equinix.services.metalv1.models.storage import Storage +from equinix.services.metalv1.models.support_request_input import SupportRequestInput +from equinix.services.metalv1.models.transfer_request import TransferRequest +from equinix.services.metalv1.models.transfer_request_input import TransferRequestInput +from equinix.services.metalv1.models.transfer_request_list import TransferRequestList +from equinix.services.metalv1.models.update_email_input import UpdateEmailInput +from equinix.services.metalv1.models.user import User +from equinix.services.metalv1.models.user_create_input import UserCreateInput +from equinix.services.metalv1.models.user_limited import UserLimited +from equinix.services.metalv1.models.user_list import UserList +from equinix.services.metalv1.models.user_lite import UserLite +from equinix.services.metalv1.models.user_update_input import UserUpdateInput +from equinix.services.metalv1.models.userdata import Userdata +from equinix.services.metalv1.models.verify_email import VerifyEmail +from equinix.services.metalv1.models.virtual_circuit import VirtualCircuit +from equinix.services.metalv1.models.virtual_circuit_create_input import VirtualCircuitCreateInput +from equinix.services.metalv1.models.virtual_circuit_list import VirtualCircuitList +from equinix.services.metalv1.models.virtual_circuit_update_input import VirtualCircuitUpdateInput +from equinix.services.metalv1.models.virtual_network import VirtualNetwork +from equinix.services.metalv1.models.virtual_network_create_input import VirtualNetworkCreateInput +from equinix.services.metalv1.models.virtual_network_list import VirtualNetworkList +from equinix.services.metalv1.models.virtual_network_update_input import VirtualNetworkUpdateInput +from equinix.services.metalv1.models.vlan_csp_connection_create_input import VlanCSPConnectionCreateInput +from equinix.services.metalv1.models.vlan_csp_connection_create_input_fabric_provider import VlanCSPConnectionCreateInputFabricProvider +from equinix.services.metalv1.models.vlan_fabric_vc_create_input import VlanFabricVcCreateInput +from equinix.services.metalv1.models.vlan_virtual_circuit import VlanVirtualCircuit +from equinix.services.metalv1.models.vlan_virtual_circuit_create_input import VlanVirtualCircuitCreateInput +from equinix.services.metalv1.models.vlan_virtual_circuit_update_input import VlanVirtualCircuitUpdateInput +from equinix.services.metalv1.models.vrf import Vrf +from equinix.services.metalv1.models.vrf_bgp_neighbors import VrfBGPNeighbors +from equinix.services.metalv1.models.vrf_bgp_neighbors_list import VrfBGPNeighborsList +from equinix.services.metalv1.models.vrf_create_input import VrfCreateInput +from equinix.services.metalv1.models.vrf_fabric_vc_create_input import VrfFabricVcCreateInput +from equinix.services.metalv1.models.vrf_ip_reservation import VrfIpReservation +from equinix.services.metalv1.models.vrf_ip_reservation_create_input import VrfIpReservationCreateInput +from equinix.services.metalv1.models.vrf_ip_reservation_list import VrfIpReservationList +from equinix.services.metalv1.models.vrf_learned_routes import VrfLearnedRoutes +from equinix.services.metalv1.models.vrf_learned_routes_list import VrfLearnedRoutesList +from equinix.services.metalv1.models.vrf_list import VrfList +from equinix.services.metalv1.models.vrf_metal_gateway import VrfMetalGateway +from equinix.services.metalv1.models.vrf_metal_gateway_create_input import VrfMetalGatewayCreateInput +from equinix.services.metalv1.models.vrf_route import VrfRoute +from equinix.services.metalv1.models.vrf_route_create_input import VrfRouteCreateInput +from equinix.services.metalv1.models.vrf_route_list import VrfRouteList +from equinix.services.metalv1.models.vrf_route_update_input import VrfRouteUpdateInput +from equinix.services.metalv1.models.vrf_update_input import VrfUpdateInput +from equinix.services.metalv1.models.vrf_virtual_circuit import VrfVirtualCircuit +from equinix.services.metalv1.models.vrf_virtual_circuit_create_input import VrfVirtualCircuitCreateInput +from equinix.services.metalv1.models.vrf_virtual_circuit_update_input import VrfVirtualCircuitUpdateInput diff --git a/equinix/services/metalv1/models/activate_hardware_reservation_request.py b/equinix/services/metalv1/models/activate_hardware_reservation_request.py new file mode 100644 index 00000000..19b10782 --- /dev/null +++ b/equinix/services/metalv1/models/activate_hardware_reservation_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 ActivateHardwareReservationRequest(BaseModel): + """ + ActivateHardwareReservationRequest + """ # noqa: E501 + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["description", "href"] + + 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 ActivateHardwareReservationRequest 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ActivateHardwareReservationRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/address.py b/equinix/services/metalv1/models/address.py new file mode 100644 index 00000000..4c3de0a1 --- /dev/null +++ b/equinix/services/metalv1/models/address.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.coordinates import Coordinates +from typing import Optional, Set +from typing_extensions import Self + +class Address(BaseModel): + """ + Address + """ # noqa: E501 + address: Optional[StrictStr] = None + address2: Optional[StrictStr] = None + city: Optional[StrictStr] = None + coordinates: Optional[Coordinates] = None + country: Optional[StrictStr] = None + href: Optional[StrictStr] = None + state: Optional[StrictStr] = None + zip_code: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "address2", "city", "coordinates", "country", "href", "state", "zip_code"] + + 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 Address 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of coordinates + if self.coordinates: + _dict['coordinates'] = self.coordinates.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Address from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "address2": obj.get("address2"), + "city": obj.get("city"), + "coordinates": Coordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, + "country": obj.get("country"), + "href": obj.get("href"), + "state": obj.get("state"), + "zip_code": obj.get("zip_code") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/attribute.py b/equinix/services/metalv1/models/attribute.py new file mode 100644 index 00000000..a8cdbf8b --- /dev/null +++ b/equinix/services/metalv1/models/attribute.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.attribute_data import AttributeData +from typing import Optional, Set +from typing_extensions import Self + +class Attribute(BaseModel): + """ + Attribute + """ # noqa: E501 + created_at: Optional[datetime] = Field(default=None, description="Datetime when the block was created.") + data: Optional[AttributeData] = None + href: Optional[StrictStr] = None + namespace: Optional[StrictStr] = Field(default=None, description="Attribute namespace") + updated_at: Optional[datetime] = Field(default=None, description="Datetime when the block was updated.") + __properties: ClassVar[List[str]] = ["created_at", "data", "href", "namespace", "updated_at"] + + 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 Attribute 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "namespace", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Attribute from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "data": AttributeData.from_dict(obj["data"]) if obj.get("data") is not None else None, + "href": obj.get("href"), + "namespace": obj.get("namespace"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/attribute_data.py b/equinix/services/metalv1/models/attribute_data.py new file mode 100644 index 00000000..6cebcc05 --- /dev/null +++ b/equinix/services/metalv1/models/attribute_data.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AttributeData(BaseModel): + """ + AttributeData + """ # noqa: E501 + href: Optional[StrictStr] = None + latest: Optional[StrictBool] = Field(default=None, description="Boolean flag to know if the firmware set is the latest for the model and vendor") + model: Optional[StrictStr] = Field(default=None, description="Model on which this firmware set can be applied") + plan: Optional[StrictStr] = Field(default=None, description="Plan where the firmware set can be applied") + vendor: Optional[StrictStr] = Field(default=None, description="Vendor on which this firmware set can be applied") + __properties: ClassVar[List[str]] = ["href", "latest", "model", "plan", "vendor"] + + 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 AttributeData 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "latest", + "model", + "plan", + "vendor", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AttributeData 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"), + "latest": obj.get("latest"), + "model": obj.get("model"), + "plan": obj.get("plan"), + "vendor": obj.get("vendor") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/auth_token.py b/equinix/services/metalv1/models/auth_token.py new file mode 100644 index 00000000..eb692c07 --- /dev/null +++ b/equinix/services/metalv1/models/auth_token.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.auth_token_project import AuthTokenProject +from equinix.services.metalv1.models.auth_token_user import AuthTokenUser +from typing import Optional, Set +from typing_extensions import Self + +class AuthToken(BaseModel): + """ + AuthToken + """ # noqa: E501 + created_at: Optional[datetime] = None + description: Optional[StrictStr] = Field(default=None, description="Available only for API keys") + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + project: Optional[AuthTokenProject] = None + read_only: Optional[StrictBool] = None + token: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + user: Optional[AuthTokenUser] = None + __properties: ClassVar[List[str]] = ["created_at", "description", "href", "id", "project", "read_only", "token", "updated_at", "user"] + + 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 AuthToken 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of user + if self.user: + _dict['user'] = self.user.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AuthToken from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "href": obj.get("href"), + "id": obj.get("id"), + "project": AuthTokenProject.from_dict(obj["project"]) if obj.get("project") is not None else None, + "read_only": obj.get("read_only"), + "token": obj.get("token"), + "updated_at": obj.get("updated_at"), + "user": AuthTokenUser.from_dict(obj["user"]) if obj.get("user") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/auth_token_input.py b/equinix/services/metalv1/models/auth_token_input.py new file mode 100644 index 00000000..dabdf079 --- /dev/null +++ b/equinix/services/metalv1/models/auth_token_input.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AuthTokenInput(BaseModel): + """ + AuthTokenInput + """ # noqa: E501 + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + read_only: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["description", "href", "read_only"] + + 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 AuthTokenInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AuthTokenInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "href": obj.get("href"), + "read_only": obj.get("read_only") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/auth_token_list.py b/equinix/services/metalv1/models/auth_token_list.py new file mode 100644 index 00000000..42d1863f --- /dev/null +++ b/equinix/services/metalv1/models/auth_token_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.auth_token import AuthToken +from typing import Optional, Set +from typing_extensions import Self + +class AuthTokenList(BaseModel): + """ + AuthTokenList + """ # noqa: E501 + api_keys: Optional[List[AuthToken]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["api_keys", "href"] + + 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 AuthTokenList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 api_keys (list) + _items = [] + if self.api_keys: + for _item in self.api_keys: + if _item: + _items.append(_item.to_dict()) + _dict['api_keys'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AuthTokenList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "api_keys": [AuthToken.from_dict(_item) for _item in obj["api_keys"]] if obj.get("api_keys") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/auth_token_project.py b/equinix/services/metalv1/models/auth_token_project.py new file mode 100644 index 00000000..712ba414 --- /dev/null +++ b/equinix/services/metalv1/models/auth_token_project.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class AuthTokenProject(BaseModel): + """ + AuthTokenProject + """ # noqa: E501 + backend_transfer_enabled: Optional[StrictBool] = None + bgp_config: Optional[Href] = None + created_at: Optional[datetime] = None + customdata: Optional[Dict[str, Any]] = None + devices: Optional[List[Href]] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + invitations: Optional[List[Href]] = None + max_devices: Optional[Dict[str, Any]] = None + members: Optional[List[Href]] = None + memberships: Optional[List[Href]] = None + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=80)]] = Field(default=None, description="The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis.") + network_status: Optional[Dict[str, Any]] = None + organization: Optional[Href] = None + payment_method: Optional[Href] = None + ssh_keys: Optional[List[Href]] = None + tags: Optional[List[StrictStr]] = None + type: Optional[StrictStr] = Field(default=None, description="The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers.") + updated_at: Optional[datetime] = None + url: Optional[StrictStr] = None + volumes: Optional[List[Href]] = None + __properties: ClassVar[List[str]] = ["backend_transfer_enabled", "bgp_config", "created_at", "customdata", "devices", "href", "id", "invitations", "max_devices", "members", "memberships", "name", "network_status", "organization", "payment_method", "ssh_keys", "tags", "type", "updated_at", "url", "volumes"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'vmce']): + raise ValueError("must be one of enum values ('default', 'vmce')") + return value + + 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 AuthTokenProject 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of bgp_config + if self.bgp_config: + _dict['bgp_config'] = self.bgp_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in devices (list) + _items = [] + if self.devices: + for _item in self.devices: + if _item: + _items.append(_item.to_dict()) + _dict['devices'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in invitations (list) + _items = [] + if self.invitations: + for _item in self.invitations: + if _item: + _items.append(_item.to_dict()) + _dict['invitations'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in members (list) + _items = [] + if self.members: + for _item in self.members: + if _item: + _items.append(_item.to_dict()) + _dict['members'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in memberships (list) + _items = [] + if self.memberships: + for _item in self.memberships: + if _item: + _items.append(_item.to_dict()) + _dict['memberships'] = _items + # override the default output from pydantic by calling `to_dict()` of organization + if self.organization: + _dict['organization'] = self.organization.to_dict() + # override the default output from pydantic by calling `to_dict()` of payment_method + if self.payment_method: + _dict['payment_method'] = self.payment_method.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in ssh_keys (list) + _items = [] + if self.ssh_keys: + for _item in self.ssh_keys: + if _item: + _items.append(_item.to_dict()) + _dict['ssh_keys'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in volumes (list) + _items = [] + if self.volumes: + for _item in self.volumes: + if _item: + _items.append(_item.to_dict()) + _dict['volumes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AuthTokenProject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "backend_transfer_enabled": obj.get("backend_transfer_enabled"), + "bgp_config": Href.from_dict(obj["bgp_config"]) if obj.get("bgp_config") is not None else None, + "created_at": obj.get("created_at"), + "customdata": obj.get("customdata"), + "devices": [Href.from_dict(_item) for _item in obj["devices"]] if obj.get("devices") is not None else None, + "href": obj.get("href"), + "id": obj.get("id"), + "invitations": [Href.from_dict(_item) for _item in obj["invitations"]] if obj.get("invitations") is not None else None, + "max_devices": obj.get("max_devices"), + "members": [Href.from_dict(_item) for _item in obj["members"]] if obj.get("members") is not None else None, + "memberships": [Href.from_dict(_item) for _item in obj["memberships"]] if obj.get("memberships") is not None else None, + "name": obj.get("name"), + "network_status": obj.get("network_status"), + "organization": Href.from_dict(obj["organization"]) if obj.get("organization") is not None else None, + "payment_method": Href.from_dict(obj["payment_method"]) if obj.get("payment_method") is not None else None, + "ssh_keys": [Href.from_dict(_item) for _item in obj["ssh_keys"]] if obj.get("ssh_keys") is not None else None, + "tags": obj.get("tags"), + "type": obj.get("type"), + "updated_at": obj.get("updated_at"), + "url": obj.get("url"), + "volumes": [Href.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/auth_token_user.py b/equinix/services/metalv1/models/auth_token_user.py new file mode 100644 index 00000000..d4c51fd4 --- /dev/null +++ b/equinix/services/metalv1/models/auth_token_user.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class AuthTokenUser(BaseModel): + """ + AuthTokenUser + """ # noqa: E501 + avatar_thumb_url: Optional[StrictStr] = None + avatar_url: Optional[StrictStr] = None + created_at: Optional[datetime] = None + customdata: Optional[Dict[str, Any]] = None + default_organization_id: Optional[StrictStr] = None + default_project_id: Optional[StrictStr] = None + email: Optional[StrictStr] = None + emails: Optional[List[Href]] = None + first_name: Optional[StrictStr] = None + fraud_score: Optional[StrictStr] = None + full_name: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + last_login_at: Optional[datetime] = None + last_name: Optional[StrictStr] = None + max_organizations: Optional[StrictInt] = None + max_projects: Optional[StrictInt] = None + phone_number: Optional[StrictStr] = None + short_id: Optional[StrictStr] = None + timezone: Optional[StrictStr] = None + two_factor_auth: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["avatar_thumb_url", "avatar_url", "created_at", "customdata", "default_organization_id", "default_project_id", "email", "emails", "first_name", "fraud_score", "full_name", "href", "id", "last_login_at", "last_name", "max_organizations", "max_projects", "phone_number", "short_id", "timezone", "two_factor_auth", "updated_at"] + + 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 AuthTokenUser 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 emails (list) + _items = [] + if self.emails: + for _item in self.emails: + if _item: + _items.append(_item.to_dict()) + _dict['emails'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AuthTokenUser from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "avatar_thumb_url": obj.get("avatar_thumb_url"), + "avatar_url": obj.get("avatar_url"), + "created_at": obj.get("created_at"), + "customdata": obj.get("customdata"), + "default_organization_id": obj.get("default_organization_id"), + "default_project_id": obj.get("default_project_id"), + "email": obj.get("email"), + "emails": [Href.from_dict(_item) for _item in obj["emails"]] if obj.get("emails") is not None else None, + "first_name": obj.get("first_name"), + "fraud_score": obj.get("fraud_score"), + "full_name": obj.get("full_name"), + "href": obj.get("href"), + "id": obj.get("id"), + "last_login_at": obj.get("last_login_at"), + "last_name": obj.get("last_name"), + "max_organizations": obj.get("max_organizations"), + "max_projects": obj.get("max_projects"), + "phone_number": obj.get("phone_number"), + "short_id": obj.get("short_id"), + "timezone": obj.get("timezone"), + "two_factor_auth": obj.get("two_factor_auth"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/aws_fabric_provider.py b/equinix/services/metalv1/models/aws_fabric_provider.py new file mode 100644 index 00000000..2ce3125a --- /dev/null +++ b/equinix/services/metalv1/models/aws_fabric_provider.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class AWSFabricProvider(BaseModel): + """ + AWSFabricProvider + """ # noqa: E501 + account_id: Annotated[str, Field(strict=True)] = Field(description="AWS Account ID") + href: Optional[StrictStr] = None + location: Optional[StrictStr] = None + type: StrictStr + __properties: ClassVar[List[str]] = ["account_id", "href", "location", "type"] + + @field_validator('account_id') + def account_id_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^\d{12}$", value): + raise ValueError(r"must validate the regular expression /^\d{12}$/") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CSP_AWS']): + raise ValueError("must be one of enum values ('CSP_AWS')") + return value + + 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 AWSFabricProvider 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AWSFabricProvider from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "account_id": obj.get("account_id"), + "href": obj.get("href"), + "location": obj.get("location"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/batch.py b/equinix/services/metalv1/models/batch.py new file mode 100644 index 00000000..10ffaacd --- /dev/null +++ b/equinix/services/metalv1/models/batch.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class Batch(BaseModel): + """ + Batch + """ # noqa: E501 + created_at: Optional[datetime] = None + devices: Optional[List[Href]] = None + error_messages: Optional[List[StrictStr]] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + project: Optional[Href] = None + quantity: Optional[StrictInt] = None + state: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["created_at", "devices", "error_messages", "href", "id", "project", "quantity", "state", "updated_at"] + + 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 Batch 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 devices (list) + _items = [] + if self.devices: + for _item in self.devices: + if _item: + _items.append(_item.to_dict()) + _dict['devices'] = _items + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Batch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "devices": [Href.from_dict(_item) for _item in obj["devices"]] if obj.get("devices") is not None else None, + "error_messages": obj.get("error_messages"), + "href": obj.get("href"), + "id": obj.get("id"), + "project": Href.from_dict(obj["project"]) if obj.get("project") is not None else None, + "quantity": obj.get("quantity"), + "state": obj.get("state"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/batches_list.py b/equinix/services/metalv1/models/batches_list.py new file mode 100644 index 00000000..f66bd336 --- /dev/null +++ b/equinix/services/metalv1/models/batches_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.batch import Batch +from typing import Optional, Set +from typing_extensions import Self + +class BatchesList(BaseModel): + """ + BatchesList + """ # noqa: E501 + batches: Optional[List[Batch]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["batches", "href"] + + 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 BatchesList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 batches (list) + _items = [] + if self.batches: + for _item in self.batches: + if _item: + _items.append(_item.to_dict()) + _dict['batches'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchesList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "batches": [Batch.from_dict(_item) for _item in obj["batches"]] if obj.get("batches") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_config.py b/equinix/services/metalv1/models/bgp_config.py new file mode 100644 index 00000000..d3c6f926 --- /dev/null +++ b/equinix/services/metalv1/models/bgp_config.py @@ -0,0 +1,157 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.bgp_session import BgpSession +from equinix.services.metalv1.models.global_bgp_range import GlobalBgpRange +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class BgpConfig(BaseModel): + """ + BgpConfig + """ # noqa: E501 + asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="Autonomous System Number. ASN is required with Global BGP. With Local BGP the private ASN, 65000, is assigned.") + created_at: Optional[datetime] = None + deployment_type: Optional[StrictStr] = Field(default=None, description="In a Local BGP deployment, a customer uses an internal ASN to control routes within a single Equinix Metal datacenter. This means that the routes are never advertised to the global Internet. Global BGP, on the other hand, requires a customer to have a registered ASN and IP space. ") + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + max_prefix: Optional[StrictInt] = Field(default=10, description="The maximum number of route filters allowed per server") + md5: Optional[StrictStr] = Field(default=None, description="(Optional) Password for BGP session in plaintext (not a checksum)") + project: Optional[Href] = None + ranges: Optional[List[GlobalBgpRange]] = Field(default=None, description="The IP block ranges associated to the ASN (Populated in Global BGP only)") + requested_at: Optional[datetime] = None + route_object: Optional[StrictStr] = Field(default=None, description="Specifies AS-MACRO (aka AS-SET) to use when building client route filters") + sessions: Optional[List[BgpSession]] = Field(default=None, description="The direct connections between neighboring routers that want to exchange routing information.") + status: Optional[StrictStr] = Field(default=None, description="Status of the BGP Config. Status \"requested\" is valid only with the \"global\" deployment_type.") + __properties: ClassVar[List[str]] = ["asn", "created_at", "deployment_type", "href", "id", "max_prefix", "md5", "project", "ranges", "requested_at", "route_object", "sessions", "status"] + + @field_validator('deployment_type') + def deployment_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['global', 'local']): + raise ValueError("must be one of enum values ('global', 'local')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['requested', 'enabled', 'disabled']): + raise ValueError("must be one of enum values ('requested', 'enabled', 'disabled')") + return value + + 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 BgpConfig 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in ranges (list) + _items = [] + if self.ranges: + for _item in self.ranges: + if _item: + _items.append(_item.to_dict()) + _dict['ranges'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sessions (list) + _items = [] + if self.sessions: + for _item in self.sessions: + if _item: + _items.append(_item.to_dict()) + _dict['sessions'] = _items + # set to None if md5 (nullable) is None + # and model_fields_set contains the field + if self.md5 is None and "md5" in self.model_fields_set: + _dict['md5'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "asn": obj.get("asn"), + "created_at": obj.get("created_at"), + "deployment_type": obj.get("deployment_type"), + "href": obj.get("href"), + "id": obj.get("id"), + "max_prefix": obj.get("max_prefix") if obj.get("max_prefix") is not None else 10, + "md5": obj.get("md5"), + "project": Href.from_dict(obj["project"]) if obj.get("project") is not None else None, + "ranges": [GlobalBgpRange.from_dict(_item) for _item in obj["ranges"]] if obj.get("ranges") is not None else None, + "requested_at": obj.get("requested_at"), + "route_object": obj.get("route_object"), + "sessions": [BgpSession.from_dict(_item) for _item in obj["sessions"]] if obj.get("sessions") is not None else None, + "status": obj.get("status") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_config_request_input.py b/equinix/services/metalv1/models/bgp_config_request_input.py new file mode 100644 index 00000000..07cdda24 --- /dev/null +++ b/equinix/services/metalv1/models/bgp_config_request_input.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class BgpConfigRequestInput(BaseModel): + """ + BgpConfigRequestInput + """ # noqa: E501 + asn: Annotated[int, Field(le=4294967295, strict=True, ge=0)] = Field(description="Autonomous System Number for local BGP deployment.") + deployment_type: StrictStr = Field(description="Wether the BGP deployment is local or global. Local deployments are configured immediately. Global deployments will need to be reviewed by Equinix Metal engineers.") + href: Optional[StrictStr] = None + md5: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The plaintext password to share between BGP neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character ") + use_case: Optional[StrictStr] = Field(default=None, description="A use case explanation (necessary for global BGP request review).") + __properties: ClassVar[List[str]] = ["asn", "deployment_type", "href", "md5", "use_case"] + + @field_validator('deployment_type') + def deployment_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['local', 'global']): + raise ValueError("must be one of enum values ('local', 'global')") + return value + + @field_validator('md5') + def md5_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$", value): + raise ValueError(r"must validate the regular expression /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$/") + return value + + 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 BgpConfigRequestInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpConfigRequestInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "asn": obj.get("asn"), + "deployment_type": obj.get("deployment_type"), + "href": obj.get("href"), + "md5": obj.get("md5"), + "use_case": obj.get("use_case") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_dynamic_neighbor.py b/equinix/services/metalv1/models/bgp_dynamic_neighbor.py new file mode 100644 index 00000000..e536a89a --- /dev/null +++ b/equinix/services/metalv1/models/bgp_dynamic_neighbor.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.user_limited import UserLimited +from equinix.services.metalv1.models.vrf_metal_gateway import VrfMetalGateway +from typing import Optional, Set +from typing_extensions import Self + +class BgpDynamicNeighbor(BaseModel): + """ + BgpDynamicNeighbor + """ # noqa: E501 + bgp_neighbor_asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="The ASN of the dynamic BGP neighbor") + bgp_neighbor_range: Optional[StrictStr] = Field(default=None, description="Network range of the dynamic BGP neighbor in CIDR format") + created_at: Optional[datetime] = None + created_by: Optional[UserLimited] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = Field(default=None, description="The unique identifier for the resource") + metal_gateway: Optional[VrfMetalGateway] = None + state: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["bgp_neighbor_asn", "bgp_neighbor_range", "created_at", "created_by", "href", "id", "metal_gateway", "state", "tags", "updated_at"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['active', 'deleting', 'pending', 'ready']): + raise ValueError("must be one of enum values ('active', 'deleting', 'pending', 'ready')") + return value + + 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 BgpDynamicNeighbor 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "href", + "id", + "state", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of created_by + if self.created_by: + _dict['created_by'] = self.created_by.to_dict() + # override the default output from pydantic by calling `to_dict()` of metal_gateway + if self.metal_gateway: + _dict['metal_gateway'] = self.metal_gateway.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpDynamicNeighbor from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bgp_neighbor_asn": obj.get("bgp_neighbor_asn"), + "bgp_neighbor_range": obj.get("bgp_neighbor_range"), + "created_at": obj.get("created_at"), + "created_by": UserLimited.from_dict(obj["created_by"]) if obj.get("created_by") is not None else None, + "href": obj.get("href"), + "id": obj.get("id"), + "metal_gateway": VrfMetalGateway.from_dict(obj["metal_gateway"]) if obj.get("metal_gateway") is not None else None, + "state": obj.get("state"), + "tags": obj.get("tags"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_dynamic_neighbor_create_input.py b/equinix/services/metalv1/models/bgp_dynamic_neighbor_create_input.py new file mode 100644 index 00000000..6be41878 --- /dev/null +++ b/equinix/services/metalv1/models/bgp_dynamic_neighbor_create_input.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class BgpDynamicNeighborCreateInput(BaseModel): + """ + BgpDynamicNeighborCreateInput + """ # noqa: E501 + bgp_neighbor_asn: Annotated[int, Field(le=4294967295, strict=True, ge=0)] = Field(description="The ASN of the dynamic BGP neighbor") + bgp_neighbor_range: StrictStr = Field(description="Network range of the dynamic BGP neighbor in CIDR format") + href: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["bgp_neighbor_asn", "bgp_neighbor_range", "href", "tags"] + + 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 BgpDynamicNeighborCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpDynamicNeighborCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bgp_neighbor_asn": obj.get("bgp_neighbor_asn"), + "bgp_neighbor_range": obj.get("bgp_neighbor_range"), + "href": obj.get("href"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_dynamic_neighbor_list.py b/equinix/services/metalv1/models/bgp_dynamic_neighbor_list.py new file mode 100644 index 00000000..5ab5744c --- /dev/null +++ b/equinix/services/metalv1/models/bgp_dynamic_neighbor_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.bgp_dynamic_neighbor import BgpDynamicNeighbor +from equinix.services.metalv1.models.meta import Meta +from typing import Optional, Set +from typing_extensions import Self + +class BgpDynamicNeighborList(BaseModel): + """ + BgpDynamicNeighborList + """ # noqa: E501 + bgp_dynamic_neighbors: Optional[List[BgpDynamicNeighbor]] = None + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + __properties: ClassVar[List[str]] = ["bgp_dynamic_neighbors", "href", "meta"] + + 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 BgpDynamicNeighborList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 bgp_dynamic_neighbors (list) + _items = [] + if self.bgp_dynamic_neighbors: + for _item in self.bgp_dynamic_neighbors: + if _item: + _items.append(_item.to_dict()) + _dict['bgp_dynamic_neighbors'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpDynamicNeighborList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bgp_dynamic_neighbors": [BgpDynamicNeighbor.from_dict(_item) for _item in obj["bgp_dynamic_neighbors"]] if obj.get("bgp_dynamic_neighbors") is not None else None, + "href": obj.get("href"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_neighbor_data.py b/equinix/services/metalv1/models/bgp_neighbor_data.py new file mode 100644 index 00000000..73f95bd9 --- /dev/null +++ b/equinix/services/metalv1/models/bgp_neighbor_data.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.bgp_route import BgpRoute +from typing import Optional, Set +from typing_extensions import Self + +class BgpNeighborData(BaseModel): + """ + BgpNeighborData + """ # noqa: E501 + address_family: Optional[StrictInt] = Field(default=None, description="Address Family for IP Address. Accepted values are 4 or 6") + customer_as: Optional[StrictInt] = Field(default=None, description="The customer's ASN. In a local BGP deployment, this will be an internal ASN used to route within the data center. For a global BGP deployment, this will be the your own ASN, configured when you set up BGP for your project.") + customer_ip: Optional[StrictStr] = Field(default=None, description="The device's IP address. For an IPv4 BGP session, this is typically the private bond0 address for the device.") + href: Optional[StrictStr] = None + md5_enabled: Optional[StrictBool] = Field(default=None, description="True if an MD5 password is configured for the project.") + md5_password: Optional[StrictStr] = Field(default=None, description="The MD5 password configured for the project, if set.") + multihop: Optional[StrictBool] = Field(default=None, description="True when the BGP session should be configured as multihop.") + peer_as: Optional[StrictInt] = Field(default=None, description="The Peer ASN to use when configuring BGP on your device.") + peer_ips: Optional[List[StrictStr]] = Field(default=None, description="A list of one or more IP addresses to use for the Peer IP section of your BGP configuration. For non-multihop sessions, this will typically be a single gateway address for the device. For multihop sessions, it will be a list of IPs.") + routes_in: Optional[List[BgpRoute]] = Field(default=None, description="A list of project subnets") + routes_out: Optional[List[BgpRoute]] = Field(default=None, description="A list of outgoing routes. Only populated if the BGP session has default route enabled.") + __properties: ClassVar[List[str]] = ["address_family", "customer_as", "customer_ip", "href", "md5_enabled", "md5_password", "multihop", "peer_as", "peer_ips", "routes_in", "routes_out"] + + 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 BgpNeighborData 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 routes_in (list) + _items = [] + if self.routes_in: + for _item in self.routes_in: + if _item: + _items.append(_item.to_dict()) + _dict['routes_in'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in routes_out (list) + _items = [] + if self.routes_out: + for _item in self.routes_out: + if _item: + _items.append(_item.to_dict()) + _dict['routes_out'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpNeighborData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address_family": obj.get("address_family"), + "customer_as": obj.get("customer_as"), + "customer_ip": obj.get("customer_ip"), + "href": obj.get("href"), + "md5_enabled": obj.get("md5_enabled"), + "md5_password": obj.get("md5_password"), + "multihop": obj.get("multihop"), + "peer_as": obj.get("peer_as"), + "peer_ips": obj.get("peer_ips"), + "routes_in": [BgpRoute.from_dict(_item) for _item in obj["routes_in"]] if obj.get("routes_in") is not None else None, + "routes_out": [BgpRoute.from_dict(_item) for _item in obj["routes_out"]] if obj.get("routes_out") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_route.py b/equinix/services/metalv1/models/bgp_route.py new file mode 100644 index 00000000..75c58e25 --- /dev/null +++ b/equinix/services/metalv1/models/bgp_route.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BgpRoute(BaseModel): + """ + BgpRoute + """ # noqa: E501 + exact: Optional[StrictBool] = None + href: Optional[StrictStr] = None + route: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["exact", "href", "route"] + + 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 BgpRoute 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpRoute from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "exact": obj.get("exact"), + "href": obj.get("href"), + "route": obj.get("route") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_session.py b/equinix/services/metalv1/models/bgp_session.py new file mode 100644 index 00000000..da83972b --- /dev/null +++ b/equinix/services/metalv1/models/bgp_session.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class BgpSession(BaseModel): + """ + BgpSession + """ # noqa: E501 + address_family: StrictStr + created_at: Optional[datetime] = None + default_route: Optional[StrictBool] = None + device: Optional[Href] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + learned_routes: Optional[List[StrictStr]] = None + status: Optional[StrictStr] = Field(default=None, description=" The status of the BGP Session. Multiple status values may be reported when the device is connected to multiple switches, one value per switch. Each status will start with \"unknown\" and progress to \"up\" or \"down\" depending on the connected device. Subsequent \"unknown\" values indicate a problem acquiring status from the switch. ") + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["address_family", "created_at", "default_route", "device", "href", "id", "learned_routes", "status", "updated_at"] + + @field_validator('address_family') + def address_family_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ipv4', 'ipv6']): + raise ValueError("must be one of enum values ('ipv4', 'ipv6')") + return value + + 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 BgpSession 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of device + if self.device: + _dict['device'] = self.device.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpSession from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address_family": obj.get("address_family"), + "created_at": obj.get("created_at"), + "default_route": obj.get("default_route"), + "device": Href.from_dict(obj["device"]) if obj.get("device") is not None else None, + "href": obj.get("href"), + "id": obj.get("id"), + "learned_routes": obj.get("learned_routes"), + "status": obj.get("status"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_session_input.py b/equinix/services/metalv1/models/bgp_session_input.py new file mode 100644 index 00000000..852bb86a --- /dev/null +++ b/equinix/services/metalv1/models/bgp_session_input.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BGPSessionInput(BaseModel): + """ + BGPSessionInput + """ # noqa: E501 + address_family: Optional[StrictStr] = Field(default=None, description="Address family for BGP session.") + default_route: Optional[StrictBool] = Field(default=False, description="Set the default route policy.") + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address_family", "default_route", "href"] + + @field_validator('address_family') + def address_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ipv4', 'ipv6']): + raise ValueError("must be one of enum values ('ipv4', 'ipv6')") + return value + + 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 BGPSessionInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BGPSessionInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address_family": obj.get("address_family"), + "default_route": obj.get("default_route") if obj.get("default_route") is not None else False, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_session_list.py b/equinix/services/metalv1/models/bgp_session_list.py new file mode 100644 index 00000000..de93566f --- /dev/null +++ b/equinix/services/metalv1/models/bgp_session_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.bgp_session import BgpSession +from typing import Optional, Set +from typing_extensions import Self + +class BgpSessionList(BaseModel): + """ + BgpSessionList + """ # noqa: E501 + bgp_sessions: Optional[List[BgpSession]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["bgp_sessions", "href"] + + 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 BgpSessionList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 bgp_sessions (list) + _items = [] + if self.bgp_sessions: + for _item in self.bgp_sessions: + if _item: + _items.append(_item.to_dict()) + _dict['bgp_sessions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpSessionList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bgp_sessions": [BgpSession.from_dict(_item) for _item in obj["bgp_sessions"]] if obj.get("bgp_sessions") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bgp_session_neighbors.py b/equinix/services/metalv1/models/bgp_session_neighbors.py new file mode 100644 index 00000000..5e455217 --- /dev/null +++ b/equinix/services/metalv1/models/bgp_session_neighbors.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_neighbor_data import BgpNeighborData +from typing import Optional, Set +from typing_extensions import Self + +class BgpSessionNeighbors(BaseModel): + """ + BgpSessionNeighbors + """ # noqa: E501 + bgp_neighbors: Optional[List[BgpNeighborData]] = Field(default=None, description="A list of BGP session neighbor data") + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["bgp_neighbors", "href"] + + 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 BgpSessionNeighbors 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 bgp_neighbors (list) + _items = [] + if self.bgp_neighbors: + for _item in self.bgp_neighbors: + if _item: + _items.append(_item.to_dict()) + _dict['bgp_neighbors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpSessionNeighbors from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bgp_neighbors": [BgpNeighborData.from_dict(_item) for _item in obj["bgp_neighbors"]] if obj.get("bgp_neighbors") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/bond_port_data.py b/equinix/services/metalv1/models/bond_port_data.py new file mode 100644 index 00000000..88b5805c --- /dev/null +++ b/equinix/services/metalv1/models/bond_port_data.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class BondPortData(BaseModel): + """ + BondPortData + """ # noqa: E501 + href: Optional[StrictStr] = None + id: Optional[StrictStr] = Field(default=None, description="ID of the bonding port") + name: Optional[StrictStr] = Field(default=None, description="Name of the port interface for the bond (\"bond0\")") + __properties: ClassVar[List[str]] = ["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 BondPortData 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BondPortData 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"), + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/capacity_check_per_facility_info.py b/equinix/services/metalv1/models/capacity_check_per_facility_info.py new file mode 100644 index 00000000..432421e9 --- /dev/null +++ b/equinix/services/metalv1/models/capacity_check_per_facility_info.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CapacityCheckPerFacilityInfo(BaseModel): + """ + CapacityCheckPerFacilityInfo + """ # noqa: E501 + available: Optional[StrictBool] = None + facility: Optional[StrictStr] = None + href: Optional[StrictStr] = None + plan: Optional[StrictStr] = None + quantity: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["available", "facility", "href", "plan", "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 CapacityCheckPerFacilityInfo 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CapacityCheckPerFacilityInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "available": obj.get("available"), + "facility": obj.get("facility"), + "href": obj.get("href"), + "plan": obj.get("plan"), + "quantity": obj.get("quantity") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/capacity_check_per_facility_list.py b/equinix/services/metalv1/models/capacity_check_per_facility_list.py new file mode 100644 index 00000000..010cf7a1 --- /dev/null +++ b/equinix/services/metalv1/models/capacity_check_per_facility_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.capacity_check_per_facility_info import CapacityCheckPerFacilityInfo +from typing import Optional, Set +from typing_extensions import Self + +class CapacityCheckPerFacilityList(BaseModel): + """ + CapacityCheckPerFacilityList + """ # noqa: E501 + href: Optional[StrictStr] = None + servers: Optional[List[CapacityCheckPerFacilityInfo]] = None + __properties: ClassVar[List[str]] = ["href", "servers"] + + 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 CapacityCheckPerFacilityList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 servers (list) + _items = [] + if self.servers: + for _item in self.servers: + if _item: + _items.append(_item.to_dict()) + _dict['servers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CapacityCheckPerFacilityList 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"), + "servers": [CapacityCheckPerFacilityInfo.from_dict(_item) for _item in obj["servers"]] if obj.get("servers") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/capacity_check_per_metro_info.py b/equinix/services/metalv1/models/capacity_check_per_metro_info.py new file mode 100644 index 00000000..9818cd1d --- /dev/null +++ b/equinix/services/metalv1/models/capacity_check_per_metro_info.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CapacityCheckPerMetroInfo(BaseModel): + """ + CapacityCheckPerMetroInfo + """ # noqa: E501 + available: Optional[StrictBool] = Field(default=None, description="Returns true if there is enough capacity in the metro to fulfill the quantity set. Returns false if there is not enough.") + href: Optional[StrictStr] = None + metro: Optional[StrictStr] = Field(default=None, description="The metro ID or code sent to check capacity.") + plan: Optional[StrictStr] = Field(default=None, description="The plan ID or slug sent to check capacity.") + quantity: Optional[StrictStr] = Field(default=None, description="The number of servers sent to check capacity.") + __properties: ClassVar[List[str]] = ["available", "href", "metro", "plan", "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 CapacityCheckPerMetroInfo 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CapacityCheckPerMetroInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "available": obj.get("available"), + "href": obj.get("href"), + "metro": obj.get("metro"), + "plan": obj.get("plan"), + "quantity": obj.get("quantity") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/capacity_check_per_metro_list.py b/equinix/services/metalv1/models/capacity_check_per_metro_list.py new file mode 100644 index 00000000..5ac2e969 --- /dev/null +++ b/equinix/services/metalv1/models/capacity_check_per_metro_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.capacity_check_per_metro_info import CapacityCheckPerMetroInfo +from typing import Optional, Set +from typing_extensions import Self + +class CapacityCheckPerMetroList(BaseModel): + """ + CapacityCheckPerMetroList + """ # noqa: E501 + href: Optional[StrictStr] = None + servers: Optional[List[CapacityCheckPerMetroInfo]] = None + __properties: ClassVar[List[str]] = ["href", "servers"] + + 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 CapacityCheckPerMetroList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 servers (list) + _items = [] + if self.servers: + for _item in self.servers: + if _item: + _items.append(_item.to_dict()) + _dict['servers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CapacityCheckPerMetroList 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"), + "servers": [CapacityCheckPerMetroInfo.from_dict(_item) for _item in obj["servers"]] if obj.get("servers") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/capacity_input.py b/equinix/services/metalv1/models/capacity_input.py new file mode 100644 index 00000000..984bc439 --- /dev/null +++ b/equinix/services/metalv1/models/capacity_input.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.server_info import ServerInfo +from typing import Optional, Set +from typing_extensions import Self + +class CapacityInput(BaseModel): + """ + CapacityInput + """ # noqa: E501 + href: Optional[StrictStr] = None + servers: Optional[List[ServerInfo]] = None + __properties: ClassVar[List[str]] = ["href", "servers"] + + 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 CapacityInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 servers (list) + _items = [] + if self.servers: + for _item in self.servers: + if _item: + _items.append(_item.to_dict()) + _dict['servers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CapacityInput 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"), + "servers": [ServerInfo.from_dict(_item) for _item in obj["servers"]] if obj.get("servers") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/capacity_level_per_baremetal.py b/equinix/services/metalv1/models/capacity_level_per_baremetal.py new file mode 100644 index 00000000..86af893c --- /dev/null +++ b/equinix/services/metalv1/models/capacity_level_per_baremetal.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 CapacityLevelPerBaremetal(BaseModel): + """ + CapacityLevelPerBaremetal + """ # noqa: E501 + href: Optional[StrictStr] = None + level: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "level"] + + 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 CapacityLevelPerBaremetal 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CapacityLevelPerBaremetal 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"), + "level": obj.get("level") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/capacity_list.py b/equinix/services/metalv1/models/capacity_list.py new file mode 100644 index 00000000..7a977091 --- /dev/null +++ b/equinix/services/metalv1/models/capacity_list.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.capacity_level_per_baremetal import CapacityLevelPerBaremetal +from typing import Optional, Set +from typing_extensions import Self + +class CapacityList(BaseModel): + """ + CapacityList + """ # noqa: E501 + capacity: Optional[Dict[str, Dict[str, CapacityLevelPerBaremetal]]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["capacity", "href"] + + 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 CapacityList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 value in capacity (dict) + _field_dict = {} + if self.capacity: + for _key in self.capacity: + if self.capacity[_key]: + _field_dict[_key] = self.capacity[_key].to_dict() + _dict['capacity'] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CapacityList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "capacity": dict( + (_k, dict( + (_ik, CapacityLevelPerBaremetal.from_dict(_iv)) + for _ik, _iv in _v.items() + ) + if _v is not None + else None + ) + for _k, _v in obj.get("capacity").items() + ) + if obj.get("capacity") is not None + else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/component.py b/equinix/services/metalv1/models/component.py new file mode 100644 index 00000000..274c7d98 --- /dev/null +++ b/equinix/services/metalv1/models/component.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Component(BaseModel): + """ + Component + """ # noqa: E501 + checksum: Optional[StrictStr] = Field(default=None, description="File checksum") + component: Optional[StrictStr] = Field(default=None, description="Component type") + created_at: Optional[datetime] = Field(default=None, description="Datetime when the block was created.") + filename: Optional[StrictStr] = Field(default=None, description="name of the file") + href: Optional[StrictStr] = None + model: Optional[List[StrictStr]] = Field(default=None, description="List of models where this component version can be applied") + repository_url: Optional[StrictStr] = Field(default=None, description="Location of the file in the repository") + updated_at: Optional[datetime] = Field(default=None, description="Datetime when the block was updated.") + upstream_url: Optional[StrictStr] = Field(default=None, description="Location of the file") + uuid: Optional[StrictStr] = Field(default=None, description="Component UUID") + vendor: Optional[StrictStr] = Field(default=None, description="Component vendor") + version: Optional[StrictStr] = Field(default=None, description="Version of the component") + __properties: ClassVar[List[str]] = ["checksum", "component", "created_at", "filename", "href", "model", "repository_url", "updated_at", "upstream_url", "uuid", "vendor", "version"] + + 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 Component 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "checksum", + "component", + "created_at", + "filename", + "model", + "repository_url", + "updated_at", + "upstream_url", + "uuid", + "vendor", + "version", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Component from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "checksum": obj.get("checksum"), + "component": obj.get("component"), + "created_at": obj.get("created_at"), + "filename": obj.get("filename"), + "href": obj.get("href"), + "model": obj.get("model"), + "repository_url": obj.get("repository_url"), + "updated_at": obj.get("updated_at"), + "upstream_url": obj.get("upstream_url"), + "uuid": obj.get("uuid"), + "vendor": obj.get("vendor"), + "version": obj.get("version") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/coordinates.py b/equinix/services/metalv1/models/coordinates.py new file mode 100644 index 00000000..cd5b0c95 --- /dev/null +++ b/equinix/services/metalv1/models/coordinates.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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 Coordinates(BaseModel): + """ + Coordinates + """ # noqa: E501 + href: Optional[StrictStr] = None + latitude: Optional[StrictStr] = None + longitude: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "latitude", "longitude"] + + 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 Coordinates 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Coordinates 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"), + "latitude": obj.get("latitude"), + "longitude": obj.get("longitude") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/create_device_request.py b/equinix/services/metalv1/models/create_device_request.py new file mode 100644 index 00000000..0cde0ea8 --- /dev/null +++ b/equinix/services/metalv1/models/create_device_request.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.device_create_in_facility_input import DeviceCreateInFacilityInput +from equinix.services.metalv1.models.device_create_in_metro_input import DeviceCreateInMetroInput +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +CREATEDEVICEREQUEST_ONE_OF_SCHEMAS = ["DeviceCreateInFacilityInput", "DeviceCreateInMetroInput"] + +class CreateDeviceRequest(BaseModel): + """ + CreateDeviceRequest + """ + # data type: DeviceCreateInMetroInput + oneof_schema_1_validator: Optional[DeviceCreateInMetroInput] = None + # data type: DeviceCreateInFacilityInput + oneof_schema_2_validator: Optional[DeviceCreateInFacilityInput] = None + actual_instance: Optional[Union[DeviceCreateInFacilityInput, DeviceCreateInMetroInput]] = None + one_of_schemas: List[str] = Field(default=Literal["DeviceCreateInFacilityInput", "DeviceCreateInMetroInput"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = CreateDeviceRequest.model_construct() + error_messages = [] + match = 0 + # validate data type: DeviceCreateInMetroInput + if not isinstance(v, DeviceCreateInMetroInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `DeviceCreateInMetroInput`") + else: + match += 1 + # validate data type: DeviceCreateInFacilityInput + if not isinstance(v, DeviceCreateInFacilityInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `DeviceCreateInFacilityInput`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in CreateDeviceRequest with oneOf schemas: DeviceCreateInFacilityInput, DeviceCreateInMetroInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in CreateDeviceRequest with oneOf schemas: DeviceCreateInFacilityInput, DeviceCreateInMetroInput. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into DeviceCreateInMetroInput + try: + instance.actual_instance = DeviceCreateInMetroInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into DeviceCreateInFacilityInput + try: + instance.actual_instance = DeviceCreateInFacilityInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into CreateDeviceRequest with oneOf schemas: DeviceCreateInFacilityInput, DeviceCreateInMetroInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into CreateDeviceRequest with oneOf schemas: DeviceCreateInFacilityInput, DeviceCreateInMetroInput. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], DeviceCreateInFacilityInput, DeviceCreateInMetroInput]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/create_email_input.py b/equinix/services/metalv1/models/create_email_input.py new file mode 100644 index 00000000..1126268e --- /dev/null +++ b/equinix/services/metalv1/models/create_email_input.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 CreateEmailInput(BaseModel): + """ + CreateEmailInput + """ # noqa: E501 + address: StrictStr + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "href"] + + 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 CreateEmailInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateEmailInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/create_metal_gateway_request.py b/equinix/services/metalv1/models/create_metal_gateway_request.py new file mode 100644 index 00000000..22c8ce78 --- /dev/null +++ b/equinix/services/metalv1/models/create_metal_gateway_request.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.metal_gateway_create_input import MetalGatewayCreateInput +from equinix.services.metalv1.models.vrf_metal_gateway_create_input import VrfMetalGatewayCreateInput +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +CREATEMETALGATEWAYREQUEST_ONE_OF_SCHEMAS = ["MetalGatewayCreateInput", "VrfMetalGatewayCreateInput"] + +class CreateMetalGatewayRequest(BaseModel): + """ + CreateMetalGatewayRequest + """ + # data type: MetalGatewayCreateInput + oneof_schema_1_validator: Optional[MetalGatewayCreateInput] = None + # data type: VrfMetalGatewayCreateInput + oneof_schema_2_validator: Optional[VrfMetalGatewayCreateInput] = None + actual_instance: Optional[Union[MetalGatewayCreateInput, VrfMetalGatewayCreateInput]] = None + one_of_schemas: List[str] = Field(default=Literal["MetalGatewayCreateInput", "VrfMetalGatewayCreateInput"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = CreateMetalGatewayRequest.model_construct() + error_messages = [] + match = 0 + # validate data type: MetalGatewayCreateInput + if not isinstance(v, MetalGatewayCreateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `MetalGatewayCreateInput`") + else: + match += 1 + # validate data type: VrfMetalGatewayCreateInput + if not isinstance(v, VrfMetalGatewayCreateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfMetalGatewayCreateInput`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in CreateMetalGatewayRequest with oneOf schemas: MetalGatewayCreateInput, VrfMetalGatewayCreateInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in CreateMetalGatewayRequest with oneOf schemas: MetalGatewayCreateInput, VrfMetalGatewayCreateInput. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into MetalGatewayCreateInput + try: + instance.actual_instance = MetalGatewayCreateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VrfMetalGatewayCreateInput + try: + instance.actual_instance = VrfMetalGatewayCreateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into CreateMetalGatewayRequest with oneOf schemas: MetalGatewayCreateInput, VrfMetalGatewayCreateInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into CreateMetalGatewayRequest with oneOf schemas: MetalGatewayCreateInput, VrfMetalGatewayCreateInput. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], MetalGatewayCreateInput, VrfMetalGatewayCreateInput]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/create_organization_interconnection_request.py b/equinix/services/metalv1/models/create_organization_interconnection_request.py new file mode 100644 index 00000000..ccac7815 --- /dev/null +++ b/equinix/services/metalv1/models/create_organization_interconnection_request.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.dedicated_port_create_input import DedicatedPortCreateInput +from equinix.services.metalv1.models.shared_port_vc_vlan_create_input import SharedPortVCVlanCreateInput +from equinix.services.metalv1.models.vlan_csp_connection_create_input import VlanCSPConnectionCreateInput +from equinix.services.metalv1.models.vlan_fabric_vc_create_input import VlanFabricVcCreateInput +from equinix.services.metalv1.models.vrf_fabric_vc_create_input import VrfFabricVcCreateInput +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +CREATEORGANIZATIONINTERCONNECTIONREQUEST_ONE_OF_SCHEMAS = ["DedicatedPortCreateInput", "SharedPortVCVlanCreateInput", "VlanCSPConnectionCreateInput", "VlanFabricVcCreateInput", "VrfFabricVcCreateInput"] + +class CreateOrganizationInterconnectionRequest(BaseModel): + """ + CreateOrganizationInterconnectionRequest + """ + # data type: DedicatedPortCreateInput + oneof_schema_1_validator: Optional[DedicatedPortCreateInput] = None + # data type: VlanFabricVcCreateInput + oneof_schema_2_validator: Optional[VlanFabricVcCreateInput] = None + # data type: VrfFabricVcCreateInput + oneof_schema_3_validator: Optional[VrfFabricVcCreateInput] = None + # data type: SharedPortVCVlanCreateInput + oneof_schema_4_validator: Optional[SharedPortVCVlanCreateInput] = None + # data type: VlanCSPConnectionCreateInput + oneof_schema_5_validator: Optional[VlanCSPConnectionCreateInput] = None + actual_instance: Optional[Union[DedicatedPortCreateInput, SharedPortVCVlanCreateInput, VlanCSPConnectionCreateInput, VlanFabricVcCreateInput, VrfFabricVcCreateInput]] = None + one_of_schemas: List[str] = Field(default=Literal["DedicatedPortCreateInput", "SharedPortVCVlanCreateInput", "VlanCSPConnectionCreateInput", "VlanFabricVcCreateInput", "VrfFabricVcCreateInput"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = CreateOrganizationInterconnectionRequest.model_construct() + error_messages = [] + match = 0 + # validate data type: DedicatedPortCreateInput + if not isinstance(v, DedicatedPortCreateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `DedicatedPortCreateInput`") + else: + match += 1 + # validate data type: VlanFabricVcCreateInput + if not isinstance(v, VlanFabricVcCreateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `VlanFabricVcCreateInput`") + else: + match += 1 + # validate data type: VrfFabricVcCreateInput + if not isinstance(v, VrfFabricVcCreateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfFabricVcCreateInput`") + else: + match += 1 + # validate data type: SharedPortVCVlanCreateInput + if not isinstance(v, SharedPortVCVlanCreateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `SharedPortVCVlanCreateInput`") + else: + match += 1 + # validate data type: VlanCSPConnectionCreateInput + if not isinstance(v, VlanCSPConnectionCreateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `VlanCSPConnectionCreateInput`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in CreateOrganizationInterconnectionRequest with oneOf schemas: DedicatedPortCreateInput, SharedPortVCVlanCreateInput, VlanCSPConnectionCreateInput, VlanFabricVcCreateInput, VrfFabricVcCreateInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in CreateOrganizationInterconnectionRequest with oneOf schemas: DedicatedPortCreateInput, SharedPortVCVlanCreateInput, VlanCSPConnectionCreateInput, VlanFabricVcCreateInput, VrfFabricVcCreateInput. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into DedicatedPortCreateInput + try: + instance.actual_instance = DedicatedPortCreateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VlanFabricVcCreateInput + try: + instance.actual_instance = VlanFabricVcCreateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VrfFabricVcCreateInput + try: + instance.actual_instance = VrfFabricVcCreateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into SharedPortVCVlanCreateInput + try: + instance.actual_instance = SharedPortVCVlanCreateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VlanCSPConnectionCreateInput + try: + instance.actual_instance = VlanCSPConnectionCreateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into CreateOrganizationInterconnectionRequest with oneOf schemas: DedicatedPortCreateInput, SharedPortVCVlanCreateInput, VlanCSPConnectionCreateInput, VlanFabricVcCreateInput, VrfFabricVcCreateInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into CreateOrganizationInterconnectionRequest with oneOf schemas: DedicatedPortCreateInput, SharedPortVCVlanCreateInput, VlanCSPConnectionCreateInput, VlanFabricVcCreateInput, VrfFabricVcCreateInput. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], DedicatedPortCreateInput, SharedPortVCVlanCreateInput, VlanCSPConnectionCreateInput, VlanFabricVcCreateInput, VrfFabricVcCreateInput]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/create_self_service_reservation_request.py b/equinix/services/metalv1/models/create_self_service_reservation_request.py new file mode 100644 index 00000000..9689e17c --- /dev/null +++ b/equinix/services/metalv1/models/create_self_service_reservation_request.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.create_self_service_reservation_request_period import CreateSelfServiceReservationRequestPeriod +from equinix.services.metalv1.models.self_service_reservation_item_request import SelfServiceReservationItemRequest +from typing import Optional, Set +from typing_extensions import Self + +class CreateSelfServiceReservationRequest(BaseModel): + """ + CreateSelfServiceReservationRequest + """ # noqa: E501 + href: Optional[StrictStr] = None + item: Optional[List[SelfServiceReservationItemRequest]] = None + notes: Optional[StrictStr] = None + period: Optional[CreateSelfServiceReservationRequestPeriod] = None + start_date: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["href", "item", "notes", "period", "start_date"] + + 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 CreateSelfServiceReservationRequest 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 item (list) + _items = [] + if self.item: + for _item in self.item: + if _item: + _items.append(_item.to_dict()) + _dict['item'] = _items + # override the default output from pydantic by calling `to_dict()` of period + if self.period: + _dict['period'] = self.period.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateSelfServiceReservationRequest 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"), + "item": [SelfServiceReservationItemRequest.from_dict(_item) for _item in obj["item"]] if obj.get("item") is not None else None, + "notes": obj.get("notes"), + "period": CreateSelfServiceReservationRequestPeriod.from_dict(obj["period"]) if obj.get("period") is not None else None, + "start_date": obj.get("start_date") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/create_self_service_reservation_request_period.py b/equinix/services/metalv1/models/create_self_service_reservation_request_period.py new file mode 100644 index 00000000..3ca5eb78 --- /dev/null +++ b/equinix/services/metalv1/models/create_self_service_reservation_request_period.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CreateSelfServiceReservationRequestPeriod(BaseModel): + """ + CreateSelfServiceReservationRequestPeriod + """ # noqa: E501 + count: Optional[StrictInt] = None + href: Optional[StrictStr] = None + unit: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["count", "href", "unit"] + + @field_validator('count') + def count_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([12, 36]): + raise ValueError("must be one of enum values (12, 36)") + return value + + @field_validator('unit') + def unit_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['monthly']): + raise ValueError("must be one of enum values ('monthly')") + return value + + 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 CreateSelfServiceReservationRequestPeriod 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateSelfServiceReservationRequestPeriod from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "count": obj.get("count"), + "href": obj.get("href"), + "unit": obj.get("unit") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/dedicated_port_create_input.py b/equinix/services/metalv1/models/dedicated_port_create_input.py new file mode 100644 index 00000000..8b4a0a51 --- /dev/null +++ b/equinix/services/metalv1/models/dedicated_port_create_input.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DedicatedPortCreateInput(BaseModel): + """ + DedicatedPortCreateInput + """ # noqa: E501 + billing_account_name: Optional[StrictStr] = Field(default=None, description="The billing account name of the Equinix Fabric account.") + contact_email: Optional[StrictStr] = Field(default=None, description="The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key.") + description: Optional[StrictStr] = None + facility_id: Optional[StrictStr] = None + href: Optional[StrictStr] = None + metro: StrictStr = Field(description="A Metro ID or code. For interconnections with Dedicated Ports, this will be the location of the issued Dedicated Ports.") + mode: Optional[StrictStr] = Field(default=None, description="The mode of the interconnection (only relevant to Dedicated Ports). Fabric VCs 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: StrictStr + project: Optional[StrictStr] = None + redundancy: StrictStr = Field(description="Either 'primary' or 'redundant'.") + speed: Optional[StrictStr] = Field(default=None, description="A interconnection speed, in bps, mbps, or gbps. For Dedicated Ports, this can be 10Gbps or 100Gbps.") + tags: Optional[List[StrictStr]] = None + type: StrictStr = Field(description="When requesting for a dedicated port, the value of this field should be 'dedicated'.") + use_case: Optional[StrictStr] = Field(default=None, description="The intended use case of the dedicated port.") + __properties: ClassVar[List[str]] = ["billing_account_name", "contact_email", "description", "facility_id", "href", "metro", "mode", "name", "project", "redundancy", "speed", "tags", "type", "use_case"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['standard', 'tunnel']): + raise ValueError("must be one of enum values ('standard', 'tunnel')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['dedicated']): + raise ValueError("must be one of enum values ('dedicated')") + return value + + 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 DedicatedPortCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DedicatedPortCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "billing_account_name": obj.get("billing_account_name"), + "contact_email": obj.get("contact_email"), + "description": obj.get("description"), + "facility_id": obj.get("facility_id"), + "href": obj.get("href"), + "metro": obj.get("metro"), + "mode": obj.get("mode"), + "name": obj.get("name"), + "project": obj.get("project"), + "redundancy": obj.get("redundancy"), + "speed": obj.get("speed"), + "tags": obj.get("tags"), + "type": obj.get("type"), + "use_case": obj.get("use_case") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device.py b/equinix/services/metalv1/models/device.py new file mode 100644 index 00000000..efb202e3 --- /dev/null +++ b/equinix/services/metalv1/models/device.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.device_actions_inner import DeviceActionsInner +from equinix.services.metalv1.models.device_created_by import DeviceCreatedBy +from equinix.services.metalv1.models.device_metro import DeviceMetro +from equinix.services.metalv1.models.device_project_lite import DeviceProjectLite +from equinix.services.metalv1.models.event import Event +from equinix.services.metalv1.models.facility import Facility +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.ip_assignment import IPAssignment +from equinix.services.metalv1.models.operating_system import OperatingSystem +from equinix.services.metalv1.models.plan import Plan +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.storage import Storage +from typing import Optional, Set +from typing_extensions import Self + +class Device(BaseModel): + """ + Device + """ # noqa: E501 + actions: Optional[List[DeviceActionsInner]] = Field(default=None, description="Actions supported by the device instance.") + always_pxe: Optional[StrictBool] = None + billing_cycle: Optional[StrictStr] = None + bonding_mode: Optional[StrictInt] = None + created_at: Optional[datetime] = None + created_by: Optional[DeviceCreatedBy] = None + customdata: Optional[Dict[str, Any]] = None + description: Optional[StrictStr] = None + facility: Optional[Facility] = None + firmware_set_id: Optional[StrictStr] = Field(default=None, description="The UUID of the firmware set to associate with the device.") + hardware_reservation: Optional[HardwareReservation] = None + hostname: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + image_url: Optional[StrictStr] = None + ip_addresses: Optional[List[IPAssignment]] = None + ipxe_script_url: Optional[StrictStr] = None + iqn: Optional[StrictStr] = None + locked: Optional[StrictBool] = Field(default=None, description="Prevents accidental deletion of this resource when set to true.") + metro: Optional[DeviceMetro] = None + network_frozen: Optional[StrictBool] = Field(default=None, description="Whether network mode changes such as converting to/from Layer2 or Layer3 networking, bonding or disbonding network interfaces are permitted for the device.") + network_ports: Optional[List[Port]] = Field(default=None, description="By default, servers at Equinix Metal are configured in a “bonded” mode using LACP (Link Aggregation Control Protocol). Each 2-NIC server is configured with a single bond (namely bond0) with both interfaces eth0 and eth1 as members of the bond in a default Layer 3 mode. Some device plans may have a different number of ports and bonds available.") + operating_system: Optional[OperatingSystem] = None + plan: Optional[Plan] = None + project: Optional[Project] = None + project_lite: Optional[DeviceProjectLite] = None + provisioning_events: Optional[List[Event]] = None + provisioning_percentage: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Only visible while device provisioning") + root_password: Optional[StrictStr] = Field(default=None, description="Root password is automatically generated when server is provisioned and it is removed after 24 hours") + short_id: Optional[StrictStr] = None + sos: Optional[StrictStr] = Field(default=None, description="Hostname used to connect to the instance via the SOS (Serial over SSH) out-of-band console.") + spot_instance: Optional[StrictBool] = Field(default=None, description="Whether or not the device is a spot instance.") + spot_price_max: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The maximum price per hour you are willing to pay to keep this spot instance. If you are outbid, the termination will be set allowing two minutes before shutdown.") + ssh_keys: Optional[List[Href]] = None + state: Optional[StrictStr] = Field(default=None, description="The current state the instance is in. * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. * Once provisioning has begun on the instance it's state will move to `provisioning`. * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. * If an instance fails to provision or deprovision it will move to `failed` state. * Once an instance has completed provisioning it will move to `active` state. * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. * When the instance is powered off completely it will move to the `inactive` state. * When an instance is powered on completely it will move to the `active` state. * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. * When the reinstall action is complete the instance will move to `active` state.") + storage: Optional[Storage] = None + switch_uuid: Optional[StrictStr] = Field(default=None, description="Switch short id. This can be used to determine if two devices are connected to the same switch, for example.") + tags: Optional[List[StrictStr]] = None + termination_time: Optional[datetime] = Field(default=None, description="When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid.") + updated_at: Optional[datetime] = None + user: Optional[StrictStr] = None + userdata: Optional[StrictStr] = None + volumes: Optional[List[Href]] = None + __properties: ClassVar[List[str]] = ["actions", "always_pxe", "billing_cycle", "bonding_mode", "created_at", "created_by", "customdata", "description", "facility", "firmware_set_id", "hardware_reservation", "hostname", "href", "id", "image_url", "ip_addresses", "ipxe_script_url", "iqn", "locked", "metro", "network_frozen", "network_ports", "operating_system", "plan", "project", "project_lite", "provisioning_events", "provisioning_percentage", "root_password", "short_id", "sos", "spot_instance", "spot_price_max", "ssh_keys", "state", "storage", "switch_uuid", "tags", "termination_time", "updated_at", "user", "userdata", "volumes"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['queued', 'provisioning', 'deprovisioning', 'reinstalling', 'active', 'inactive', 'failed', 'powering_on', 'powering_off', 'deleted']): + raise ValueError("must be one of enum values ('queued', 'provisioning', 'deprovisioning', 'reinstalling', 'active', 'inactive', 'failed', 'powering_on', 'powering_off', 'deleted')") + return value + + 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 Device 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 actions (list) + _items = [] + if self.actions: + for _item in self.actions: + if _item: + _items.append(_item.to_dict()) + _dict['actions'] = _items + # override the default output from pydantic by calling `to_dict()` of created_by + if self.created_by: + _dict['created_by'] = self.created_by.to_dict() + # override the default output from pydantic by calling `to_dict()` of facility + if self.facility: + _dict['facility'] = self.facility.to_dict() + # override the default output from pydantic by calling `to_dict()` of hardware_reservation + if self.hardware_reservation: + _dict['hardware_reservation'] = self.hardware_reservation.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in ip_addresses (list) + _items = [] + if self.ip_addresses: + for _item in self.ip_addresses: + if _item: + _items.append(_item.to_dict()) + _dict['ip_addresses'] = _items + # override the default output from pydantic by calling `to_dict()` of metro + if self.metro: + _dict['metro'] = self.metro.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in network_ports (list) + _items = [] + if self.network_ports: + for _item in self.network_ports: + if _item: + _items.append(_item.to_dict()) + _dict['network_ports'] = _items + # override the default output from pydantic by calling `to_dict()` of operating_system + if self.operating_system: + _dict['operating_system'] = self.operating_system.to_dict() + # override the default output from pydantic by calling `to_dict()` of plan + if self.plan: + _dict['plan'] = self.plan.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of project_lite + if self.project_lite: + _dict['project_lite'] = self.project_lite.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in provisioning_events (list) + _items = [] + if self.provisioning_events: + for _item in self.provisioning_events: + if _item: + _items.append(_item.to_dict()) + _dict['provisioning_events'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ssh_keys (list) + _items = [] + if self.ssh_keys: + for _item in self.ssh_keys: + if _item: + _items.append(_item.to_dict()) + _dict['ssh_keys'] = _items + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict['storage'] = self.storage.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in volumes (list) + _items = [] + if self.volumes: + for _item in self.volumes: + if _item: + _items.append(_item.to_dict()) + _dict['volumes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Device from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "actions": [DeviceActionsInner.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None, + "always_pxe": obj.get("always_pxe"), + "billing_cycle": obj.get("billing_cycle"), + "bonding_mode": obj.get("bonding_mode"), + "created_at": obj.get("created_at"), + "created_by": DeviceCreatedBy.from_dict(obj["created_by"]) if obj.get("created_by") is not None else None, + "customdata": obj.get("customdata"), + "description": obj.get("description"), + "facility": Facility.from_dict(obj["facility"]) if obj.get("facility") is not None else None, + "firmware_set_id": obj.get("firmware_set_id"), + "hardware_reservation": HardwareReservation.from_dict(obj["hardware_reservation"]) if obj.get("hardware_reservation") is not None else None, + "hostname": obj.get("hostname"), + "href": obj.get("href"), + "id": obj.get("id"), + "image_url": obj.get("image_url"), + "ip_addresses": [IPAssignment.from_dict(_item) for _item in obj["ip_addresses"]] if obj.get("ip_addresses") is not None else None, + "ipxe_script_url": obj.get("ipxe_script_url"), + "iqn": obj.get("iqn"), + "locked": obj.get("locked"), + "metro": DeviceMetro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "network_frozen": obj.get("network_frozen"), + "network_ports": [Port.from_dict(_item) for _item in obj["network_ports"]] if obj.get("network_ports") is not None else None, + "operating_system": OperatingSystem.from_dict(obj["operating_system"]) if obj.get("operating_system") is not None else None, + "plan": Plan.from_dict(obj["plan"]) if obj.get("plan") is not None else None, + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, + "project_lite": DeviceProjectLite.from_dict(obj["project_lite"]) if obj.get("project_lite") is not None else None, + "provisioning_events": [Event.from_dict(_item) for _item in obj["provisioning_events"]] if obj.get("provisioning_events") is not None else None, + "provisioning_percentage": obj.get("provisioning_percentage"), + "root_password": obj.get("root_password"), + "short_id": obj.get("short_id"), + "sos": obj.get("sos"), + "spot_instance": obj.get("spot_instance"), + "spot_price_max": obj.get("spot_price_max"), + "ssh_keys": [Href.from_dict(_item) for _item in obj["ssh_keys"]] if obj.get("ssh_keys") is not None else None, + "state": obj.get("state"), + "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "switch_uuid": obj.get("switch_uuid"), + "tags": obj.get("tags"), + "termination_time": obj.get("termination_time"), + "updated_at": obj.get("updated_at"), + "user": obj.get("user"), + "userdata": obj.get("userdata"), + "volumes": [Href.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None + }) + return _obj + +from equinix.services.metalv1.models.hardware_reservation import HardwareReservation +from equinix.services.metalv1.models.port import Port +# TODO: Rewrite to not use raise_errors +Device.model_rebuild(raise_errors=False) + diff --git a/equinix/services/metalv1/models/device_action_input.py b/equinix/services/metalv1/models/device_action_input.py new file mode 100644 index 00000000..9264453a --- /dev/null +++ b/equinix/services/metalv1/models/device_action_input.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DeviceActionInput(BaseModel): + """ + DeviceActionInput + """ # noqa: E501 + deprovision_fast: Optional[StrictBool] = Field(default=None, description="When type is `reinstall`, enabling fast deprovisioning will bypass full disk wiping.") + force_delete: Optional[StrictBool] = Field(default=None, description="May be required to perform actions under certain conditions") + href: Optional[StrictStr] = None + ipxe_script_url: Optional[StrictStr] = Field(default=None, description="When type is `reinstall`, use this `ipxe_script_url` (`operating_system` must be `custom_ipxe`, defaults to the current `ipxe_script_url`)") + operating_system: Optional[StrictStr] = Field(default=None, description="When type is `reinstall`, use this `operating_system` (defaults to the current `operating system`)") + preserve_data: Optional[StrictBool] = Field(default=None, description="When type is `reinstall`, preserve the existing data on all disks except the operating-system disk.") + type: StrictStr = Field(description="Action to perform. See Device.actions for possible actions.") + __properties: ClassVar[List[str]] = ["deprovision_fast", "force_delete", "href", "ipxe_script_url", "operating_system", "preserve_data", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['power_on', 'power_off', 'reboot', 'rescue', 'reinstall']): + raise ValueError("must be one of enum values ('power_on', 'power_off', 'reboot', 'rescue', 'reinstall')") + return value + + 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 DeviceActionInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceActionInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "deprovision_fast": obj.get("deprovision_fast"), + "force_delete": obj.get("force_delete"), + "href": obj.get("href"), + "ipxe_script_url": obj.get("ipxe_script_url"), + "operating_system": obj.get("operating_system"), + "preserve_data": obj.get("preserve_data"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_actions_inner.py b/equinix/services/metalv1/models/device_actions_inner.py new file mode 100644 index 00000000..64e1440d --- /dev/null +++ b/equinix/services/metalv1/models/device_actions_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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 DeviceActionsInner(BaseModel): + """ + DeviceActionsInner + """ # noqa: E501 + href: Optional[StrictStr] = None + name: Optional[StrictStr] = None + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "name", "type"] + + 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 DeviceActionsInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceActionsInner 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"), + "name": obj.get("name"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_create_in_facility_input.py b/equinix/services/metalv1/models/device_create_in_facility_input.py new file mode 100644 index 00000000..7ae12594 --- /dev/null +++ b/equinix/services/metalv1/models/device_create_in_facility_input.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.facility_input_facility import FacilityInputFacility +from equinix.services.metalv1.models.ip_address import IPAddress +from equinix.services.metalv1.models.ssh_key_input import SSHKeyInput +from equinix.services.metalv1.models.storage import Storage +from typing import Optional, Set +from typing_extensions import Self + +class DeviceCreateInFacilityInput(BaseModel): + """ + DeviceCreateInFacilityInput + """ # noqa: E501 + facility: FacilityInputFacility + href: Optional[StrictStr] = None + 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.") + customdata: Optional[Dict[str, Any]] = Field(default=None, description="Customdata is an arbitrary JSON value that can be accessed via the metadata service.") + description: Optional[StrictStr] = Field(default=None, description="Any description of the device or how it will be used. This may be used to inform other API consumers with project access.") + features: Optional[List[StrictStr]] = Field(default=None, description="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.") + hardware_reservation_id: Optional[StrictStr] = Field(default=None, description="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.") + hostname: Optional[StrictStr] = Field(default=None, description="The hostname to use within the operating system. The same hostname may be used on multiple devices within a project.") + ip_addresses: Optional[List[IPAddress]] = Field(default=None, description="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.") + ipxe_script_url: Optional[StrictStr] = Field(default=None, description="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.") + locked: Optional[StrictBool] = Field(default=False, description="Whether the device should be locked, preventing accidental deletion.") + network_frozen: Optional[StrictBool] = Field(default=None, description="If true, this instance can not be converted to a different network type.") + no_ssh_keys: Optional[StrictBool] = Field(default=False, description="Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified") + operating_system: StrictStr = Field(description="The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans.") + plan: StrictStr = Field(description="The slug of the device plan to provision.") + private_ipv4_subnet_size: Optional[StrictInt] = Field(default=None, description="Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device.") + project_ssh_keys: Optional[List[StrictStr]] = Field(default=None, description="A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. ") + public_ipv4_subnet_size: Optional[StrictInt] = Field(default=None, description="Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request.") + spot_instance: Optional[StrictBool] = Field(default=None, description="Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field.") + spot_price_max: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The maximum amount to bid for a spot instance.") + ssh_keys: Optional[List[SSHKeyInput]] = Field(default=None, description="A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. ") + storage: Optional[Storage] = None + tags: Optional[List[StrictStr]] = None + termination_time: Optional[datetime] = Field(default=None, description="When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. ") + user_ssh_keys: Optional[List[StrictStr]] = Field(default=None, description="A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. ") + 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.") + __properties: ClassVar[List[str]] = ["facility", "href", "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"] + + @field_validator('billing_cycle') + def billing_cycle_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['hourly', 'daily', 'monthly', 'yearly']): + raise ValueError("must be one of enum values ('hourly', 'daily', 'monthly', 'yearly')") + return value + + 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 DeviceCreateInFacilityInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of facility + if self.facility: + _dict['facility'] = self.facility.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in ip_addresses (list) + _items = [] + if self.ip_addresses: + for _item in self.ip_addresses: + if _item: + _items.append(_item.to_dict()) + _dict['ip_addresses'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ssh_keys (list) + _items = [] + if self.ssh_keys: + for _item in self.ssh_keys: + if _item: + _items.append(_item.to_dict()) + _dict['ssh_keys'] = _items + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict['storage'] = self.storage.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceCreateInFacilityInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "facility": FacilityInputFacility.from_dict(obj["facility"]) if obj.get("facility") is not None else None, + "href": obj.get("href"), + "always_pxe": obj.get("always_pxe"), + "billing_cycle": obj.get("billing_cycle"), + "customdata": obj.get("customdata"), + "description": obj.get("description"), + "features": obj.get("features"), + "hardware_reservation_id": obj.get("hardware_reservation_id"), + "hostname": obj.get("hostname"), + "ip_addresses": [IPAddress.from_dict(_item) for _item in obj["ip_addresses"]] if obj.get("ip_addresses") is not None else None, + "ipxe_script_url": obj.get("ipxe_script_url"), + "locked": obj.get("locked") if obj.get("locked") is not None else False, + "network_frozen": obj.get("network_frozen"), + "no_ssh_keys": obj.get("no_ssh_keys") if obj.get("no_ssh_keys") is not None else False, + "operating_system": obj.get("operating_system"), + "plan": obj.get("plan"), + "private_ipv4_subnet_size": obj.get("private_ipv4_subnet_size"), + "project_ssh_keys": obj.get("project_ssh_keys"), + "public_ipv4_subnet_size": obj.get("public_ipv4_subnet_size"), + "spot_instance": obj.get("spot_instance"), + "spot_price_max": obj.get("spot_price_max"), + "ssh_keys": [SSHKeyInput.from_dict(_item) for _item in obj["ssh_keys"]] if obj.get("ssh_keys") is not None else None, + "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "tags": obj.get("tags"), + "termination_time": obj.get("termination_time"), + "user_ssh_keys": obj.get("user_ssh_keys"), + "userdata": obj.get("userdata") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_create_in_metro_input.py b/equinix/services/metalv1/models/device_create_in_metro_input.py new file mode 100644 index 00000000..e06e24dd --- /dev/null +++ b/equinix/services/metalv1/models/device_create_in_metro_input.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.ip_address import IPAddress +from equinix.services.metalv1.models.ssh_key_input import SSHKeyInput +from equinix.services.metalv1.models.storage import Storage +from typing import Optional, Set +from typing_extensions import Self + +class DeviceCreateInMetroInput(BaseModel): + """ + DeviceCreateInMetroInput + """ # noqa: E501 + 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.") + customdata: Optional[Dict[str, Any]] = Field(default=None, description="Customdata is an arbitrary JSON value that can be accessed via the metadata service.") + description: Optional[StrictStr] = Field(default=None, description="Any description of the device or how it will be used. This may be used to inform other API consumers with project access.") + features: Optional[List[StrictStr]] = Field(default=None, description="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.") + hardware_reservation_id: Optional[StrictStr] = Field(default=None, description="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.") + hostname: Optional[StrictStr] = Field(default=None, description="The hostname to use within the operating system. The same hostname may be used on multiple devices within a project.") + ip_addresses: Optional[List[IPAddress]] = Field(default=None, description="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.") + ipxe_script_url: Optional[StrictStr] = Field(default=None, description="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.") + locked: Optional[StrictBool] = Field(default=False, description="Whether the device should be locked, preventing accidental deletion.") + network_frozen: Optional[StrictBool] = Field(default=None, description="If true, this instance can not be converted to a different network type.") + no_ssh_keys: Optional[StrictBool] = Field(default=False, description="Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified") + operating_system: StrictStr = Field(description="The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans.") + plan: StrictStr = Field(description="The slug of the device plan to provision.") + private_ipv4_subnet_size: Optional[StrictInt] = Field(default=None, description="Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device.") + project_ssh_keys: Optional[List[StrictStr]] = Field(default=None, description="A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. ") + public_ipv4_subnet_size: Optional[StrictInt] = Field(default=None, description="Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request.") + spot_instance: Optional[StrictBool] = Field(default=None, description="Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field.") + spot_price_max: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The maximum amount to bid for a spot instance.") + ssh_keys: Optional[List[SSHKeyInput]] = Field(default=None, description="A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. ") + storage: Optional[Storage] = None + tags: Optional[List[StrictStr]] = None + termination_time: Optional[datetime] = Field(default=None, description="When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. ") + user_ssh_keys: Optional[List[StrictStr]] = Field(default=None, description="A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. ") + 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.") + __properties: ClassVar[List[str]] = ["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"] + + @field_validator('billing_cycle') + def billing_cycle_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['hourly', 'daily', 'monthly', 'yearly']): + raise ValueError("must be one of enum values ('hourly', 'daily', 'monthly', 'yearly')") + return value + + 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 DeviceCreateInMetroInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 ip_addresses (list) + _items = [] + if self.ip_addresses: + for _item in self.ip_addresses: + if _item: + _items.append(_item.to_dict()) + _dict['ip_addresses'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ssh_keys (list) + _items = [] + if self.ssh_keys: + for _item in self.ssh_keys: + if _item: + _items.append(_item.to_dict()) + _dict['ssh_keys'] = _items + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict['storage'] = self.storage.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceCreateInMetroInput 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"), + "metro": obj.get("metro"), + "always_pxe": obj.get("always_pxe"), + "billing_cycle": obj.get("billing_cycle"), + "customdata": obj.get("customdata"), + "description": obj.get("description"), + "features": obj.get("features"), + "hardware_reservation_id": obj.get("hardware_reservation_id"), + "hostname": obj.get("hostname"), + "ip_addresses": [IPAddress.from_dict(_item) for _item in obj["ip_addresses"]] if obj.get("ip_addresses") is not None else None, + "ipxe_script_url": obj.get("ipxe_script_url"), + "locked": obj.get("locked") if obj.get("locked") is not None else False, + "network_frozen": obj.get("network_frozen"), + "no_ssh_keys": obj.get("no_ssh_keys") if obj.get("no_ssh_keys") is not None else False, + "operating_system": obj.get("operating_system"), + "plan": obj.get("plan"), + "private_ipv4_subnet_size": obj.get("private_ipv4_subnet_size"), + "project_ssh_keys": obj.get("project_ssh_keys"), + "public_ipv4_subnet_size": obj.get("public_ipv4_subnet_size"), + "spot_instance": obj.get("spot_instance"), + "spot_price_max": obj.get("spot_price_max"), + "ssh_keys": [SSHKeyInput.from_dict(_item) for _item in obj["ssh_keys"]] if obj.get("ssh_keys") is not None else None, + "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "tags": obj.get("tags"), + "termination_time": obj.get("termination_time"), + "user_ssh_keys": obj.get("user_ssh_keys"), + "userdata": obj.get("userdata") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_create_input.py b/equinix/services/metalv1/models/device_create_input.py new file mode 100644 index 00000000..bec91bf2 --- /dev/null +++ b/equinix/services/metalv1/models/device_create_input.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.ip_address import IPAddress +from equinix.services.metalv1.models.ssh_key_input import SSHKeyInput +from equinix.services.metalv1.models.storage import Storage +from typing import Optional, Set +from typing_extensions import Self + +class DeviceCreateInput(BaseModel): + """ + DeviceCreateInput + """ # noqa: E501 + 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.") + customdata: Optional[Dict[str, Any]] = Field(default=None, description="Customdata is an arbitrary JSON value that can be accessed via the metadata service.") + description: Optional[StrictStr] = Field(default=None, description="Any description of the device or how it will be used. This may be used to inform other API consumers with project access.") + features: Optional[List[StrictStr]] = Field(default=None, description="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.") + hardware_reservation_id: Optional[StrictStr] = Field(default=None, description="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.") + hostname: Optional[StrictStr] = Field(default=None, description="The hostname to use within the operating system. The same hostname may be used on multiple devices within a project.") + href: Optional[StrictStr] = None + ip_addresses: Optional[List[IPAddress]] = Field(default=None, description="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.") + ipxe_script_url: Optional[StrictStr] = Field(default=None, description="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.") + locked: Optional[StrictBool] = Field(default=False, description="Whether the device should be locked, preventing accidental deletion.") + network_frozen: Optional[StrictBool] = Field(default=None, description="If true, this instance can not be converted to a different network type.") + no_ssh_keys: Optional[StrictBool] = Field(default=False, description="Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified") + operating_system: StrictStr = Field(description="The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans.") + plan: StrictStr = Field(description="The slug of the device plan to provision.") + private_ipv4_subnet_size: Optional[StrictInt] = Field(default=None, description="Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device.") + project_ssh_keys: Optional[List[StrictStr]] = Field(default=None, description="A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. ") + public_ipv4_subnet_size: Optional[StrictInt] = Field(default=None, description="Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request.") + spot_instance: Optional[StrictBool] = Field(default=None, description="Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field.") + spot_price_max: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The maximum amount to bid for a spot instance.") + ssh_keys: Optional[List[SSHKeyInput]] = Field(default=None, description="A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. ") + storage: Optional[Storage] = None + tags: Optional[List[StrictStr]] = None + termination_time: Optional[datetime] = Field(default=None, description="When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. ") + user_ssh_keys: Optional[List[StrictStr]] = Field(default=None, description="A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. ") + 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.") + __properties: ClassVar[List[str]] = ["always_pxe", "billing_cycle", "customdata", "description", "features", "hardware_reservation_id", "hostname", "href", "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"] + + @field_validator('billing_cycle') + def billing_cycle_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['hourly', 'daily', 'monthly', 'yearly']): + raise ValueError("must be one of enum values ('hourly', 'daily', 'monthly', 'yearly')") + return value + + 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 DeviceCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 ip_addresses (list) + _items = [] + if self.ip_addresses: + for _item in self.ip_addresses: + if _item: + _items.append(_item.to_dict()) + _dict['ip_addresses'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ssh_keys (list) + _items = [] + if self.ssh_keys: + for _item in self.ssh_keys: + if _item: + _items.append(_item.to_dict()) + _dict['ssh_keys'] = _items + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict['storage'] = self.storage.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "always_pxe": obj.get("always_pxe"), + "billing_cycle": obj.get("billing_cycle"), + "customdata": obj.get("customdata"), + "description": obj.get("description"), + "features": obj.get("features"), + "hardware_reservation_id": obj.get("hardware_reservation_id"), + "hostname": obj.get("hostname"), + "href": obj.get("href"), + "ip_addresses": [IPAddress.from_dict(_item) for _item in obj["ip_addresses"]] if obj.get("ip_addresses") is not None else None, + "ipxe_script_url": obj.get("ipxe_script_url"), + "locked": obj.get("locked") if obj.get("locked") is not None else False, + "network_frozen": obj.get("network_frozen"), + "no_ssh_keys": obj.get("no_ssh_keys") if obj.get("no_ssh_keys") is not None else False, + "operating_system": obj.get("operating_system"), + "plan": obj.get("plan"), + "private_ipv4_subnet_size": obj.get("private_ipv4_subnet_size"), + "project_ssh_keys": obj.get("project_ssh_keys"), + "public_ipv4_subnet_size": obj.get("public_ipv4_subnet_size"), + "spot_instance": obj.get("spot_instance"), + "spot_price_max": obj.get("spot_price_max"), + "ssh_keys": [SSHKeyInput.from_dict(_item) for _item in obj["ssh_keys"]] if obj.get("ssh_keys") is not None else None, + "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "tags": obj.get("tags"), + "termination_time": obj.get("termination_time"), + "user_ssh_keys": obj.get("user_ssh_keys"), + "userdata": obj.get("userdata") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_created_by.py b/equinix/services/metalv1/models/device_created_by.py new file mode 100644 index 00000000..0c80b90f --- /dev/null +++ b/equinix/services/metalv1/models/device_created_by.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DeviceCreatedBy(BaseModel): + """ + DeviceCreatedBy + """ # noqa: E501 + avatar_thumb_url: Optional[StrictStr] = Field(default=None, description="Avatar thumbnail URL of the User") + created_at: Optional[datetime] = Field(default=None, description="When the user was created") + email: Optional[StrictStr] = Field(default=None, description="Primary email address of the User") + first_name: Optional[StrictStr] = Field(default=None, description="First name of the User") + full_name: Optional[StrictStr] = Field(default=None, description="Full name of the User") + href: Optional[StrictStr] = Field(default=None, description="API URL uniquely representing the User") + id: StrictStr = Field(description="ID of the User") + last_name: Optional[StrictStr] = Field(default=None, description="Last name of the User") + short_id: StrictStr = Field(description="Short ID of the User") + updated_at: Optional[datetime] = Field(default=None, description="When the user details were last updated") + __properties: ClassVar[List[str]] = ["avatar_thumb_url", "created_at", "email", "first_name", "full_name", "href", "id", "last_name", "short_id", "updated_at"] + + 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 DeviceCreatedBy 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceCreatedBy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "avatar_thumb_url": obj.get("avatar_thumb_url"), + "created_at": obj.get("created_at"), + "email": obj.get("email"), + "first_name": obj.get("first_name"), + "full_name": obj.get("full_name"), + "href": obj.get("href"), + "id": obj.get("id"), + "last_name": obj.get("last_name"), + "short_id": obj.get("short_id"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_health_rollup.py b/equinix/services/metalv1/models/device_health_rollup.py new file mode 100644 index 00000000..2a314573 --- /dev/null +++ b/equinix/services/metalv1/models/device_health_rollup.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DeviceHealthRollup(BaseModel): + """ + Represents a Device Health Status + """ # noqa: E501 + health_rollup: Optional[StrictStr] = Field(default=None, description="Health Status") + href: Optional[StrictStr] = None + updated_at: Optional[datetime] = Field(default=None, description="Last update of health status.") + __properties: ClassVar[List[str]] = ["health_rollup", "href", "updated_at"] + + @field_validator('health_rollup') + def health_rollup_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ok', 'warning', 'critical']): + raise ValueError("must be one of enum values ('ok', 'warning', 'critical')") + return value + + 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 DeviceHealthRollup 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "health_rollup", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceHealthRollup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "health_rollup": obj.get("health_rollup"), + "href": obj.get("href"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_list.py b/equinix/services/metalv1/models/device_list.py new file mode 100644 index 00000000..5cd5b470 --- /dev/null +++ b/equinix/services/metalv1/models/device_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.device import Device +from equinix.services.metalv1.models.meta import Meta +from typing import Optional, Set +from typing_extensions import Self + +class DeviceList(BaseModel): + """ + DeviceList + """ # noqa: E501 + devices: Optional[List[Device]] = None + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + __properties: ClassVar[List[str]] = ["devices", "href", "meta"] + + 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 DeviceList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 devices (list) + _items = [] + if self.devices: + for _item in self.devices: + if _item: + _items.append(_item.to_dict()) + _dict['devices'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "devices": [Device.from_dict(_item) for _item in obj["devices"]] if obj.get("devices") is not None else None, + "href": obj.get("href"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_metro.py b/equinix/services/metalv1/models/device_metro.py new file mode 100644 index 00000000..0cba3403 --- /dev/null +++ b/equinix/services/metalv1/models/device_metro.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 DeviceMetro(BaseModel): + """ + DeviceMetro + """ # noqa: E501 + code: Optional[StrictStr] = None + country: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __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 DeviceMetro 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceMetro 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") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_project_lite.py b/equinix/services/metalv1/models/device_project_lite.py new file mode 100644 index 00000000..6f111476 --- /dev/null +++ b/equinix/services/metalv1/models/device_project_lite.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Metal API + + 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 +from typing import Optional, Set +from typing_extensions import Self + +class DeviceProjectLite(BaseModel): + """ + DeviceProjectLite + """ # noqa: E501 + href: StrictStr + __properties: ClassVar[List[str]] = ["href"] + + 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 DeviceProjectLite 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceProjectLite 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") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_update_input.py b/equinix/services/metalv1/models/device_update_input.py new file mode 100644 index 00000000..858068c8 --- /dev/null +++ b/equinix/services/metalv1/models/device_update_input.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DeviceUpdateInput(BaseModel): + """ + DeviceUpdateInput + """ # noqa: E501 + always_pxe: Optional[StrictBool] = None + billing_cycle: Optional[StrictStr] = None + customdata: Optional[Dict[str, Any]] = None + description: Optional[StrictStr] = None + firmware_set_id: Optional[StrictStr] = None + hostname: Optional[StrictStr] = None + href: Optional[StrictStr] = None + ipxe_script_url: Optional[StrictStr] = None + locked: Optional[StrictBool] = Field(default=None, description="Whether the device should be locked, preventing accidental deletion.") + network_frozen: Optional[StrictBool] = Field(default=None, description="If true, this instance can not be converted to a different network type.") + spot_instance: Optional[StrictBool] = Field(default=None, description="Can be set to false to convert a spot-market instance to on-demand.") + tags: Optional[List[StrictStr]] = None + userdata: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["always_pxe", "billing_cycle", "customdata", "description", "firmware_set_id", "hostname", "href", "ipxe_script_url", "locked", "network_frozen", "spot_instance", "tags", "userdata"] + + 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 DeviceUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "always_pxe": obj.get("always_pxe"), + "billing_cycle": obj.get("billing_cycle"), + "customdata": obj.get("customdata"), + "description": obj.get("description"), + "firmware_set_id": obj.get("firmware_set_id"), + "hostname": obj.get("hostname"), + "href": obj.get("href"), + "ipxe_script_url": obj.get("ipxe_script_url"), + "locked": obj.get("locked"), + "network_frozen": obj.get("network_frozen"), + "spot_instance": obj.get("spot_instance"), + "tags": obj.get("tags"), + "userdata": obj.get("userdata") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_usage.py b/equinix/services/metalv1/models/device_usage.py new file mode 100644 index 00000000..ec1fa783 --- /dev/null +++ b/equinix/services/metalv1/models/device_usage.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 DeviceUsage(BaseModel): + """ + DeviceUsage + """ # noqa: E501 + href: Optional[StrictStr] = None + quantity: Optional[StrictStr] = None + total: Optional[StrictStr] = None + unit: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "quantity", "total", "unit"] + + 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 DeviceUsage 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceUsage 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"), + "quantity": obj.get("quantity"), + "total": obj.get("total"), + "unit": obj.get("unit") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/device_usage_list.py b/equinix/services/metalv1/models/device_usage_list.py new file mode 100644 index 00000000..99ec34a4 --- /dev/null +++ b/equinix/services/metalv1/models/device_usage_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.device_usage import DeviceUsage +from typing import Optional, Set +from typing_extensions import Self + +class DeviceUsageList(BaseModel): + """ + DeviceUsageList + """ # noqa: E501 + href: Optional[StrictStr] = None + usages: Optional[List[DeviceUsage]] = None + __properties: ClassVar[List[str]] = ["href", "usages"] + + 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 DeviceUsageList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 usages (list) + _items = [] + if self.usages: + for _item in self.usages: + if _item: + _items.append(_item.to_dict()) + _dict['usages'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeviceUsageList 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"), + "usages": [DeviceUsage.from_dict(_item) for _item in obj["usages"]] if obj.get("usages") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/disk.py b/equinix/services/metalv1/models/disk.py new file mode 100644 index 00000000..ac2aef68 --- /dev/null +++ b/equinix/services/metalv1/models/disk.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.partition import Partition +from typing import Optional, Set +from typing_extensions import Self + +class Disk(BaseModel): + """ + Disk + """ # noqa: E501 + device: Optional[StrictStr] = None + href: Optional[StrictStr] = None + partitions: Optional[List[Partition]] = None + wipe_table: Optional[StrictBool] = Field(default=None, alias="wipeTable") + __properties: ClassVar[List[str]] = ["device", "href", "partitions", "wipeTable"] + + 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 Disk 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 partitions (list) + _items = [] + if self.partitions: + for _item in self.partitions: + if _item: + _items.append(_item.to_dict()) + _dict['partitions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Disk from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "device": obj.get("device"), + "href": obj.get("href"), + "partitions": [Partition.from_dict(_item) for _item in obj["partitions"]] if obj.get("partitions") is not None else None, + "wipeTable": obj.get("wipeTable") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/email.py b/equinix/services/metalv1/models/email.py new file mode 100644 index 00000000..5a29f5d0 --- /dev/null +++ b/equinix/services/metalv1/models/email.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Email(BaseModel): + """ + Email + """ # noqa: E501 + address: Optional[StrictStr] = None + default: Optional[StrictBool] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + verified: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["address", "default", "href", "id", "verified"] + + 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 Email 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Email from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "default": obj.get("default"), + "href": obj.get("href"), + "id": obj.get("id"), + "verified": obj.get("verified") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/email_input.py b/equinix/services/metalv1/models/email_input.py new file mode 100644 index 00000000..5f442794 --- /dev/null +++ b/equinix/services/metalv1/models/email_input.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EmailInput(BaseModel): + """ + EmailInput + """ # noqa: E501 + address: StrictStr + default: Optional[StrictBool] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "default", "href"] + + 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 EmailInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EmailInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "default": obj.get("default"), + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/entitlement.py b/equinix/services/metalv1/models/entitlement.py new file mode 100644 index 00000000..477e1f0a --- /dev/null +++ b/equinix/services/metalv1/models/entitlement.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Entitlement(BaseModel): + """ + Entitlement + """ # noqa: E501 + description: Optional[StrictStr] = None + feature_access: Optional[Dict[str, Any]] = None + href: Optional[StrictStr] = None + id: StrictStr + instance_quota: Optional[Dict[str, Any]] = None + ip_quota: Optional[Dict[str, Any]] = None + name: Optional[StrictStr] = None + project_quota: Optional[StrictInt] = 0 + slug: StrictStr + volume_limits: Optional[Dict[str, Any]] = None + volume_quota: Optional[Dict[str, Any]] = None + weight: StrictInt + __properties: ClassVar[List[str]] = ["description", "feature_access", "href", "id", "instance_quota", "ip_quota", "name", "project_quota", "slug", "volume_limits", "volume_quota", "weight"] + + 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 Entitlement 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Entitlement from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "feature_access": obj.get("feature_access"), + "href": obj.get("href"), + "id": obj.get("id"), + "instance_quota": obj.get("instance_quota"), + "ip_quota": obj.get("ip_quota"), + "name": obj.get("name"), + "project_quota": obj.get("project_quota") if obj.get("project_quota") is not None else 0, + "slug": obj.get("slug"), + "volume_limits": obj.get("volume_limits"), + "volume_quota": obj.get("volume_quota"), + "weight": obj.get("weight") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/error.py b/equinix/services/metalv1/models/error.py new file mode 100644 index 00000000..876cfe31 --- /dev/null +++ b/equinix/services/metalv1/models/error.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class Error(BaseModel): + """ + Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. + """ # noqa: E501 + error: Optional[StrictStr] = Field(default=None, description="A description of the error that caused the request to fail.") + errors: Optional[List[StrictStr]] = Field(default=None, description="A list of errors that contributed to the request failing.") + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["error", "errors", "href"] + + 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 Error 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Error from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "errors": obj.get("errors"), + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/event.py b/equinix/services/metalv1/models/event.py new file mode 100644 index 00000000..c09b3cf7 --- /dev/null +++ b/equinix/services/metalv1/models/event.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class Event(BaseModel): + """ + Event + """ # noqa: E501 + body: Optional[StrictStr] = None + created_at: Optional[datetime] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + interpolated: Optional[StrictStr] = None + ip: Optional[StrictStr] = None + modified_by: Optional[Dict[str, Any]] = None + relationships: Optional[List[Href]] = None + state: Optional[StrictStr] = None + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["body", "created_at", "href", "id", "interpolated", "ip", "modified_by", "relationships", "state", "type"] + + 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 Event 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 relationships (list) + _items = [] + if self.relationships: + for _item in self.relationships: + if _item: + _items.append(_item.to_dict()) + _dict['relationships'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Event from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "body": obj.get("body"), + "created_at": obj.get("created_at"), + "href": obj.get("href"), + "id": obj.get("id"), + "interpolated": obj.get("interpolated"), + "ip": obj.get("ip"), + "modified_by": obj.get("modified_by"), + "relationships": [Href.from_dict(_item) for _item in obj["relationships"]] if obj.get("relationships") is not None else None, + "state": obj.get("state"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/event_list.py b/equinix/services/metalv1/models/event_list.py new file mode 100644 index 00000000..66a7465a --- /dev/null +++ b/equinix/services/metalv1/models/event_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.event import Event +from equinix.services.metalv1.models.meta import Meta +from typing import Optional, Set +from typing_extensions import Self + +class EventList(BaseModel): + """ + EventList + """ # noqa: E501 + events: Optional[List[Event]] = None + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + __properties: ClassVar[List[str]] = ["events", "href", "meta"] + + 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 EventList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 events (list) + _items = [] + if self.events: + for _item in self.events: + if _item: + _items.append(_item.to_dict()) + _dict['events'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "events": [Event.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "href": obj.get("href"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/fabric_service_token.py b/equinix/services/metalv1/models/fabric_service_token.py new file mode 100644 index 00000000..d43d88a8 --- /dev/null +++ b/equinix/services/metalv1/models/fabric_service_token.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class FabricServiceToken(BaseModel): + """ + FabricServiceToken + """ # noqa: E501 + expires_at: Optional[datetime] = Field(default=None, description="The expiration date and time of the Fabric service token. Once a service token is expired, it is no longer redeemable.") + href: Optional[StrictStr] = None + id: Optional[StrictStr] = Field(default=None, description="The UUID that can be used on the Fabric Portal to redeem either an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this UUID will represent an A-Side Service Token, which will allow interconnections to be made from Equinix Metal to other Service Providers on Fabric. For Fabric VCs (Fabric Billed), this UUID will represent a Z-Side Service Token, which will allow interconnections to be made to connect an owned Fabric Port or Virtual Device to Equinix Metal.") + max_allowed_speed: Optional[StrictInt] = Field(default=None, description="The maximum speed that can be selected on the Fabric Portal when configuring a interconnection with either an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this is what the billing is based off of, and can be one of the following options, '50mbps', '200mbps', '500mbps', '1gbps', '2gbps', '5gbps' or '10gbps'. For Fabric VCs (Fabric Billed), this will default to 10Gbps.") + role: Optional[StrictStr] = Field(default=None, description="Either primary or secondary, depending on which interconnection the service token is associated to.") + service_token_type: Optional[StrictStr] = Field(default=None, description="Either 'a_side' or 'z_side', depending on which type of Fabric VC was requested.") + state: Optional[StrictStr] = Field(default=None, description="The state of the service token that corresponds with the service token state on Fabric. An 'inactive' state refers to a token that has not been redeemed yet on the Fabric side, an 'active' state refers to a token that has already been redeemed, and an 'expired' state refers to a token that has reached its expiry time.") + __properties: ClassVar[List[str]] = ["expires_at", "href", "id", "max_allowed_speed", "role", "service_token_type", "state"] + + @field_validator('role') + def role_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['primary', 'secondary']): + raise ValueError("must be one of enum values ('primary', 'secondary')") + return value + + @field_validator('service_token_type') + def service_token_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['a_side', 'z_side']): + raise ValueError("must be one of enum values ('a_side', 'z_side')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['inactive', 'active', 'expired']): + raise ValueError("must be one of enum values ('inactive', 'active', 'expired')") + return value + + 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 FabricServiceToken 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FabricServiceToken from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "expires_at": obj.get("expires_at"), + "href": obj.get("href"), + "id": obj.get("id"), + "max_allowed_speed": obj.get("max_allowed_speed"), + "role": obj.get("role"), + "service_token_type": obj.get("service_token_type"), + "state": obj.get("state") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/facility.py b/equinix/services/metalv1/models/facility.py new file mode 100644 index 00000000..5dbfe124 --- /dev/null +++ b/equinix/services/metalv1/models/facility.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.address import Address +from equinix.services.metalv1.models.device_metro import DeviceMetro +from typing import Optional, Set +from typing_extensions import Self + +class Facility(BaseModel): + """ + Facility + """ # noqa: E501 + address: Optional[Address] = None + code: Optional[StrictStr] = None + features: Optional[List[StrictStr]] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + ip_ranges: Optional[List[StrictStr]] = Field(default=None, description="IP ranges registered in facility. Can be used for GeoIP location") + metro: Optional[DeviceMetro] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "code", "features", "href", "id", "ip_ranges", "metro", "name"] + + @field_validator('features') + def features_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['baremetal', 'backend_transfer', 'layer_2', 'global_ipv4', 'ibx']): + raise ValueError("each list item must be one of ('baremetal', 'backend_transfer', 'layer_2', 'global_ipv4', 'ibx')") + return value + + 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 Facility 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of metro + if self.metro: + _dict['metro'] = self.metro.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Facility from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, + "code": obj.get("code"), + "features": obj.get("features"), + "href": obj.get("href"), + "id": obj.get("id"), + "ip_ranges": obj.get("ip_ranges"), + "metro": DeviceMetro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "name": obj.get("name") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/facility_input.py b/equinix/services/metalv1/models/facility_input.py new file mode 100644 index 00000000..c3134435 --- /dev/null +++ b/equinix/services/metalv1/models/facility_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.facility_input_facility import FacilityInputFacility +from typing import Optional, Set +from typing_extensions import Self + +class FacilityInput(BaseModel): + """ + FacilityInput + """ # noqa: E501 + facility: FacilityInputFacility + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["facility", "href"] + + 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 FacilityInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of facility + if self.facility: + _dict['facility'] = self.facility.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FacilityInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "facility": FacilityInputFacility.from_dict(obj["facility"]) if obj.get("facility") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/facility_input_facility.py b/equinix/services/metalv1/models/facility_input_facility.py new file mode 100644 index 00000000..30f0919b --- /dev/null +++ b/equinix/services/metalv1/models/facility_input_facility.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Metal API + + 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 +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import List, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +FACILITYINPUTFACILITY_ANY_OF_SCHEMAS = ["List[str]", "str"] + +class FacilityInputFacility(BaseModel): + """ + The datacenter where the device should be created. Either metro or facility must be provided. The API will accept either a single facility `{ \"facility\": \"f1\" }`, or it can be instructed to create the device in the best available datacenter `{ \"facility\": \"any\" }`. Additionally it is possible to set a prioritized location selection. For example `{ \"facility\": [\"f3\", \"f2\", \"any\"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. + """ + + # data type: List[str] + anyof_schema_1_validator: Optional[List[StrictStr]] = None + # data type: str + anyof_schema_2_validator: Optional[StrictStr] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[List[str], str]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["List[str]", "str"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = FacilityInputFacility.model_construct() + error_messages = [] + # validate data type: List[str] + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: str + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in FacilityInputFacility with anyOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into List[str] + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into FacilityInputFacility with anyOf schemas: List[str], str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[str], str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/facility_list.py b/equinix/services/metalv1/models/facility_list.py new file mode 100644 index 00000000..0548c6b2 --- /dev/null +++ b/equinix/services/metalv1/models/facility_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.facility import Facility +from typing import Optional, Set +from typing_extensions import Self + +class FacilityList(BaseModel): + """ + FacilityList + """ # noqa: E501 + facilities: Optional[List[Facility]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["facilities", "href"] + + 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 FacilityList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 facilities (list) + _items = [] + if self.facilities: + for _item in self.facilities: + if _item: + _items.append(_item.to_dict()) + _dict['facilities'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FacilityList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "facilities": [Facility.from_dict(_item) for _item in obj["facilities"]] if obj.get("facilities") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/filesystem.py b/equinix/services/metalv1/models/filesystem.py new file mode 100644 index 00000000..6156ed38 --- /dev/null +++ b/equinix/services/metalv1/models/filesystem.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.mount import Mount +from typing import Optional, Set +from typing_extensions import Self + +class Filesystem(BaseModel): + """ + Filesystem + """ # noqa: E501 + href: Optional[StrictStr] = None + mount: Optional[Mount] = None + __properties: ClassVar[List[str]] = ["href", "mount"] + + 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 Filesystem 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of mount + if self.mount: + _dict['mount'] = self.mount.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Filesystem 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"), + "mount": Mount.from_dict(obj["mount"]) if obj.get("mount") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/find_ip_address_by_id200_response.py b/equinix/services/metalv1/models/find_ip_address_by_id200_response.py new file mode 100644 index 00000000..cedde122 --- /dev/null +++ b/equinix/services/metalv1/models/find_ip_address_by_id200_response.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.ip_assignment import IPAssignment +from equinix.services.metalv1.models.ip_reservation import IPReservation +from equinix.services.metalv1.models.vrf_ip_reservation import VrfIpReservation +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +FINDIPADDRESSBYID200RESPONSE_ONE_OF_SCHEMAS = ["IPAssignment", "IPReservation", "VrfIpReservation"] + +class FindIPAddressById200Response(BaseModel): + """ + FindIPAddressById200Response + """ + # data type: IPAssignment + oneof_schema_1_validator: Optional[IPAssignment] = None + # data type: IPReservation + oneof_schema_2_validator: Optional[IPReservation] = None + # data type: VrfIpReservation + oneof_schema_3_validator: Optional[VrfIpReservation] = None + actual_instance: Optional[Union[IPAssignment, IPReservation, VrfIpReservation]] = None + one_of_schemas: List[str] = Field(default=Literal["IPAssignment", "IPReservation", "VrfIpReservation"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = FindIPAddressById200Response.model_construct() + error_messages = [] + match = 0 + # validate data type: IPAssignment + if not isinstance(v, IPAssignment): + error_messages.append(f"Error! Input type `{type(v)}` is not `IPAssignment`") + else: + match += 1 + # validate data type: IPReservation + if not isinstance(v, IPReservation): + error_messages.append(f"Error! Input type `{type(v)}` is not `IPReservation`") + else: + match += 1 + # validate data type: VrfIpReservation + if not isinstance(v, VrfIpReservation): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfIpReservation`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in FindIPAddressById200Response with oneOf schemas: IPAssignment, IPReservation, VrfIpReservation. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in FindIPAddressById200Response with oneOf schemas: IPAssignment, IPReservation, VrfIpReservation. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into IPAssignment + try: + instance.actual_instance = IPAssignment.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into IPReservation + try: + instance.actual_instance = IPReservation.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VrfIpReservation + try: + instance.actual_instance = VrfIpReservation.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into FindIPAddressById200Response with oneOf schemas: IPAssignment, IPReservation, VrfIpReservation. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into FindIPAddressById200Response with oneOf schemas: IPAssignment, IPReservation, VrfIpReservation. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], IPAssignment, IPReservation, VrfIpReservation]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/find_metal_gateway_by_id200_response.py b/equinix/services/metalv1/models/find_metal_gateway_by_id200_response.py new file mode 100644 index 00000000..28072a38 --- /dev/null +++ b/equinix/services/metalv1/models/find_metal_gateway_by_id200_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.metal_gateway import MetalGateway +from equinix.services.metalv1.models.vrf_metal_gateway import VrfMetalGateway +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +FINDMETALGATEWAYBYID200RESPONSE_ONE_OF_SCHEMAS = ["MetalGateway", "VrfMetalGateway"] + +class FindMetalGatewayById200Response(BaseModel): + """ + FindMetalGatewayById200Response + """ + # data type: MetalGateway + oneof_schema_1_validator: Optional[MetalGateway] = None + # data type: VrfMetalGateway + oneof_schema_2_validator: Optional[VrfMetalGateway] = None + actual_instance: Optional[Union[MetalGateway, VrfMetalGateway]] = None + one_of_schemas: List[str] = Field(default=Literal["MetalGateway", "VrfMetalGateway"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = FindMetalGatewayById200Response.model_construct() + error_messages = [] + match = 0 + # validate data type: MetalGateway + if not isinstance(v, MetalGateway): + error_messages.append(f"Error! Input type `{type(v)}` is not `MetalGateway`") + else: + match += 1 + # validate data type: VrfMetalGateway + if not isinstance(v, VrfMetalGateway): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfMetalGateway`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in FindMetalGatewayById200Response with oneOf schemas: MetalGateway, VrfMetalGateway. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in FindMetalGatewayById200Response with oneOf schemas: MetalGateway, VrfMetalGateway. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into MetalGateway + try: + instance.actual_instance = MetalGateway.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VrfMetalGateway + try: + instance.actual_instance = VrfMetalGateway.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into FindMetalGatewayById200Response with oneOf schemas: MetalGateway, VrfMetalGateway. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into FindMetalGatewayById200Response with oneOf schemas: MetalGateway, VrfMetalGateway. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], MetalGateway, VrfMetalGateway]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/find_traffic_timeframe_parameter.py b/equinix/services/metalv1/models/find_traffic_timeframe_parameter.py new file mode 100644 index 00000000..d50b2942 --- /dev/null +++ b/equinix/services/metalv1/models/find_traffic_timeframe_parameter.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +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 FindTrafficTimeframeParameter(BaseModel): + """ + FindTrafficTimeframeParameter + """ # noqa: E501 + ended_at: datetime + href: Optional[StrictStr] = None + started_at: datetime + __properties: ClassVar[List[str]] = ["ended_at", "href", "started_at"] + + 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 FindTrafficTimeframeParameter 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindTrafficTimeframeParameter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ended_at": obj.get("ended_at"), + "href": obj.get("href"), + "started_at": obj.get("started_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/firmware_set.py b/equinix/services/metalv1/models/firmware_set.py new file mode 100644 index 00000000..99457bfa --- /dev/null +++ b/equinix/services/metalv1/models/firmware_set.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.attribute import Attribute +from equinix.services.metalv1.models.component import Component +from typing import Optional, Set +from typing_extensions import Self + +class FirmwareSet(BaseModel): + """ + Represents a Firmware Set + """ # noqa: E501 + attributes: Optional[List[Attribute]] = Field(default=None, description="Represents a list of attributes") + component_firmware: Optional[List[Component]] = Field(default=None, description="List of components versions") + created_at: Optional[datetime] = Field(default=None, description="Datetime when the block was created.") + href: Optional[StrictStr] = None + name: StrictStr = Field(description="Firmware Set Name") + updated_at: Optional[datetime] = Field(default=None, description="Datetime when the block was updated.") + uuid: StrictStr = Field(description="Firmware Set UUID") + __properties: ClassVar[List[str]] = ["attributes", "component_firmware", "created_at", "href", "name", "updated_at", "uuid"] + + 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 FirmwareSet 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "name", + "updated_at", + "uuid", + ]) + + _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 attributes (list) + _items = [] + if self.attributes: + for _item in self.attributes: + if _item: + _items.append(_item.to_dict()) + _dict['attributes'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in component_firmware (list) + _items = [] + if self.component_firmware: + for _item in self.component_firmware: + if _item: + _items.append(_item.to_dict()) + _dict['component_firmware'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FirmwareSet from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attributes": [Attribute.from_dict(_item) for _item in obj["attributes"]] if obj.get("attributes") is not None else None, + "component_firmware": [Component.from_dict(_item) for _item in obj["component_firmware"]] if obj.get("component_firmware") is not None else None, + "created_at": obj.get("created_at"), + "href": obj.get("href"), + "name": obj.get("name"), + "updated_at": obj.get("updated_at"), + "uuid": obj.get("uuid") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/firmware_set_list_response.py b/equinix/services/metalv1/models/firmware_set_list_response.py new file mode 100644 index 00000000..3bd847f8 --- /dev/null +++ b/equinix/services/metalv1/models/firmware_set_list_response.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.firmware_set import FirmwareSet +from typing import Optional, Set +from typing_extensions import Self + +class FirmwareSetListResponse(BaseModel): + """ + Represents collection of Firmware Sets + """ # noqa: E501 + href: Optional[StrictStr] = None + page: Optional[StrictInt] = Field(default=None, description="Page returned") + page_count: Optional[StrictInt] = Field(default=None, description="Items returned in current page") + page_size: Optional[StrictInt] = Field(default=None, description="Max number of items returned in a page") + records: Optional[List[FirmwareSet]] = Field(default=None, description="Represents a list of FirmwareSets") + total_pages: Optional[StrictInt] = Field(default=None, description="Total count of pages") + total_record_count: Optional[StrictInt] = Field(default=None, description="Total count of items") + __properties: ClassVar[List[str]] = ["href", "page", "page_count", "page_size", "records", "total_pages", "total_record_count"] + + 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 FirmwareSetListResponse 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 records (list) + _items = [] + if self.records: + for _item in self.records: + if _item: + _items.append(_item.to_dict()) + _dict['records'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FirmwareSetListResponse 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"), + "page": obj.get("page"), + "page_count": obj.get("page_count"), + "page_size": obj.get("page_size"), + "records": [FirmwareSet.from_dict(_item) for _item in obj["records"]] if obj.get("records") is not None else None, + "total_pages": obj.get("total_pages"), + "total_record_count": obj.get("total_record_count") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/firmware_set_response.py b/equinix/services/metalv1/models/firmware_set_response.py new file mode 100644 index 00000000..3a4d2e9e --- /dev/null +++ b/equinix/services/metalv1/models/firmware_set_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.firmware_set import FirmwareSet +from typing import Optional, Set +from typing_extensions import Self + +class FirmwareSetResponse(BaseModel): + """ + Represents single Firmware set response + """ # noqa: E501 + href: Optional[StrictStr] = None + record: Optional[FirmwareSet] = None + __properties: ClassVar[List[str]] = ["href", "record"] + + 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 FirmwareSetResponse 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of record + if self.record: + _dict['record'] = self.record.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FirmwareSetResponse 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"), + "record": FirmwareSet.from_dict(obj["record"]) if obj.get("record") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/global_bgp_range.py b/equinix/services/metalv1/models/global_bgp_range.py new file mode 100644 index 00000000..92c70548 --- /dev/null +++ b/equinix/services/metalv1/models/global_bgp_range.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class GlobalBgpRange(BaseModel): + """ + GlobalBgpRange + """ # noqa: E501 + address_family: Optional[StrictInt] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + project: Optional[Href] = None + range: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address_family", "href", "id", "project", "range"] + + 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 GlobalBgpRange 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GlobalBgpRange from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address_family": obj.get("address_family"), + "href": obj.get("href"), + "id": obj.get("id"), + "project": Href.from_dict(obj["project"]) if obj.get("project") is not None else None, + "range": obj.get("range") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/global_bgp_range_list.py b/equinix/services/metalv1/models/global_bgp_range_list.py new file mode 100644 index 00000000..b5908465 --- /dev/null +++ b/equinix/services/metalv1/models/global_bgp_range_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.global_bgp_range import GlobalBgpRange +from typing import Optional, Set +from typing_extensions import Self + +class GlobalBgpRangeList(BaseModel): + """ + GlobalBgpRangeList + """ # noqa: E501 + global_bgp_ranges: Optional[List[GlobalBgpRange]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["global_bgp_ranges", "href"] + + 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 GlobalBgpRangeList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 global_bgp_ranges (list) + _items = [] + if self.global_bgp_ranges: + for _item in self.global_bgp_ranges: + if _item: + _items.append(_item.to_dict()) + _dict['global_bgp_ranges'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GlobalBgpRangeList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "global_bgp_ranges": [GlobalBgpRange.from_dict(_item) for _item in obj["global_bgp_ranges"]] if obj.get("global_bgp_ranges") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/hardware_reservation.py b/equinix/services/metalv1/models/hardware_reservation.py new file mode 100644 index 00000000..f5050066 --- /dev/null +++ b/equinix/services/metalv1/models/hardware_reservation.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.facility import Facility +from equinix.services.metalv1.models.plan import Plan +from equinix.services.metalv1.models.project import Project +from typing import Optional, Set +from typing_extensions import Self + +class HardwareReservation(BaseModel): + """ + HardwareReservation + """ # noqa: E501 + created_at: Optional[datetime] = None + custom_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Amount that will be charged for every billing_cycle.") + device: Optional[Device] = None + facility: Optional[Facility] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + need_of_service: Optional[StrictBool] = Field(default=None, description="Whether this Device requires assistance from Equinix Metal.") + plan: Optional[Plan] = None + project: Optional[Project] = None + provisionable: Optional[StrictBool] = Field(default=None, description="Whether the reserved server is provisionable or not. Spare devices can't be provisioned unless they are activated first.") + short_id: Optional[StrictStr] = Field(default=None, description="Short version of the ID.") + spare: Optional[StrictBool] = Field(default=None, description="Whether the Hardware Reservation is a spare. Spare Hardware Reservations are used when a Hardware Reservations requires service from Equinix Metal") + switch_uuid: Optional[StrictStr] = Field(default=None, description="Switch short id. This can be used to determine if two devices are connected to the same switch, for example.") + termination_time: Optional[datetime] = Field(default=None, description="Expiration date for the reservation.") + __properties: ClassVar[List[str]] = ["created_at", "custom_rate", "device", "facility", "href", "id", "need_of_service", "plan", "project", "provisionable", "short_id", "spare", "switch_uuid", "termination_time"] + + 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 HardwareReservation 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of device + if self.device: + _dict['device'] = self.device.to_dict() + # override the default output from pydantic by calling `to_dict()` of facility + if self.facility: + _dict['facility'] = self.facility.to_dict() + # override the default output from pydantic by calling `to_dict()` of plan + if self.plan: + _dict['plan'] = self.plan.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HardwareReservation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "custom_rate": obj.get("custom_rate"), + "device": Device.from_dict(obj["device"]) if obj.get("device") is not None else None, + "facility": Facility.from_dict(obj["facility"]) if obj.get("facility") is not None else None, + "href": obj.get("href"), + "id": obj.get("id"), + "need_of_service": obj.get("need_of_service"), + "plan": Plan.from_dict(obj["plan"]) if obj.get("plan") is not None else None, + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, + "provisionable": obj.get("provisionable"), + "short_id": obj.get("short_id"), + "spare": obj.get("spare"), + "switch_uuid": obj.get("switch_uuid"), + "termination_time": obj.get("termination_time") + }) + return _obj + +from equinix.services.metalv1.models.device import Device +# TODO: Rewrite to not use raise_errors +HardwareReservation.model_rebuild(raise_errors=False) + diff --git a/equinix/services/metalv1/models/hardware_reservation_list.py b/equinix/services/metalv1/models/hardware_reservation_list.py new file mode 100644 index 00000000..9007c32a --- /dev/null +++ b/equinix/services/metalv1/models/hardware_reservation_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.hardware_reservation import HardwareReservation +from equinix.services.metalv1.models.meta import Meta +from typing import Optional, Set +from typing_extensions import Self + +class HardwareReservationList(BaseModel): + """ + HardwareReservationList + """ # noqa: E501 + hardware_reservations: Optional[List[HardwareReservation]] = None + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + __properties: ClassVar[List[str]] = ["hardware_reservations", "href", "meta"] + + 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 HardwareReservationList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 hardware_reservations (list) + _items = [] + if self.hardware_reservations: + for _item in self.hardware_reservations: + if _item: + _items.append(_item.to_dict()) + _dict['hardware_reservations'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HardwareReservationList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hardware_reservations": [HardwareReservation.from_dict(_item) for _item in obj["hardware_reservations"]] if obj.get("hardware_reservations") is not None else None, + "href": obj.get("href"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/href.py b/equinix/services/metalv1/models/href.py new file mode 100644 index 00000000..978d6d60 --- /dev/null +++ b/equinix/services/metalv1/models/href.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Metal API + + 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 +from typing import Optional, Set +from typing_extensions import Self + +class Href(BaseModel): + """ + Href + """ # noqa: E501 + href: StrictStr + __properties: ClassVar[List[str]] = ["href"] + + 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 Href 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Href 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") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/instances_batch_create_input.py b/equinix/services/metalv1/models/instances_batch_create_input.py new file mode 100644 index 00000000..0fadd80e --- /dev/null +++ b/equinix/services/metalv1/models/instances_batch_create_input.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.instances_batch_create_input_batches_inner import InstancesBatchCreateInputBatchesInner +from typing import Optional, Set +from typing_extensions import Self + +class InstancesBatchCreateInput(BaseModel): + """ + InstancesBatchCreateInput + """ # noqa: E501 + batches: Optional[List[InstancesBatchCreateInputBatchesInner]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["batches", "href"] + + 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 InstancesBatchCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 batches (list) + _items = [] + if self.batches: + for _item in self.batches: + if _item: + _items.append(_item.to_dict()) + _dict['batches'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstancesBatchCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "batches": [InstancesBatchCreateInputBatchesInner.from_dict(_item) for _item in obj["batches"]] if obj.get("batches") is not None else None, + "href": obj.get("href") + }) + return _obj + + 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 new file mode 100644 index 00000000..76d78a81 --- /dev/null +++ b/equinix/services/metalv1/models/instances_batch_create_input_batches_inner.py @@ -0,0 +1,179 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.facility_input_facility import FacilityInputFacility +from equinix.services.metalv1.models.ip_address import IPAddress +from equinix.services.metalv1.models.ssh_key_input import SSHKeyInput +from equinix.services.metalv1.models.storage import Storage +from typing import Optional, Set +from typing_extensions import Self + +class InstancesBatchCreateInputBatchesInner(BaseModel): + """ + InstancesBatchCreateInputBatchesInner + """ # noqa: E501 + hostnames: Optional[List[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.") + customdata: Optional[Dict[str, Any]] = Field(default=None, description="Customdata is an arbitrary JSON value that can be accessed via the metadata service.") + description: Optional[StrictStr] = Field(default=None, description="Any description of the device or how it will be used. This may be used to inform other API consumers with project access.") + features: Optional[List[StrictStr]] = Field(default=None, description="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.") + hardware_reservation_id: Optional[StrictStr] = Field(default=None, description="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.") + hostname: Optional[StrictStr] = Field(default=None, description="The hostname to use within the operating system. The same hostname may be used on multiple devices within a project.") + ip_addresses: Optional[List[IPAddress]] = Field(default=None, description="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.") + ipxe_script_url: Optional[StrictStr] = Field(default=None, description="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.") + locked: Optional[StrictBool] = Field(default=False, description="Whether the device should be locked, preventing accidental deletion.") + network_frozen: Optional[StrictBool] = Field(default=None, description="If true, this instance can not be converted to a different network type.") + no_ssh_keys: Optional[StrictBool] = Field(default=False, description="Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified") + operating_system: StrictStr = Field(description="The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans.") + plan: StrictStr = Field(description="The slug of the device plan to provision.") + private_ipv4_subnet_size: Optional[StrictInt] = Field(default=None, description="Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device.") + project_ssh_keys: Optional[List[StrictStr]] = Field(default=None, description="A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. ") + public_ipv4_subnet_size: Optional[StrictInt] = Field(default=None, description="Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request.") + spot_instance: Optional[StrictBool] = Field(default=None, description="Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field.") + spot_price_max: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The maximum amount to bid for a spot instance.") + ssh_keys: Optional[List[SSHKeyInput]] = Field(default=None, description="A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. ") + storage: Optional[Storage] = None + tags: Optional[List[StrictStr]] = None + termination_time: Optional[datetime] = Field(default=None, description="When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. ") + user_ssh_keys: Optional[List[StrictStr]] = Field(default=None, description="A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. ") + 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 + __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): + """Validates the enum""" + if value is None: + return value + + if value not in set(['hourly', 'daily', 'monthly', 'yearly']): + raise ValueError("must be one of enum values ('hourly', 'daily', 'monthly', 'yearly')") + return value + + 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 InstancesBatchCreateInputBatchesInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 ip_addresses (list) + _items = [] + if self.ip_addresses: + for _item in self.ip_addresses: + if _item: + _items.append(_item.to_dict()) + _dict['ip_addresses'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ssh_keys (list) + _items = [] + if self.ssh_keys: + for _item in self.ssh_keys: + if _item: + _items.append(_item.to_dict()) + _dict['ssh_keys'] = _items + # override the default output from pydantic by calling `to_dict()` of storage + if self.storage: + _dict['storage'] = self.storage.to_dict() + # override the default output from pydantic by calling `to_dict()` of facility + if self.facility: + _dict['facility'] = self.facility.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstancesBatchCreateInputBatchesInner 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"), + "quantity": obj.get("quantity"), + "href": obj.get("href"), + "metro": obj.get("metro"), + "always_pxe": obj.get("always_pxe"), + "billing_cycle": obj.get("billing_cycle"), + "customdata": obj.get("customdata"), + "description": obj.get("description"), + "features": obj.get("features"), + "hardware_reservation_id": obj.get("hardware_reservation_id"), + "hostname": obj.get("hostname"), + "ip_addresses": [IPAddress.from_dict(_item) for _item in obj["ip_addresses"]] if obj.get("ip_addresses") is not None else None, + "ipxe_script_url": obj.get("ipxe_script_url"), + "locked": obj.get("locked") if obj.get("locked") is not None else False, + "network_frozen": obj.get("network_frozen"), + "no_ssh_keys": obj.get("no_ssh_keys") if obj.get("no_ssh_keys") is not None else False, + "operating_system": obj.get("operating_system"), + "plan": obj.get("plan"), + "private_ipv4_subnet_size": obj.get("private_ipv4_subnet_size"), + "project_ssh_keys": obj.get("project_ssh_keys"), + "public_ipv4_subnet_size": obj.get("public_ipv4_subnet_size"), + "spot_instance": obj.get("spot_instance"), + "spot_price_max": obj.get("spot_price_max"), + "ssh_keys": [SSHKeyInput.from_dict(_item) for _item in obj["ssh_keys"]] if obj.get("ssh_keys") is not None else None, + "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None, + "tags": obj.get("tags"), + "termination_time": obj.get("termination_time"), + "user_ssh_keys": obj.get("user_ssh_keys"), + "userdata": obj.get("userdata"), + "facility": FacilityInputFacility.from_dict(obj["facility"]) if obj.get("facility") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/interconnection.py b/equinix/services/metalv1/models/interconnection.py new file mode 100644 index 00000000..ff7e0ff2 --- /dev/null +++ b/equinix/services/metalv1/models/interconnection.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.fabric_service_token import FabricServiceToken +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_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 +from typing_extensions import Self + +class Interconnection(BaseModel): + """ + Interconnection + """ # noqa: E501 + authorization_code: Optional[StrictStr] = Field(default=None, description="For Fabric VCs (Metal Billed), this allows Fabric to connect the Metal network to any connection Fabric facilitates. Fabric uses this token to be able to give more detailed information about the Metal end of the network, when viewing resources from within Fabric.") + contact_email: Optional[StrictStr] = None + created_at: Optional[datetime] = None + description: Optional[StrictStr] = None + fabric_provider: Optional[InterconnectionFabricProvider] = None + facility: Optional[Facility] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = 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 + ports: Optional[List[InterconnectionPort]] = Field(default=None, description="For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the Dedicated Port(s).") + project: Optional[Project] = None + redundancy: Optional[StrictStr] = Field(default=None, description="Either 'primary', meaning a single interconnection, or 'redundant', meaning a redundant interconnection.") + requested_by: Optional[Href] = None + service_tokens: Optional[List[FabricServiceToken]] = Field(default=None, description="For Fabric VCs (Metal Billed), this will show details of the A-Side service tokens issued for the interconnection. For Fabric VCs (Fabric Billed), this will show the details of the Z-Side service tokens issued for the interconnection. Dedicated interconnections will not have any service tokens issued. There will be one per interconnection, so for redundant interconnections, there should be two service tokens issued.") + speed: Optional[StrictInt] = Field(default=None, description="For interconnections on Dedicated Ports and shared connections, this represents the interconnection's speed in bps. For Fabric VCs, this field refers to the maximum speed of the interconnection in bps. This value will default to 10Gbps for Fabric VCs (Fabric Billed).") + status: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + token: Optional[StrictStr] = Field(default=None, description="This token is used for shared interconnections to be used as the Fabric Token. This field is entirely deprecated.") + type: Optional[StrictStr] = Field(default=None, description="The 'shared' type of interconnection refers to shared connections, or later also known as Fabric Virtual Connections (or Fabric VCs). The 'dedicated' type of interconnection refers to interconnections created with Dedicated Ports. The 'shared_port_vlan' type of interconnection refers to shared connections created without service tokens. The 'shared_port_vlan_to_csp' type of interconnection refers to connections created directly to a supported cloud service provider.") + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["authorization_code", "contact_email", "created_at", "description", "fabric_provider", "facility", "href", "id", "metro", "mode", "name", "organization", "ports", "project", "redundancy", "requested_by", "service_tokens", "speed", "status", "tags", "token", "type", "updated_at"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['standard', 'tunnel']): + raise ValueError("must be one of enum values ('standard', 'tunnel')") + return value + + @field_validator('redundancy') + def redundancy_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['primary', 'redundant']): + raise ValueError("must be one of enum values ('primary', 'redundant')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['shared', 'dedicated', 'shared_port_vlan', 'shared_port_vlan_to_csp']): + raise ValueError("must be one of enum values ('shared', 'dedicated', 'shared_port_vlan', 'shared_port_vlan_to_csp')") + return value + + 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 Interconnection 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of fabric_provider + if self.fabric_provider: + _dict['fabric_provider'] = self.fabric_provider.to_dict() + # override the default output from pydantic by calling `to_dict()` of facility + if self.facility: + _dict['facility'] = self.facility.to_dict() + # override the default output from pydantic by calling `to_dict()` of metro + if self.metro: + _dict['metro'] = self.metro.to_dict() + # override the default output from pydantic by calling `to_dict()` of organization + if self.organization: + _dict['organization'] = self.organization.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in ports (list) + _items = [] + if self.ports: + for _item in self.ports: + if _item: + _items.append(_item.to_dict()) + _dict['ports'] = _items + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of requested_by + if self.requested_by: + _dict['requested_by'] = self.requested_by.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in service_tokens (list) + _items = [] + if self.service_tokens: + for _item in self.service_tokens: + if _item: + _items.append(_item.to_dict()) + _dict['service_tokens'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Interconnection from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "authorization_code": obj.get("authorization_code"), + "contact_email": obj.get("contact_email"), + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "fabric_provider": InterconnectionFabricProvider.from_dict(obj["fabric_provider"]) if obj.get("fabric_provider") is not None else None, + "facility": Facility.from_dict(obj["facility"]) if obj.get("facility") is not None else None, + "href": obj.get("href"), + "id": obj.get("id"), + "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, + "ports": [InterconnectionPort.from_dict(_item) for _item in obj["ports"]] if obj.get("ports") is not None else None, + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, + "redundancy": obj.get("redundancy"), + "requested_by": Href.from_dict(obj["requested_by"]) if obj.get("requested_by") is not None else None, + "service_tokens": [FabricServiceToken.from_dict(_item) for _item in obj["service_tokens"]] if obj.get("service_tokens") is not None else None, + "speed": obj.get("speed"), + "status": obj.get("status"), + "tags": obj.get("tags"), + "token": obj.get("token"), + "type": obj.get("type"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/interconnection_fabric_provider.py b/equinix/services/metalv1/models/interconnection_fabric_provider.py new file mode 100644 index 00000000..c59fd233 --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_fabric_provider.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.aws_fabric_provider import AWSFabricProvider +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +INTERCONNECTIONFABRICPROVIDER_ONE_OF_SCHEMAS = ["AWSFabricProvider"] + +class InterconnectionFabricProvider(BaseModel): + """ + Configuration information for connecting to external cloud service provider. Only available if the fabric_provider param was used when creating the interconnection. + """ + # data type: AWSFabricProvider + oneof_schema_1_validator: Optional[AWSFabricProvider] = None + actual_instance: Optional[Union[AWSFabricProvider]] = None + one_of_schemas: List[str] = Field(default=Literal["AWSFabricProvider"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = InterconnectionFabricProvider.model_construct() + error_messages = [] + match = 0 + # validate data type: AWSFabricProvider + if not isinstance(v, AWSFabricProvider): + error_messages.append(f"Error! Input type `{type(v)}` is not `AWSFabricProvider`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in InterconnectionFabricProvider with oneOf schemas: AWSFabricProvider. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in InterconnectionFabricProvider with oneOf schemas: AWSFabricProvider. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into AWSFabricProvider + try: + instance.actual_instance = AWSFabricProvider.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into InterconnectionFabricProvider with oneOf schemas: AWSFabricProvider. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into InterconnectionFabricProvider with oneOf schemas: AWSFabricProvider. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AWSFabricProvider]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/interconnection_list.py b/equinix/services/metalv1/models/interconnection_list.py new file mode 100644 index 00000000..4fa0da36 --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.interconnection import Interconnection +from equinix.services.metalv1.models.meta import Meta +from typing import Optional, Set +from typing_extensions import Self + +class InterconnectionList(BaseModel): + """ + InterconnectionList + """ # noqa: E501 + href: Optional[StrictStr] = None + interconnections: Optional[List[Interconnection]] = None + meta: Optional[Meta] = None + __properties: ClassVar[List[str]] = ["href", "interconnections", "meta"] + + 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 InterconnectionList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 interconnections (list) + _items = [] + if self.interconnections: + for _item in self.interconnections: + if _item: + _items.append(_item.to_dict()) + _dict['interconnections'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InterconnectionList 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"), + "interconnections": [Interconnection.from_dict(_item) for _item in obj["interconnections"]] if obj.get("interconnections") is not None else None, + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/interconnection_metro_list.py b/equinix/services/metalv1/models/interconnection_metro_list.py new file mode 100644 index 00000000..e45811dc --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_metro_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.interconnection_metro_list_metros_inner import InterconnectionMetroListMetrosInner +from equinix.services.metalv1.models.meta import Meta +from typing import Optional, Set +from typing_extensions import Self + +class InterconnectionMetroList(BaseModel): + """ + InterconnectionMetroList + """ # noqa: E501 + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + metros: Optional[List[InterconnectionMetroListMetrosInner]] = None + __properties: ClassVar[List[str]] = ["href", "meta", "metros"] + + 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 InterconnectionMetroList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in metros (list) + _items = [] + if self.metros: + for _item in self.metros: + if _item: + _items.append(_item.to_dict()) + _dict['metros'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InterconnectionMetroList 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"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "metros": [InterconnectionMetroListMetrosInner.from_dict(_item) for _item in obj["metros"]] if obj.get("metros") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/interconnection_metro_list_metros_inner.py b/equinix/services/metalv1/models/interconnection_metro_list_metros_inner.py new file mode 100644 index 00000000..f033c99d --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_metro_list_metros_inner.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Metal API + + 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 InterconnectionMetroListMetrosInner(BaseModel): + """ + InterconnectionMetroListMetrosInner + """ # noqa: E501 + code: Optional[StrictStr] = None + country: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: 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.") + __properties: ClassVar[List[str]] = ["code", "country", "href", "id", "name", "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 InterconnectionMetroListMetrosInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InterconnectionMetroListMetrosInner 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"), + "providers": [InterconnectionMetroListMetrosInnerAllOfProvidersInner.from_dict(_item) for _item in obj["providers"]] if obj.get("providers") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/interconnection_metro_list_metros_inner_all_of_providers_inner.py b/equinix/services/metalv1/models/interconnection_metro_list_metros_inner_all_of_providers_inner.py new file mode 100644 index 00000000..40060f85 --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_metro_list_metros_inner_all_of_providers_inner.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class InterconnectionMetroListMetrosInnerAllOfProvidersInner(BaseModel): + """ + InterconnectionMetroListMetrosInnerAllOfProvidersInner + """ # noqa: E501 + bandwidths: Optional[List[StrictInt]] = None + features: Optional[List[StrictStr]] = None + href: Optional[StrictStr] = None + locations: Optional[List[StrictStr]] = None + name: Optional[StrictStr] = None + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["bandwidths", "features", "href", "locations", "name", "type"] + + 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 InterconnectionMetroListMetrosInnerAllOfProvidersInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InterconnectionMetroListMetrosInnerAllOfProvidersInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bandwidths": obj.get("bandwidths"), + "features": obj.get("features"), + "href": obj.get("href"), + "locations": obj.get("locations"), + "name": obj.get("name"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/interconnection_port.py b/equinix/services/metalv1/models/interconnection_port.py new file mode 100644 index 00000000..7b9192db --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_port.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class InterconnectionPort(BaseModel): + """ + InterconnectionPort + """ # noqa: E501 + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + link_status: Optional[StrictStr] = None + name: Optional[StrictStr] = None + organization: Optional[Href] = None + role: Optional[StrictStr] = Field(default=None, description="Either 'primary' or 'secondary'.") + speed: Optional[StrictInt] = None + status: Optional[StrictStr] = Field(default=None, description="For both Fabric VCs and Dedicated Ports, this will be 'requested' on creation and 'deleting' on deletion. Once the Fabric VC has found its corresponding Fabric connection, this will turn to 'active'. For Dedicated Ports, once the dedicated port is associated, this will also turn to 'active'. For Fabric VCs, this can turn into an 'expired' state if the service token associated is expired.") + switch_id: Optional[StrictStr] = Field(default=None, description="A switch 'short ID'") + virtual_circuits: Optional[List[VirtualCircuit]] = None + __properties: ClassVar[List[str]] = ["href", "id", "link_status", "name", "organization", "role", "speed", "status", "switch_id", "virtual_circuits"] + + @field_validator('role') + def role_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['primary', 'secondary']): + raise ValueError("must be one of enum values ('primary', 'secondary')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['requested', 'active', 'deleting', 'expired', 'delete_failed']): + raise ValueError("must be one of enum values ('requested', 'active', 'deleting', 'expired', 'delete_failed')") + return value + + 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 InterconnectionPort 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of organization + if self.organization: + _dict['organization'] = self.organization.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in virtual_circuits (list) + _items = [] + if self.virtual_circuits: + for _item in self.virtual_circuits: + if _item: + _items.append(_item.to_dict()) + _dict['virtual_circuits'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InterconnectionPort 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"), + "id": obj.get("id"), + "link_status": obj.get("link_status"), + "name": obj.get("name"), + "organization": Href.from_dict(obj["organization"]) if obj.get("organization") is not None else None, + "role": obj.get("role"), + "speed": obj.get("speed"), + "status": obj.get("status"), + "switch_id": obj.get("switch_id"), + "virtual_circuits": [VirtualCircuit.from_dict(_item) for _item in obj["virtual_circuits"]] if obj.get("virtual_circuits") is not None else None + }) + return _obj + +from equinix.services.metalv1.models.virtual_circuit import VirtualCircuit +# TODO: Rewrite to not use raise_errors +InterconnectionPort.model_rebuild(raise_errors=False) + diff --git a/equinix/services/metalv1/models/interconnection_port_list.py b/equinix/services/metalv1/models/interconnection_port_list.py new file mode 100644 index 00000000..6041fd23 --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_port_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.interconnection_port import InterconnectionPort +from typing import Optional, Set +from typing_extensions import Self + +class InterconnectionPortList(BaseModel): + """ + InterconnectionPortList + """ # noqa: E501 + href: Optional[StrictStr] = None + ports: Optional[List[InterconnectionPort]] = None + __properties: ClassVar[List[str]] = ["href", "ports"] + + 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 InterconnectionPortList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 ports (list) + _items = [] + if self.ports: + for _item in self.ports: + if _item: + _items.append(_item.to_dict()) + _dict['ports'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InterconnectionPortList 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"), + "ports": [InterconnectionPort.from_dict(_item) for _item in obj["ports"]] if obj.get("ports") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/interconnection_pricing_list.py b/equinix/services/metalv1/models/interconnection_pricing_list.py new file mode 100644 index 00000000..79bc26e8 --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_pricing_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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_pricing_list_provider_pricing_inner import InterconnectionPricingListProviderPricingInner +from typing import Optional, Set +from typing_extensions import Self + +class InterconnectionPricingList(BaseModel): + """ + InterconnectionPricingList + """ # noqa: E501 + href: Optional[StrictStr] = None + provider_pricing: Optional[List[InterconnectionPricingListProviderPricingInner]] = Field(default=None, description="Pricing information per connection provider.") + __properties: ClassVar[List[str]] = ["href", "provider_pricing"] + + 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 InterconnectionPricingList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 provider_pricing (list) + _items = [] + if self.provider_pricing: + for _item in self.provider_pricing: + if _item: + _items.append(_item.to_dict()) + _dict['provider_pricing'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InterconnectionPricingList 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"), + "provider_pricing": [InterconnectionPricingListProviderPricingInner.from_dict(_item) for _item in obj["provider_pricing"]] if obj.get("provider_pricing") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/interconnection_pricing_list_provider_pricing_inner.py b/equinix/services/metalv1/models/interconnection_pricing_list_provider_pricing_inner.py new file mode 100644 index 00000000..517a1b1a --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_pricing_list_provider_pricing_inner.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.interconnection_pricing_list_provider_pricing_inner_tiers_inner import InterconnectionPricingListProviderPricingInnerTiersInner +from typing import Optional, Set +from typing_extensions import Self + +class InterconnectionPricingListProviderPricingInner(BaseModel): + """ + InterconnectionPricingListProviderPricingInner + """ # noqa: E501 + href: Optional[StrictStr] = None + provider: Optional[StrictStr] = None + tiers: Optional[List[InterconnectionPricingListProviderPricingInnerTiersInner]] = None + __properties: ClassVar[List[str]] = ["href", "provider", "tiers"] + + 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 InterconnectionPricingListProviderPricingInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 tiers (list) + _items = [] + if self.tiers: + for _item in self.tiers: + if _item: + _items.append(_item.to_dict()) + _dict['tiers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InterconnectionPricingListProviderPricingInner 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"), + "provider": obj.get("provider"), + "tiers": [InterconnectionPricingListProviderPricingInnerTiersInner.from_dict(_item) for _item in obj["tiers"]] if obj.get("tiers") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/interconnection_pricing_list_provider_pricing_inner_tiers_inner.py b/equinix/services/metalv1/models/interconnection_pricing_list_provider_pricing_inner_tiers_inner.py new file mode 100644 index 00000000..0da01b28 --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_pricing_list_provider_pricing_inner_tiers_inner.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class InterconnectionPricingListProviderPricingInnerTiersInner(BaseModel): + """ + InterconnectionPricingListProviderPricingInnerTiersInner + """ # noqa: E501 + bandwidth: Optional[StrictInt] = Field(default=None, description="Bandwidth tier in Mbps") + billing_cycle: Optional[StrictStr] = None + href: Optional[StrictStr] = None + price: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["bandwidth", "billing_cycle", "href", "price"] + + 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 InterconnectionPricingListProviderPricingInnerTiersInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InterconnectionPricingListProviderPricingInnerTiersInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bandwidth": obj.get("bandwidth"), + "billing_cycle": obj.get("billing_cycle"), + "href": obj.get("href"), + "price": obj.get("price") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/interconnection_update_input.py b/equinix/services/metalv1/models/interconnection_update_input.py new file mode 100644 index 00000000..4afae6c4 --- /dev/null +++ b/equinix/services/metalv1/models/interconnection_update_input.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class InterconnectionUpdateInput(BaseModel): + """ + InterconnectionUpdateInput + """ # noqa: E501 + contact_email: Optional[StrictStr] = None + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + 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 + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["contact_email", "description", "href", "mode", "name", "tags"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['standard', 'tunnel']): + raise ValueError("must be one of enum values ('standard', 'tunnel')") + return value + + 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 InterconnectionUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InterconnectionUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "contact_email": obj.get("contact_email"), + "description": obj.get("description"), + "href": obj.get("href"), + "mode": obj.get("mode"), + "name": obj.get("name"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/invitation.py b/equinix/services/metalv1/models/invitation.py new file mode 100644 index 00000000..519b6644 --- /dev/null +++ b/equinix/services/metalv1/models/invitation.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class Invitation(BaseModel): + """ + Invitation + """ # noqa: E501 + created_at: Optional[datetime] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + invitation: Optional[Href] = None + invited_by: Optional[Href] = None + invitee: Optional[StrictStr] = None + nonce: Optional[StrictStr] = None + organization: Optional[Href] = None + projects: Optional[List[Href]] = None + roles: Optional[List[StrictStr]] = None + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["created_at", "href", "id", "invitation", "invited_by", "invitee", "nonce", "organization", "projects", "roles", "updated_at"] + + @field_validator('roles') + def roles_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['admin', 'billing', 'collaborator', 'limited_collaborator']): + raise ValueError("each list item must be one of ('admin', 'billing', 'collaborator', 'limited_collaborator')") + return value + + 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 Invitation 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of invitation + if self.invitation: + _dict['invitation'] = self.invitation.to_dict() + # override the default output from pydantic by calling `to_dict()` of invited_by + if self.invited_by: + _dict['invited_by'] = self.invited_by.to_dict() + # override the default output from pydantic by calling `to_dict()` of organization + if self.organization: + _dict['organization'] = self.organization.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in projects (list) + _items = [] + if self.projects: + for _item in self.projects: + if _item: + _items.append(_item.to_dict()) + _dict['projects'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Invitation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "href": obj.get("href"), + "id": obj.get("id"), + "invitation": Href.from_dict(obj["invitation"]) if obj.get("invitation") is not None else None, + "invited_by": Href.from_dict(obj["invited_by"]) if obj.get("invited_by") is not None else None, + "invitee": obj.get("invitee"), + "nonce": obj.get("nonce"), + "organization": Href.from_dict(obj["organization"]) if obj.get("organization") is not None else None, + "projects": [Href.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None, + "roles": obj.get("roles"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/invitation_input.py b/equinix/services/metalv1/models/invitation_input.py new file mode 100644 index 00000000..687f81a1 --- /dev/null +++ b/equinix/services/metalv1/models/invitation_input.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class InvitationInput(BaseModel): + """ + InvitationInput + """ # noqa: E501 + href: Optional[StrictStr] = None + invitee: StrictStr + message: Optional[StrictStr] = None + organization_id: Optional[StrictStr] = None + projects_ids: Optional[List[StrictStr]] = None + roles: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["href", "invitee", "message", "organization_id", "projects_ids", "roles"] + + @field_validator('roles') + def roles_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['admin', 'billing', 'collaborator', 'limited_collaborator']): + raise ValueError("each list item must be one of ('admin', 'billing', 'collaborator', 'limited_collaborator')") + return value + + 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 InvitationInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InvitationInput 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"), + "invitee": obj.get("invitee"), + "message": obj.get("message"), + "organization_id": obj.get("organization_id"), + "projects_ids": obj.get("projects_ids"), + "roles": obj.get("roles") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/invitation_list.py b/equinix/services/metalv1/models/invitation_list.py new file mode 100644 index 00000000..09e605ae --- /dev/null +++ b/equinix/services/metalv1/models/invitation_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.membership import Membership +from typing import Optional, Set +from typing_extensions import Self + +class InvitationList(BaseModel): + """ + InvitationList + """ # noqa: E501 + href: Optional[StrictStr] = None + invitations: Optional[List[Membership]] = None + __properties: ClassVar[List[str]] = ["href", "invitations"] + + 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 InvitationList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 invitations (list) + _items = [] + if self.invitations: + for _item in self.invitations: + if _item: + _items.append(_item.to_dict()) + _dict['invitations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InvitationList 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"), + "invitations": [Membership.from_dict(_item) for _item in obj["invitations"]] if obj.get("invitations") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/invoice.py b/equinix/services/metalv1/models/invoice.py new file mode 100644 index 00000000..2af777bf --- /dev/null +++ b/equinix/services/metalv1/models/invoice.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import date +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.line_item import LineItem +from equinix.services.metalv1.models.project_id_name import ProjectIdName +from typing import Optional, Set +from typing_extensions import Self + +class Invoice(BaseModel): + """ + Invoice + """ # noqa: E501 + amount: Optional[Union[StrictFloat, StrictInt]] = None + balance: Optional[Union[StrictFloat, StrictInt]] = None + created_on: Optional[date] = None + credit_amount: Optional[Union[StrictFloat, StrictInt]] = None + credits_applied: Optional[Union[StrictFloat, StrictInt]] = None + currency: Optional[StrictStr] = None + due_on: Optional[date] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + items: Optional[List[LineItem]] = None + number: Optional[StrictStr] = None + project: Optional[ProjectIdName] = None + reference_number: Optional[StrictStr] = None + status: Optional[StrictStr] = None + target_date: Optional[date] = None + __properties: ClassVar[List[str]] = ["amount", "balance", "created_on", "credit_amount", "credits_applied", "currency", "due_on", "href", "id", "items", "number", "project", "reference_number", "status", "target_date"] + + 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 Invoice 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict['items'] = _items + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Invoice from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "amount": obj.get("amount"), + "balance": obj.get("balance"), + "created_on": obj.get("created_on"), + "credit_amount": obj.get("credit_amount"), + "credits_applied": obj.get("credits_applied"), + "currency": obj.get("currency"), + "due_on": obj.get("due_on"), + "href": obj.get("href"), + "id": obj.get("id"), + "items": [LineItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "number": obj.get("number"), + "project": ProjectIdName.from_dict(obj["project"]) if obj.get("project") is not None else None, + "reference_number": obj.get("reference_number"), + "status": obj.get("status"), + "target_date": obj.get("target_date") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/invoice_list.py b/equinix/services/metalv1/models/invoice_list.py new file mode 100644 index 00000000..d8415497 --- /dev/null +++ b/equinix/services/metalv1/models/invoice_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.invoice import Invoice +from typing import Optional, Set +from typing_extensions import Self + +class InvoiceList(BaseModel): + """ + InvoiceList + """ # noqa: E501 + href: Optional[StrictStr] = None + invoices: Optional[List[Invoice]] = None + __properties: ClassVar[List[str]] = ["href", "invoices"] + + 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 InvoiceList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 invoices (list) + _items = [] + if self.invoices: + for _item in self.invoices: + if _item: + _items.append(_item.to_dict()) + _dict['invoices'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InvoiceList 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"), + "invoices": [Invoice.from_dict(_item) for _item in obj["invoices"]] if obj.get("invoices") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_address.py b/equinix/services/metalv1/models/ip_address.py new file mode 100644 index 00000000..26bfa220 --- /dev/null +++ b/equinix/services/metalv1/models/ip_address.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class IPAddress(BaseModel): + """ + IPAddress + """ # noqa: E501 + address_family: Optional[StrictInt] = Field(default=None, description="Address Family for IP Address") + cidr: Optional[StrictInt] = Field(default=None, description="Cidr Size for the IP Block created. Valid values depends on the operating system being provisioned. (28..32 for IPv4 addresses, 124..127 for IPv6 addresses)") + href: Optional[StrictStr] = None + ip_reservations: Optional[List[StrictStr]] = Field(default=None, description="UUIDs of any IP reservations to use when assigning IPs") + public: Optional[StrictBool] = Field(default=True, description="Address Type for IP Address") + __properties: ClassVar[List[str]] = ["address_family", "cidr", "href", "ip_reservations", "public"] + + @field_validator('address_family') + def address_family_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([4, 6]): + raise ValueError("must be one of enum values (4, 6)") + return value + + 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 IPAddress 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPAddress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address_family": obj.get("address_family"), + "cidr": obj.get("cidr"), + "href": obj.get("href"), + "ip_reservations": obj.get("ip_reservations"), + "public": obj.get("public") if obj.get("public") is not None else True + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_assignment.py b/equinix/services/metalv1/models/ip_assignment.py new file mode 100644 index 00000000..cf589d9b --- /dev/null +++ b/equinix/services/metalv1/models/ip_assignment.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.ip_assignment_metro import IPAssignmentMetro +from equinix.services.metalv1.models.parent_block import ParentBlock +from typing import Optional, Set +from typing_extensions import Self + +class IPAssignment(BaseModel): + """ + IPAssignment + """ # noqa: E501 + address: Optional[StrictStr] = None + address_family: Optional[StrictInt] = None + assigned_to: Href + cidr: Optional[StrictInt] = None + created_at: Optional[datetime] = None + enabled: Optional[StrictBool] = None + gateway: Optional[StrictStr] = None + global_ip: Optional[StrictBool] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + manageable: Optional[StrictBool] = None + management: Optional[StrictBool] = None + metro: Optional[IPAssignmentMetro] = None + netmask: Optional[StrictStr] = None + network: Optional[StrictStr] = None + next_hop: Optional[StrictStr] = Field(default=None, description="Only set when this is a Metal Gateway Elastic IP Assignment. The IP address within the Metal Gateway to which requests to the Elastic IP are forwarded. ") + parent_block: Optional[ParentBlock] = None + public: Optional[StrictBool] = None + state: Optional[StrictStr] = Field(default=None, description="Only set when this is a Metal Gateway Elastic IP Assignment. Describes the current configuration state of this IP on the network. ") + __properties: ClassVar[List[str]] = ["address", "address_family", "assigned_to", "cidr", "created_at", "enabled", "gateway", "global_ip", "href", "id", "manageable", "management", "metro", "netmask", "network", "next_hop", "parent_block", "public", "state"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['pending', 'active', 'deleting']): + raise ValueError("must be one of enum values ('pending', 'active', 'deleting')") + return value + + 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 IPAssignment 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of assigned_to + if self.assigned_to: + _dict['assigned_to'] = self.assigned_to.to_dict() + # override the default output from pydantic by calling `to_dict()` of metro + if self.metro: + _dict['metro'] = self.metro.to_dict() + # override the default output from pydantic by calling `to_dict()` of parent_block + if self.parent_block: + _dict['parent_block'] = self.parent_block.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPAssignment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "address_family": obj.get("address_family"), + "assigned_to": Href.from_dict(obj["assigned_to"]) if obj.get("assigned_to") is not None else None, + "cidr": obj.get("cidr"), + "created_at": obj.get("created_at"), + "enabled": obj.get("enabled"), + "gateway": obj.get("gateway"), + "global_ip": obj.get("global_ip"), + "href": obj.get("href"), + "id": obj.get("id"), + "manageable": obj.get("manageable"), + "management": obj.get("management"), + "metro": IPAssignmentMetro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "netmask": obj.get("netmask"), + "network": obj.get("network"), + "next_hop": obj.get("next_hop"), + "parent_block": ParentBlock.from_dict(obj["parent_block"]) if obj.get("parent_block") is not None else None, + "public": obj.get("public"), + "state": obj.get("state") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_assignment_input.py b/equinix/services/metalv1/models/ip_assignment_input.py new file mode 100644 index 00000000..ed264a30 --- /dev/null +++ b/equinix/services/metalv1/models/ip_assignment_input.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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 IPAssignmentInput(BaseModel): + """ + IPAssignmentInput + """ # noqa: E501 + address: StrictStr + customdata: Optional[Dict[str, Any]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "customdata", "href"] + + 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 IPAssignmentInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPAssignmentInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "customdata": obj.get("customdata"), + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_assignment_list.py b/equinix/services/metalv1/models/ip_assignment_list.py new file mode 100644 index 00000000..b68d618f --- /dev/null +++ b/equinix/services/metalv1/models/ip_assignment_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.ip_assignment import IPAssignment +from typing import Optional, Set +from typing_extensions import Self + +class IPAssignmentList(BaseModel): + """ + IPAssignmentList + """ # noqa: E501 + href: Optional[StrictStr] = None + ip_addresses: Optional[List[IPAssignment]] = None + __properties: ClassVar[List[str]] = ["href", "ip_addresses"] + + 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 IPAssignmentList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 ip_addresses (list) + _items = [] + if self.ip_addresses: + for _item in self.ip_addresses: + if _item: + _items.append(_item.to_dict()) + _dict['ip_addresses'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPAssignmentList 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"), + "ip_addresses": [IPAssignment.from_dict(_item) for _item in obj["ip_addresses"]] if obj.get("ip_addresses") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_assignment_metro.py b/equinix/services/metalv1/models/ip_assignment_metro.py new file mode 100644 index 00000000..bc90261a --- /dev/null +++ b/equinix/services/metalv1/models/ip_assignment_metro.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 IPAssignmentMetro(BaseModel): + """ + IPAssignmentMetro + """ # noqa: E501 + code: Optional[StrictStr] = None + country: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __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 IPAssignmentMetro 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPAssignmentMetro 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") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_assignment_update_input.py b/equinix/services/metalv1/models/ip_assignment_update_input.py new file mode 100644 index 00000000..c9bab3cf --- /dev/null +++ b/equinix/services/metalv1/models/ip_assignment_update_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 IPAssignmentUpdateInput(BaseModel): + """ + IPAssignmentUpdateInput + """ # noqa: E501 + customdata: Optional[Dict[str, Any]] = None + details: Optional[StrictStr] = None + href: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["customdata", "details", "href", "tags"] + + 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 IPAssignmentUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPAssignmentUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "customdata": obj.get("customdata"), + "details": obj.get("details"), + "href": obj.get("href"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_availabilities_list.py b/equinix/services/metalv1/models/ip_availabilities_list.py new file mode 100644 index 00000000..e9bc247e --- /dev/null +++ b/equinix/services/metalv1/models/ip_availabilities_list.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 IPAvailabilitiesList(BaseModel): + """ + IPAvailabilitiesList + """ # noqa: E501 + available: Optional[List[StrictStr]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["available", "href"] + + 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 IPAvailabilitiesList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPAvailabilitiesList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "available": obj.get("available"), + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_reservation.py b/equinix/services/metalv1/models/ip_reservation.py new file mode 100644 index 00000000..acb169a7 --- /dev/null +++ b/equinix/services/metalv1/models/ip_reservation.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.ip_reservation_facility import IPReservationFacility +from equinix.services.metalv1.models.ip_reservation_metro import IPReservationMetro +from equinix.services.metalv1.models.metal_gateway_lite import MetalGatewayLite +from equinix.services.metalv1.models.project import Project +from typing import Optional, Set +from typing_extensions import Self + +class IPReservation(BaseModel): + """ + IPReservation + """ # noqa: E501 + addon: Optional[StrictBool] = None + address: Optional[StrictStr] = None + address_family: Optional[StrictInt] = None + assignments: Optional[List[Href]] = None + available: Optional[StrictStr] = None + bill: Optional[StrictBool] = None + cidr: Optional[StrictInt] = None + created_at: Optional[datetime] = None + customdata: Optional[Dict[str, Any]] = None + details: Optional[StrictStr] = None + enabled: Optional[StrictBool] = None + facility: Optional[IPReservationFacility] = None + gateway: Optional[StrictStr] = None + global_ip: Optional[StrictBool] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + manageable: Optional[StrictBool] = None + management: Optional[StrictBool] = None + metal_gateway: Optional[MetalGatewayLite] = None + metro: Optional[IPReservationMetro] = None + netmask: Optional[StrictStr] = None + network: Optional[StrictStr] = None + project: Optional[Project] = None + project_lite: Optional[Href] = None + public: Optional[StrictBool] = None + requested_by: Optional[Href] = None + state: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + type: StrictStr + __properties: ClassVar[List[str]] = ["addon", "address", "address_family", "assignments", "available", "bill", "cidr", "created_at", "customdata", "details", "enabled", "facility", "gateway", "global_ip", "href", "id", "manageable", "management", "metal_gateway", "metro", "netmask", "network", "project", "project_lite", "public", "requested_by", "state", "tags", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['global_ipv4', 'public_ipv4', 'private_ipv4', 'public_ipv6']): + raise ValueError("must be one of enum values ('global_ipv4', 'public_ipv4', 'private_ipv4', 'public_ipv6')") + return value + + 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 IPReservation 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 assignments (list) + _items = [] + if self.assignments: + for _item in self.assignments: + if _item: + _items.append(_item.to_dict()) + _dict['assignments'] = _items + # override the default output from pydantic by calling `to_dict()` of facility + if self.facility: + _dict['facility'] = self.facility.to_dict() + # override the default output from pydantic by calling `to_dict()` of metal_gateway + if self.metal_gateway: + _dict['metal_gateway'] = self.metal_gateway.to_dict() + # override the default output from pydantic by calling `to_dict()` of metro + if self.metro: + _dict['metro'] = self.metro.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of project_lite + if self.project_lite: + _dict['project_lite'] = self.project_lite.to_dict() + # override the default output from pydantic by calling `to_dict()` of requested_by + if self.requested_by: + _dict['requested_by'] = self.requested_by.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPReservation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "addon": obj.get("addon"), + "address": obj.get("address"), + "address_family": obj.get("address_family"), + "assignments": [Href.from_dict(_item) for _item in obj["assignments"]] if obj.get("assignments") is not None else None, + "available": obj.get("available"), + "bill": obj.get("bill"), + "cidr": obj.get("cidr"), + "created_at": obj.get("created_at"), + "customdata": obj.get("customdata"), + "details": obj.get("details"), + "enabled": obj.get("enabled"), + "facility": IPReservationFacility.from_dict(obj["facility"]) if obj.get("facility") is not None else None, + "gateway": obj.get("gateway"), + "global_ip": obj.get("global_ip"), + "href": obj.get("href"), + "id": obj.get("id"), + "manageable": obj.get("manageable"), + "management": obj.get("management"), + "metal_gateway": MetalGatewayLite.from_dict(obj["metal_gateway"]) if obj.get("metal_gateway") is not None else None, + "metro": IPReservationMetro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "netmask": obj.get("netmask"), + "network": obj.get("network"), + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, + "project_lite": Href.from_dict(obj["project_lite"]) if obj.get("project_lite") is not None else None, + "public": obj.get("public"), + "requested_by": Href.from_dict(obj["requested_by"]) if obj.get("requested_by") is not None else None, + "state": obj.get("state"), + "tags": obj.get("tags"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_reservation_facility.py b/equinix/services/metalv1/models/ip_reservation_facility.py new file mode 100644 index 00000000..96ff0632 --- /dev/null +++ b/equinix/services/metalv1/models/ip_reservation_facility.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.address import Address +from equinix.services.metalv1.models.device_metro import DeviceMetro +from typing import Optional, Set +from typing_extensions import Self + +class IPReservationFacility(BaseModel): + """ + IPReservationFacility + """ # noqa: E501 + address: Optional[Address] = None + code: Optional[StrictStr] = None + features: Optional[List[StrictStr]] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + ip_ranges: Optional[List[StrictStr]] = Field(default=None, description="IP ranges registered in facility. Can be used for GeoIP location") + metro: Optional[DeviceMetro] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "code", "features", "href", "id", "ip_ranges", "metro", "name"] + + @field_validator('features') + def features_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['baremetal', 'backend_transfer', 'layer_2', 'global_ipv4', 'ibx']): + raise ValueError("each list item must be one of ('baremetal', 'backend_transfer', 'layer_2', 'global_ipv4', 'ibx')") + return value + + 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 IPReservationFacility 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of metro + if self.metro: + _dict['metro'] = self.metro.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPReservationFacility from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, + "code": obj.get("code"), + "features": obj.get("features"), + "href": obj.get("href"), + "id": obj.get("id"), + "ip_ranges": obj.get("ip_ranges"), + "metro": DeviceMetro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "name": obj.get("name") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_reservation_list.py b/equinix/services/metalv1/models/ip_reservation_list.py new file mode 100644 index 00000000..3ab5b2cb --- /dev/null +++ b/equinix/services/metalv1/models/ip_reservation_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.ip_reservation_list_ip_addresses_inner import IPReservationListIpAddressesInner +from equinix.services.metalv1.models.meta import Meta +from typing import Optional, Set +from typing_extensions import Self + +class IPReservationList(BaseModel): + """ + IPReservationList + """ # noqa: E501 + href: Optional[StrictStr] = None + ip_addresses: Optional[List[IPReservationListIpAddressesInner]] = None + meta: Optional[Meta] = None + __properties: ClassVar[List[str]] = ["href", "ip_addresses", "meta"] + + 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 IPReservationList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 ip_addresses (list) + _items = [] + if self.ip_addresses: + for _item in self.ip_addresses: + if _item: + _items.append(_item.to_dict()) + _dict['ip_addresses'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPReservationList 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"), + "ip_addresses": [IPReservationListIpAddressesInner.from_dict(_item) for _item in obj["ip_addresses"]] if obj.get("ip_addresses") is not None else None, + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_reservation_list_ip_addresses_inner.py b/equinix/services/metalv1/models/ip_reservation_list_ip_addresses_inner.py new file mode 100644 index 00000000..749ecf94 --- /dev/null +++ b/equinix/services/metalv1/models/ip_reservation_list_ip_addresses_inner.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Metal API + + 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 +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from equinix.services.metalv1.models.ip_reservation import IPReservation +from equinix.services.metalv1.models.vrf_ip_reservation import VrfIpReservation +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +IPRESERVATIONLISTIPADDRESSESINNER_ANY_OF_SCHEMAS = ["IPReservation", "VrfIpReservation"] + +class IPReservationListIpAddressesInner(BaseModel): + """ + IPReservationListIpAddressesInner + """ + + # data type: IPReservation + anyof_schema_1_validator: Optional[IPReservation] = None + # data type: VrfIpReservation + anyof_schema_2_validator: Optional[VrfIpReservation] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[IPReservation, VrfIpReservation]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["IPReservation", "VrfIpReservation"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = IPReservationListIpAddressesInner.model_construct() + error_messages = [] + # validate data type: IPReservation + if not isinstance(v, IPReservation): + error_messages.append(f"Error! Input type `{type(v)}` is not `IPReservation`") + else: + return v + + # validate data type: VrfIpReservation + if not isinstance(v, VrfIpReservation): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfIpReservation`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in IPReservationListIpAddressesInner with anyOf schemas: IPReservation, VrfIpReservation. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[IPReservation] = None + try: + instance.actual_instance = IPReservation.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[VrfIpReservation] = None + try: + instance.actual_instance = VrfIpReservation.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into IPReservationListIpAddressesInner with anyOf schemas: IPReservation, VrfIpReservation. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], IPReservation, VrfIpReservation]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/ip_reservation_metro.py b/equinix/services/metalv1/models/ip_reservation_metro.py new file mode 100644 index 00000000..b8ecff22 --- /dev/null +++ b/equinix/services/metalv1/models/ip_reservation_metro.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 IPReservationMetro(BaseModel): + """ + IPReservationMetro + """ # noqa: E501 + code: Optional[StrictStr] = None + country: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __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 IPReservationMetro 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPReservationMetro 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") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ip_reservation_request_input.py b/equinix/services/metalv1/models/ip_reservation_request_input.py new file mode 100644 index 00000000..0c43311f --- /dev/null +++ b/equinix/services/metalv1/models/ip_reservation_request_input.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class IPReservationRequestInput(BaseModel): + """ + IPReservationRequestInput + """ # noqa: E501 + comments: Optional[StrictStr] = None + customdata: Optional[Dict[str, Any]] = None + details: Optional[StrictStr] = None + facility: Optional[StrictStr] = None + fail_on_approval_required: Optional[StrictBool] = None + href: Optional[StrictStr] = None + metro: Optional[StrictStr] = Field(default=None, description="The code of the metro you are requesting the IP reservation in.") + quantity: StrictInt + tags: Optional[List[StrictStr]] = None + type: StrictStr + __properties: ClassVar[List[str]] = ["comments", "customdata", "details", "facility", "fail_on_approval_required", "href", "metro", "quantity", "tags", "type"] + + 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 IPReservationRequestInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPReservationRequestInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "comments": obj.get("comments"), + "customdata": obj.get("customdata"), + "details": obj.get("details"), + "facility": obj.get("facility"), + "fail_on_approval_required": obj.get("fail_on_approval_required"), + "href": obj.get("href"), + "metro": obj.get("metro"), + "quantity": obj.get("quantity"), + "tags": obj.get("tags"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/license.py b/equinix/services/metalv1/models/license.py new file mode 100644 index 00000000..f313d522 --- /dev/null +++ b/equinix/services/metalv1/models/license.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class License(BaseModel): + """ + License + """ # noqa: E501 + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + license_key: Optional[StrictStr] = None + licensee_product: Optional[Href] = None + project: Optional[Href] = None + size: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["description", "href", "id", "license_key", "licensee_product", "project", "size"] + + 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 License 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of licensee_product + if self.licensee_product: + _dict['licensee_product'] = self.licensee_product.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of License from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "href": obj.get("href"), + "id": obj.get("id"), + "license_key": obj.get("license_key"), + "licensee_product": Href.from_dict(obj["licensee_product"]) if obj.get("licensee_product") is not None else None, + "project": Href.from_dict(obj["project"]) if obj.get("project") is not None else None, + "size": obj.get("size") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/license_create_input.py b/equinix/services/metalv1/models/license_create_input.py new file mode 100644 index 00000000..920852d1 --- /dev/null +++ b/equinix/services/metalv1/models/license_create_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class LicenseCreateInput(BaseModel): + """ + LicenseCreateInput + """ # noqa: E501 + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + licensee_product_id: Optional[StrictStr] = None + size: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["description", "href", "licensee_product_id", "size"] + + 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 LicenseCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LicenseCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "href": obj.get("href"), + "licensee_product_id": obj.get("licensee_product_id"), + "size": obj.get("size") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/license_list.py b/equinix/services/metalv1/models/license_list.py new file mode 100644 index 00000000..1b0d97ac --- /dev/null +++ b/equinix/services/metalv1/models/license_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.license import License +from typing import Optional, Set +from typing_extensions import Self + +class LicenseList(BaseModel): + """ + LicenseList + """ # noqa: E501 + href: Optional[StrictStr] = None + licenses: Optional[List[License]] = None + __properties: ClassVar[List[str]] = ["href", "licenses"] + + 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 LicenseList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 licenses (list) + _items = [] + if self.licenses: + for _item in self.licenses: + if _item: + _items.append(_item.to_dict()) + _dict['licenses'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LicenseList 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"), + "licenses": [License.from_dict(_item) for _item in obj["licenses"]] if obj.get("licenses") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/license_update_input.py b/equinix/services/metalv1/models/license_update_input.py new file mode 100644 index 00000000..760080c9 --- /dev/null +++ b/equinix/services/metalv1/models/license_update_input.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class LicenseUpdateInput(BaseModel): + """ + LicenseUpdateInput + """ # noqa: E501 + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + size: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["description", "href", "size"] + + 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 LicenseUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LicenseUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "href": obj.get("href"), + "size": obj.get("size") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/line_item.py b/equinix/services/metalv1/models/line_item.py new file mode 100644 index 00000000..c3946be8 --- /dev/null +++ b/equinix/services/metalv1/models/line_item.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.line_item_adjustment import LineItemAdjustment +from equinix.services.metalv1.models.plan_id_name import PlanIdName +from equinix.services.metalv1.models.project_id_name import ProjectIdName +from typing import Optional, Set +from typing_extensions import Self + +class LineItem(BaseModel): + """ + LineItem + """ # noqa: E501 + adjustments: Optional[List[LineItemAdjustment]] = Field(default=None, description="Adjustments for the line item") + amount: Optional[Union[StrictFloat, StrictInt]] = None + currency: Optional[StrictStr] = None + description: Optional[StrictStr] = None + details: Optional[StrictStr] = None + end_date: Optional[date] = None + hostname: Optional[StrictStr] = None + href: Optional[StrictStr] = None + item_type: Optional[StrictStr] = None + location: Optional[StrictStr] = None + plan: Optional[PlanIdName] = None + plan_id: Optional[StrictStr] = None + project: Optional[ProjectIdName] = None + project_id: Optional[StrictStr] = None + service_id: Optional[StrictStr] = None + start_date: Optional[date] = None + unit: Optional[StrictStr] = None + unit_price: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["adjustments", "amount", "currency", "description", "details", "end_date", "hostname", "href", "item_type", "location", "plan", "plan_id", "project", "project_id", "service_id", "start_date", "unit", "unit_price"] + + 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 LineItem 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 adjustments (list) + _items = [] + if self.adjustments: + for _item in self.adjustments: + if _item: + _items.append(_item.to_dict()) + _dict['adjustments'] = _items + # override the default output from pydantic by calling `to_dict()` of plan + if self.plan: + _dict['plan'] = self.plan.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LineItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "adjustments": [LineItemAdjustment.from_dict(_item) for _item in obj["adjustments"]] if obj.get("adjustments") is not None else None, + "amount": obj.get("amount"), + "currency": obj.get("currency"), + "description": obj.get("description"), + "details": obj.get("details"), + "end_date": obj.get("end_date"), + "hostname": obj.get("hostname"), + "href": obj.get("href"), + "item_type": obj.get("item_type"), + "location": obj.get("location"), + "plan": PlanIdName.from_dict(obj["plan"]) if obj.get("plan") is not None else None, + "plan_id": obj.get("plan_id"), + "project": ProjectIdName.from_dict(obj["project"]) if obj.get("project") is not None else None, + "project_id": obj.get("project_id"), + "service_id": obj.get("service_id"), + "start_date": obj.get("start_date"), + "unit": obj.get("unit"), + "unit_price": obj.get("unit_price") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/line_item_adjustment.py b/equinix/services/metalv1/models/line_item_adjustment.py new file mode 100644 index 00000000..d82c4208 --- /dev/null +++ b/equinix/services/metalv1/models/line_item_adjustment.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class LineItemAdjustment(BaseModel): + """ + LineItemAdjustment + """ # noqa: E501 + amount: Optional[Union[StrictFloat, StrictInt]] = None + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["amount", "description", "href"] + + 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 LineItemAdjustment 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LineItemAdjustment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "amount": obj.get("amount"), + "description": obj.get("description"), + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/membership.py b/equinix/services/metalv1/models/membership.py new file mode 100644 index 00000000..debc40b0 --- /dev/null +++ b/equinix/services/metalv1/models/membership.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class Membership(BaseModel): + """ + Membership + """ # noqa: E501 + created_at: Optional[datetime] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + project: Optional[Href] = None + roles: Optional[List[StrictStr]] = None + updated_at: Optional[datetime] = None + user: Optional[Href] = None + __properties: ClassVar[List[str]] = ["created_at", "href", "id", "project", "roles", "updated_at", "user"] + + 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 Membership 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of user + if self.user: + _dict['user'] = self.user.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Membership from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "href": obj.get("href"), + "id": obj.get("id"), + "project": Href.from_dict(obj["project"]) if obj.get("project") is not None else None, + "roles": obj.get("roles"), + "updated_at": obj.get("updated_at"), + "user": Href.from_dict(obj["user"]) if obj.get("user") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/membership_input.py b/equinix/services/metalv1/models/membership_input.py new file mode 100644 index 00000000..9425dfcf --- /dev/null +++ b/equinix/services/metalv1/models/membership_input.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 MembershipInput(BaseModel): + """ + MembershipInput + """ # noqa: E501 + href: Optional[StrictStr] = None + role: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["href", "role"] + + 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 MembershipInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MembershipInput 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"), + "role": obj.get("role") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/membership_list.py b/equinix/services/metalv1/models/membership_list.py new file mode 100644 index 00000000..02c1e370 --- /dev/null +++ b/equinix/services/metalv1/models/membership_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.membership import Membership +from typing import Optional, Set +from typing_extensions import Self + +class MembershipList(BaseModel): + """ + MembershipList + """ # noqa: E501 + href: Optional[StrictStr] = None + memberships: Optional[List[Membership]] = None + __properties: ClassVar[List[str]] = ["href", "memberships"] + + 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 MembershipList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 memberships (list) + _items = [] + if self.memberships: + for _item in self.memberships: + if _item: + _items.append(_item.to_dict()) + _dict['memberships'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MembershipList 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"), + "memberships": [Membership.from_dict(_item) for _item in obj["memberships"]] if obj.get("memberships") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/meta.py b/equinix/services/metalv1/models/meta.py new file mode 100644 index 00000000..4a4c12df --- /dev/null +++ b/equinix/services/metalv1/models/meta.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class Meta(BaseModel): + """ + Meta + """ # noqa: E501 + current_page: Optional[StrictInt] = None + first: Optional[Href] = None + href: Optional[StrictStr] = None + last: Optional[Href] = None + last_page: Optional[StrictInt] = None + next: Optional[Href] = None + previous: Optional[Href] = None + var_self: Optional[Href] = Field(default=None, alias="self") + total: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["current_page", "first", "href", "last", "last_page", "next", "previous", "self", "total"] + + 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 Meta 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of first + if self.first: + _dict['first'] = self.first.to_dict() + # override the default output from pydantic by calling `to_dict()` of last + if self.last: + _dict['last'] = self.last.to_dict() + # override the default output from pydantic by calling `to_dict()` of next + if self.next: + _dict['next'] = self.next.to_dict() + # override the default output from pydantic by calling `to_dict()` of previous + if self.previous: + _dict['previous'] = self.previous.to_dict() + # override the default output from pydantic by calling `to_dict()` of var_self + if self.var_self: + _dict['self'] = self.var_self.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Meta from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "current_page": obj.get("current_page"), + "first": Href.from_dict(obj["first"]) if obj.get("first") is not None else None, + "href": obj.get("href"), + "last": Href.from_dict(obj["last"]) if obj.get("last") is not None else None, + "last_page": obj.get("last_page"), + "next": Href.from_dict(obj["next"]) if obj.get("next") is not None else None, + "previous": Href.from_dict(obj["previous"]) if obj.get("previous") is not None else None, + "self": Href.from_dict(obj["self"]) if obj.get("self") is not None else None, + "total": obj.get("total") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metadata.py b/equinix/services/metalv1/models/metadata.py new file mode 100644 index 00000000..c5c732db --- /dev/null +++ b/equinix/services/metalv1/models/metadata.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.metadata_network import MetadataNetwork +from typing import Optional, Set +from typing_extensions import Self + +class Metadata(BaseModel): + """ + Metadata + """ # noqa: E501 + var_class: Optional[StrictStr] = Field(default=None, alias="class") + customdata: Optional[Dict[str, Any]] = None + facility: Optional[StrictStr] = Field(default=None, description="The facility code of the instance") + hostname: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + iqn: Optional[StrictStr] = None + metro: Optional[StrictStr] = Field(default=None, description="The metro code of the instance") + network: Optional[MetadataNetwork] = None + operating_system: Optional[Dict[str, Any]] = None + plan: Optional[StrictStr] = Field(default=None, description="The plan slug of the instance") + private_subnets: Optional[List[StrictStr]] = Field(default=None, description="An array of the private subnets") + reserved: Optional[StrictBool] = None + specs: Optional[Dict[str, Any]] = Field(default=None, description="The specs of the plan version of the instance") + ssh_keys: Optional[List[StrictStr]] = None + state: Optional[StrictStr] = Field(default=None, description="The current state the instance is in. * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. * Once provisioning has begun on the instance it's state will move to `provisioning`. * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. * If an instance fails to provision or deprovision it will move to `failed` state. * Once an instance has completed provisioning it will move to `active` state. * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. * When the instance is powered off completely it will move to the `inactive` state. * When an instance is powered on completely it will move to the `active` state. * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. * When the reinstall action is complete the instance will move to `active` state.") + switch_short_id: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + volumes: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["class", "customdata", "facility", "hostname", "href", "id", "iqn", "metro", "network", "operating_system", "plan", "private_subnets", "reserved", "specs", "ssh_keys", "state", "switch_short_id", "tags", "volumes"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['queued', 'provisioning', 'deprovisioning', 'reinstalling', 'active', 'inactive', 'failed', 'powering_on', 'powering_off', 'deleted']): + raise ValueError("must be one of enum values ('queued', 'provisioning', 'deprovisioning', 'reinstalling', 'active', 'inactive', 'failed', 'powering_on', 'powering_off', 'deleted')") + return value + + 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 Metadata 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network + if self.network: + _dict['network'] = self.network.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Metadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "class": obj.get("class"), + "customdata": obj.get("customdata"), + "facility": obj.get("facility"), + "hostname": obj.get("hostname"), + "href": obj.get("href"), + "id": obj.get("id"), + "iqn": obj.get("iqn"), + "metro": obj.get("metro"), + "network": MetadataNetwork.from_dict(obj["network"]) if obj.get("network") is not None else None, + "operating_system": obj.get("operating_system"), + "plan": obj.get("plan"), + "private_subnets": obj.get("private_subnets"), + "reserved": obj.get("reserved"), + "specs": obj.get("specs"), + "ssh_keys": obj.get("ssh_keys"), + "state": obj.get("state"), + "switch_short_id": obj.get("switch_short_id"), + "tags": obj.get("tags"), + "volumes": obj.get("volumes") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metadata_network.py b/equinix/services/metalv1/models/metadata_network.py new file mode 100644 index 00000000..527a15f0 --- /dev/null +++ b/equinix/services/metalv1/models/metadata_network.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.metadata_network_network import MetadataNetworkNetwork +from typing import Optional, Set +from typing_extensions import Self + +class MetadataNetwork(BaseModel): + """ + MetadataNetwork + """ # noqa: E501 + addresses: Optional[List[StrictStr]] = None + href: Optional[StrictStr] = None + interfaces: Optional[List[Dict[str, Any]]] = None + network: Optional[MetadataNetworkNetwork] = None + __properties: ClassVar[List[str]] = ["addresses", "href", "interfaces", "network"] + + 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 MetadataNetwork 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of network + if self.network: + _dict['network'] = self.network.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetadataNetwork from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "addresses": obj.get("addresses"), + "href": obj.get("href"), + "interfaces": obj.get("interfaces"), + "network": MetadataNetworkNetwork.from_dict(obj["network"]) if obj.get("network") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metadata_network_network.py b/equinix/services/metalv1/models/metadata_network_network.py new file mode 100644 index 00000000..f2209d1c --- /dev/null +++ b/equinix/services/metalv1/models/metadata_network_network.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.metadata_network_network_bonding import MetadataNetworkNetworkBonding +from typing import Optional, Set +from typing_extensions import Self + +class MetadataNetworkNetwork(BaseModel): + """ + MetadataNetworkNetwork + """ # noqa: E501 + bonding: Optional[MetadataNetworkNetworkBonding] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["bonding", "href"] + + 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 MetadataNetworkNetwork 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of bonding + if self.bonding: + _dict['bonding'] = self.bonding.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetadataNetworkNetwork from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bonding": MetadataNetworkNetworkBonding.from_dict(obj["bonding"]) if obj.get("bonding") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metadata_network_network_bonding.py b/equinix/services/metalv1/models/metadata_network_network_bonding.py new file mode 100644 index 00000000..023ff190 --- /dev/null +++ b/equinix/services/metalv1/models/metadata_network_network_bonding.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class MetadataNetworkNetworkBonding(BaseModel): + """ + MetadataNetworkNetworkBonding + """ # noqa: E501 + href: Optional[StrictStr] = None + link_aggregation: Optional[StrictStr] = None + mac: Optional[StrictStr] = None + mode: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["href", "link_aggregation", "mac", "mode"] + + 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 MetadataNetworkNetworkBonding 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetadataNetworkNetworkBonding 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"), + "link_aggregation": obj.get("link_aggregation"), + "mac": obj.get("mac"), + "mode": obj.get("mode") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metal_gateway.py b/equinix/services/metalv1/models/metal_gateway.py new file mode 100644 index 00000000..9ec5f395 --- /dev/null +++ b/equinix/services/metalv1/models/metal_gateway.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.ip_reservation import IPReservation +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.virtual_network import VirtualNetwork +from typing import Optional, Set +from typing_extensions import Self + +class MetalGateway(BaseModel): + """ + MetalGateway + """ # noqa: E501 + created_at: Optional[datetime] = None + created_by: Optional[Href] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + ip_reservation: Optional[IPReservation] = None + project: Optional[Project] = None + state: Optional[StrictStr] = Field(default=None, description="The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted.") + updated_at: Optional[datetime] = None + virtual_network: Optional[VirtualNetwork] = None + __properties: ClassVar[List[str]] = ["created_at", "created_by", "href", "id", "ip_reservation", "project", "state", "updated_at", "virtual_network"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready', 'active', 'deleting']): + raise ValueError("must be one of enum values ('ready', 'active', 'deleting')") + return value + + 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 MetalGateway 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of created_by + if self.created_by: + _dict['created_by'] = self.created_by.to_dict() + # override the default output from pydantic by calling `to_dict()` of ip_reservation + if self.ip_reservation: + _dict['ip_reservation'] = self.ip_reservation.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of virtual_network + if self.virtual_network: + _dict['virtual_network'] = self.virtual_network.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetalGateway from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "created_by": Href.from_dict(obj["created_by"]) if obj.get("created_by") is not None else None, + "href": obj.get("href"), + "id": obj.get("id"), + "ip_reservation": IPReservation.from_dict(obj["ip_reservation"]) if obj.get("ip_reservation") is not None else None, + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, + "state": obj.get("state"), + "updated_at": obj.get("updated_at"), + "virtual_network": VirtualNetwork.from_dict(obj["virtual_network"]) if obj.get("virtual_network") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metal_gateway_create_input.py b/equinix/services/metalv1/models/metal_gateway_create_input.py new file mode 100644 index 00000000..6df6f19c --- /dev/null +++ b/equinix/services/metalv1/models/metal_gateway_create_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 MetalGatewayCreateInput(BaseModel): + """ + MetalGatewayCreateInput + """ # noqa: E501 + href: Optional[StrictStr] = None + ip_reservation_id: Optional[StrictStr] = Field(default=None, description="The UUID of an IP reservation that belongs to the same project as where the metal gateway will be created in. This field is required unless the private IPv4 subnet size is specified.") + private_ipv4_subnet_size: Optional[StrictInt] = Field(default=None, description="The subnet size (8, 16, 32, 64, or 128) of the private IPv4 reservation that will be created for the metal gateway. This field is required unless a project IP reservation was specified. Please keep in mind that the number of private metal gateway ranges are limited per project. If you would like to increase the limit per project, please contact support for assistance.") + virtual_network_id: StrictStr = Field(description="The UUID of a metro virtual network that belongs to the same project as where the metal gateway will be created in.") + __properties: ClassVar[List[str]] = ["href", "ip_reservation_id", "private_ipv4_subnet_size", "virtual_network_id"] + + 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 MetalGatewayCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetalGatewayCreateInput 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"), + "ip_reservation_id": obj.get("ip_reservation_id"), + "private_ipv4_subnet_size": obj.get("private_ipv4_subnet_size"), + "virtual_network_id": obj.get("virtual_network_id") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metal_gateway_elastic_ip_create_input.py b/equinix/services/metalv1/models/metal_gateway_elastic_ip_create_input.py new file mode 100644 index 00000000..c6731acd --- /dev/null +++ b/equinix/services/metalv1/models/metal_gateway_elastic_ip_create_input.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class MetalGatewayElasticIpCreateInput(BaseModel): + """ + MetalGatewayElasticIpCreateInput + """ # noqa: E501 + address: StrictStr = Field(description="An IP address (or IP Address range) contained within one of the project's IP Reservations") + customdata: Optional[Dict[str, Any]] = Field(default=None, description="Optional User-defined JSON object value.") + href: Optional[StrictStr] = None + next_hop: StrictStr = Field(description="An IP address contained within the Metal Gateways' IP Reservation range.") + tags: Optional[List[StrictStr]] = Field(default=None, description="Optional list of User-defined tags. Can be used by users to provide additional details or context regarding the purpose or usage of this resource.") + __properties: ClassVar[List[str]] = ["address", "customdata", "href", "next_hop", "tags"] + + 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 MetalGatewayElasticIpCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetalGatewayElasticIpCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "customdata": obj.get("customdata"), + "href": obj.get("href"), + "next_hop": obj.get("next_hop"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metal_gateway_list.py b/equinix/services/metalv1/models/metal_gateway_list.py new file mode 100644 index 00000000..8fd6ef91 --- /dev/null +++ b/equinix/services/metalv1/models/metal_gateway_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.meta import Meta +from equinix.services.metalv1.models.metal_gateway_list_metal_gateways_inner import MetalGatewayListMetalGatewaysInner +from typing import Optional, Set +from typing_extensions import Self + +class MetalGatewayList(BaseModel): + """ + MetalGatewayList + """ # noqa: E501 + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + metal_gateways: Optional[List[MetalGatewayListMetalGatewaysInner]] = None + __properties: ClassVar[List[str]] = ["href", "meta", "metal_gateways"] + + 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 MetalGatewayList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in metal_gateways (list) + _items = [] + if self.metal_gateways: + for _item in self.metal_gateways: + if _item: + _items.append(_item.to_dict()) + _dict['metal_gateways'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetalGatewayList 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"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "metal_gateways": [MetalGatewayListMetalGatewaysInner.from_dict(_item) for _item in obj["metal_gateways"]] if obj.get("metal_gateways") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metal_gateway_list_metal_gateways_inner.py b/equinix/services/metalv1/models/metal_gateway_list_metal_gateways_inner.py new file mode 100644 index 00000000..9e04d0a4 --- /dev/null +++ b/equinix/services/metalv1/models/metal_gateway_list_metal_gateways_inner.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Metal API + + 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 +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from equinix.services.metalv1.models.metal_gateway import MetalGateway +from equinix.services.metalv1.models.vrf_metal_gateway import VrfMetalGateway +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +METALGATEWAYLISTMETALGATEWAYSINNER_ANY_OF_SCHEMAS = ["MetalGateway", "VrfMetalGateway"] + +class MetalGatewayListMetalGatewaysInner(BaseModel): + """ + MetalGatewayListMetalGatewaysInner + """ + + # data type: MetalGateway + anyof_schema_1_validator: Optional[MetalGateway] = None + # data type: VrfMetalGateway + anyof_schema_2_validator: Optional[VrfMetalGateway] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[MetalGateway, VrfMetalGateway]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["MetalGateway", "VrfMetalGateway"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = MetalGatewayListMetalGatewaysInner.model_construct() + error_messages = [] + # validate data type: MetalGateway + if not isinstance(v, MetalGateway): + error_messages.append(f"Error! Input type `{type(v)}` is not `MetalGateway`") + else: + return v + + # validate data type: VrfMetalGateway + if not isinstance(v, VrfMetalGateway): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfMetalGateway`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in MetalGatewayListMetalGatewaysInner with anyOf schemas: MetalGateway, VrfMetalGateway. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[MetalGateway] = None + try: + instance.actual_instance = MetalGateway.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[VrfMetalGateway] = None + try: + instance.actual_instance = VrfMetalGateway.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into MetalGatewayListMetalGatewaysInner with anyOf schemas: MetalGateway, VrfMetalGateway. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], MetalGateway, VrfMetalGateway]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/metal_gateway_lite.py b/equinix/services/metalv1/models/metal_gateway_lite.py new file mode 100644 index 00000000..a2b65ddf --- /dev/null +++ b/equinix/services/metalv1/models/metal_gateway_lite.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class MetalGatewayLite(BaseModel): + """ + MetalGatewayLite + """ # noqa: E501 + created_at: Optional[datetime] = None + gateway_address: Optional[StrictStr] = Field(default=None, description="The gateway address with subnet CIDR value for this Metal Gateway. For example, a Metal Gateway using an IP reservation with block 10.1.2.0/27 would have a gateway address of 10.1.2.1/27.") + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + state: Optional[StrictStr] = Field(default=None, description="The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted.") + updated_at: Optional[datetime] = None + vlan: Optional[StrictInt] = Field(default=None, description="The VLAN id of the Virtual Network record associated to this Metal Gateway.") + __properties: ClassVar[List[str]] = ["created_at", "gateway_address", "href", "id", "state", "updated_at", "vlan"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready', 'active', 'deleting']): + raise ValueError("must be one of enum values ('ready', 'active', 'deleting')") + return value + + 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 MetalGatewayLite 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetalGatewayLite from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "gateway_address": obj.get("gateway_address"), + "href": obj.get("href"), + "id": obj.get("id"), + "state": obj.get("state"), + "updated_at": obj.get("updated_at"), + "vlan": obj.get("vlan") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metro.py b/equinix/services/metalv1/models/metro.py new file mode 100644 index 00000000..8ff51c71 --- /dev/null +++ b/equinix/services/metalv1/models/metro.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 Metro(BaseModel): + """ + Metro + """ # noqa: E501 + code: Optional[StrictStr] = None + country: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __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 Metro 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Metro 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") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metro_input.py b/equinix/services/metalv1/models/metro_input.py new file mode 100644 index 00000000..b5503f86 --- /dev/null +++ b/equinix/services/metalv1/models/metro_input.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class MetroInput(BaseModel): + """ + MetroInput + """ # noqa: E501 + 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.") + __properties: ClassVar[List[str]] = ["href", "metro"] + + 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 MetroInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetroInput 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"), + "metro": obj.get("metro") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/metro_list.py b/equinix/services/metalv1/models/metro_list.py new file mode 100644 index 00000000..8a23a5fc --- /dev/null +++ b/equinix/services/metalv1/models/metro_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.metro import Metro +from typing import Optional, Set +from typing_extensions import Self + +class MetroList(BaseModel): + """ + MetroList + """ # noqa: E501 + href: Optional[StrictStr] = None + metros: Optional[List[Metro]] = None + __properties: ClassVar[List[str]] = ["href", "metros"] + + 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 MetroList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 metros (list) + _items = [] + if self.metros: + for _item in self.metros: + if _item: + _items.append(_item.to_dict()) + _dict['metros'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MetroList 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"), + "metros": [Metro.from_dict(_item) for _item in obj["metros"]] if obj.get("metros") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/mount.py b/equinix/services/metalv1/models/mount.py new file mode 100644 index 00000000..e8e6cd2d --- /dev/null +++ b/equinix/services/metalv1/models/mount.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 Mount(BaseModel): + """ + Mount + """ # noqa: E501 + device: Optional[StrictStr] = None + format: Optional[StrictStr] = None + href: Optional[StrictStr] = None + options: Optional[List[StrictStr]] = None + point: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["device", "format", "href", "options", "point"] + + 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 Mount 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Mount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "device": obj.get("device"), + "format": obj.get("format"), + "href": obj.get("href"), + "options": obj.get("options"), + "point": obj.get("point") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/move_hardware_reservation_request.py b/equinix/services/metalv1/models/move_hardware_reservation_request.py new file mode 100644 index 00000000..687c3197 --- /dev/null +++ b/equinix/services/metalv1/models/move_hardware_reservation_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 MoveHardwareReservationRequest(BaseModel): + """ + MoveHardwareReservationRequest + """ # noqa: E501 + href: Optional[StrictStr] = None + project_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "project_id"] + + 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 MoveHardwareReservationRequest 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MoveHardwareReservationRequest 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"), + "project_id": obj.get("project_id") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/new_password.py b/equinix/services/metalv1/models/new_password.py new file mode 100644 index 00000000..816211d2 --- /dev/null +++ b/equinix/services/metalv1/models/new_password.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 NewPassword(BaseModel): + """ + NewPassword + """ # noqa: E501 + href: Optional[StrictStr] = None + new_password: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "new_password"] + + 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 NewPassword 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NewPassword 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"), + "new_password": obj.get("new_password") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/operating_system.py b/equinix/services/metalv1/models/operating_system.py new file mode 100644 index 00000000..91960da7 --- /dev/null +++ b/equinix/services/metalv1/models/operating_system.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class OperatingSystem(BaseModel): + """ + OperatingSystem + """ # noqa: E501 + build_date: Optional[date] = Field(default=None, description="The date on which the current OS image was build and released") + default_operating_system: Optional[StrictBool] = Field(default=None, description="Default operating system for the distro.") + deprecation_date: Optional[date] = Field(default=None, description="The date when the OS is deprecated") + distro: Optional[StrictStr] = None + distro_label: Optional[StrictStr] = None + end_of_life_date: Optional[date] = Field(default=None, description="The OS no longer receives any updates and may be disabled at any time") + end_of_service_date: Optional[date] = Field(default=None, description="When the OS is nearing end of life, typically 30 days before end of life") + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + licensed: Optional[StrictBool] = Field(default=None, description="Licenced OS is priced according to pricing property") + lifecycle_state: Optional[StrictStr] = Field(default=None, description="Where in the support lifecycle the OS is") + name: Optional[StrictStr] = None + preinstallable: Optional[StrictBool] = Field(default=None, description="Servers can be already preinstalled with OS in order to shorten provision time.") + pricing: Optional[Dict[str, Any]] = Field(default=None, description="This object contains price per time unit and optional multiplier value if licence price depends on hardware plan or components (e.g. number of cores)") + provisionable_on: Optional[List[StrictStr]] = None + release_date: Optional[date] = Field(default=None, description="The date when the OS was released") + release_notes: Optional[StrictStr] = Field(default=None, description="The current release notes for this OS image, typically in Markdown format") + slug: Optional[StrictStr] = None + version: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["build_date", "default_operating_system", "deprecation_date", "distro", "distro_label", "end_of_life_date", "end_of_service_date", "href", "id", "licensed", "lifecycle_state", "name", "preinstallable", "pricing", "provisionable_on", "release_date", "release_notes", "slug", "version"] + + 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 OperatingSystem 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. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "default_operating_system", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OperatingSystem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "build_date": obj.get("build_date"), + "default_operating_system": obj.get("default_operating_system"), + "deprecation_date": obj.get("deprecation_date"), + "distro": obj.get("distro"), + "distro_label": obj.get("distro_label"), + "end_of_life_date": obj.get("end_of_life_date"), + "end_of_service_date": obj.get("end_of_service_date"), + "href": obj.get("href"), + "id": obj.get("id"), + "licensed": obj.get("licensed"), + "lifecycle_state": obj.get("lifecycle_state"), + "name": obj.get("name"), + "preinstallable": obj.get("preinstallable"), + "pricing": obj.get("pricing"), + "provisionable_on": obj.get("provisionable_on"), + "release_date": obj.get("release_date"), + "release_notes": obj.get("release_notes"), + "slug": obj.get("slug"), + "version": obj.get("version") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/operating_system_list.py b/equinix/services/metalv1/models/operating_system_list.py new file mode 100644 index 00000000..70d8a882 --- /dev/null +++ b/equinix/services/metalv1/models/operating_system_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.operating_system import OperatingSystem +from typing import Optional, Set +from typing_extensions import Self + +class OperatingSystemList(BaseModel): + """ + OperatingSystemList + """ # noqa: E501 + href: Optional[StrictStr] = None + operating_systems: Optional[List[OperatingSystem]] = None + __properties: ClassVar[List[str]] = ["href", "operating_systems"] + + 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 OperatingSystemList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 operating_systems (list) + _items = [] + if self.operating_systems: + for _item in self.operating_systems: + if _item: + _items.append(_item.to_dict()) + _dict['operating_systems'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OperatingSystemList 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"), + "operating_systems": [OperatingSystem.from_dict(_item) for _item in obj["operating_systems"]] if obj.get("operating_systems") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/organization.py b/equinix/services/metalv1/models/organization.py new file mode 100644 index 00000000..be6f5565 --- /dev/null +++ b/equinix/services/metalv1/models/organization.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.address import Address +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class Organization(BaseModel): + """ + Organization + """ # noqa: E501 + address: Optional[Address] = None + billing_address: Optional[Address] = None + created_at: Optional[datetime] = None + credit_amount: Optional[Union[StrictFloat, StrictInt]] = None + customdata: Optional[Dict[str, Any]] = None + description: Optional[StrictStr] = None + enforce_2fa_at: Optional[datetime] = Field(default=None, description="Force to all members to have enabled the two factor authentication after that date, unless the value is null") + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + logo: Optional[StrictStr] = None + members: Optional[List[Href]] = None + memberships: Optional[List[Href]] = None + name: Optional[StrictStr] = None + projects: Optional[List[Href]] = None + terms: Optional[StrictInt] = None + twitter: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + website: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "billing_address", "created_at", "credit_amount", "customdata", "description", "enforce_2fa_at", "href", "id", "logo", "members", "memberships", "name", "projects", "terms", "twitter", "updated_at", "website"] + + 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 Organization 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of billing_address + if self.billing_address: + _dict['billing_address'] = self.billing_address.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in members (list) + _items = [] + if self.members: + for _item in self.members: + if _item: + _items.append(_item.to_dict()) + _dict['members'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in memberships (list) + _items = [] + if self.memberships: + for _item in self.memberships: + if _item: + _items.append(_item.to_dict()) + _dict['memberships'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in projects (list) + _items = [] + if self.projects: + for _item in self.projects: + if _item: + _items.append(_item.to_dict()) + _dict['projects'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Organization from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, + "billing_address": Address.from_dict(obj["billing_address"]) if obj.get("billing_address") is not None else None, + "created_at": obj.get("created_at"), + "credit_amount": obj.get("credit_amount"), + "customdata": obj.get("customdata"), + "description": obj.get("description"), + "enforce_2fa_at": obj.get("enforce_2fa_at"), + "href": obj.get("href"), + "id": obj.get("id"), + "logo": obj.get("logo"), + "members": [Href.from_dict(_item) for _item in obj["members"]] if obj.get("members") is not None else None, + "memberships": [Href.from_dict(_item) for _item in obj["memberships"]] if obj.get("memberships") is not None else None, + "name": obj.get("name"), + "projects": [Href.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None, + "terms": obj.get("terms"), + "twitter": obj.get("twitter"), + "updated_at": obj.get("updated_at"), + "website": obj.get("website") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/organization_input.py b/equinix/services/metalv1/models/organization_input.py new file mode 100644 index 00000000..86151788 --- /dev/null +++ b/equinix/services/metalv1/models/organization_input.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.address import Address +from typing import Optional, Set +from typing_extensions import Self + +class OrganizationInput(BaseModel): + """ + OrganizationInput + """ # noqa: E501 + address: Optional[Address] = None + billing_address: Optional[Address] = None + customdata: Optional[Dict[str, Any]] = None + description: Optional[StrictStr] = None + enforce_2fa_at: Optional[datetime] = Field(default=None, description="Force to all members to have enabled the two factor authentication after that date, unless the value is null") + href: Optional[StrictStr] = None + name: Optional[StrictStr] = None + twitter: Optional[StrictStr] = None + website: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "billing_address", "customdata", "description", "enforce_2fa_at", "href", "name", "twitter", "website"] + + 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 OrganizationInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of billing_address + if self.billing_address: + _dict['billing_address'] = self.billing_address.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrganizationInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, + "billing_address": Address.from_dict(obj["billing_address"]) if obj.get("billing_address") is not None else None, + "customdata": obj.get("customdata"), + "description": obj.get("description"), + "enforce_2fa_at": obj.get("enforce_2fa_at"), + "href": obj.get("href"), + "name": obj.get("name"), + "twitter": obj.get("twitter"), + "website": obj.get("website") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/organization_list.py b/equinix/services/metalv1/models/organization_list.py new file mode 100644 index 00000000..e6478d06 --- /dev/null +++ b/equinix/services/metalv1/models/organization_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.meta import Meta +from equinix.services.metalv1.models.organization import Organization +from typing import Optional, Set +from typing_extensions import Self + +class OrganizationList(BaseModel): + """ + OrganizationList + """ # noqa: E501 + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + organizations: Optional[List[Organization]] = None + __properties: ClassVar[List[str]] = ["href", "meta", "organizations"] + + 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 OrganizationList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in organizations (list) + _items = [] + if self.organizations: + for _item in self.organizations: + if _item: + _items.append(_item.to_dict()) + _dict['organizations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrganizationList 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"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "organizations": [Organization.from_dict(_item) for _item in obj["organizations"]] if obj.get("organizations") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/parent_block.py b/equinix/services/metalv1/models/parent_block.py new file mode 100644 index 00000000..8ad57e4a --- /dev/null +++ b/equinix/services/metalv1/models/parent_block.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ParentBlock(BaseModel): + """ + ParentBlock + """ # noqa: E501 + cidr: Optional[StrictInt] = None + href: Optional[StrictStr] = None + netmask: Optional[StrictStr] = None + network: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["cidr", "href", "netmask", "network"] + + 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 ParentBlock 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParentBlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cidr": obj.get("cidr"), + "href": obj.get("href"), + "netmask": obj.get("netmask"), + "network": obj.get("network") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/partition.py b/equinix/services/metalv1/models/partition.py new file mode 100644 index 00000000..1e6006a9 --- /dev/null +++ b/equinix/services/metalv1/models/partition.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Partition(BaseModel): + """ + Partition + """ # noqa: E501 + href: Optional[StrictStr] = None + label: Optional[StrictStr] = None + number: Optional[StrictInt] = None + size: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "label", "number", "size"] + + 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 Partition 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Partition 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"), + "label": obj.get("label"), + "number": obj.get("number"), + "size": obj.get("size") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/payment_method.py b/equinix/services/metalv1/models/payment_method.py new file mode 100644 index 00000000..fde1206c --- /dev/null +++ b/equinix/services/metalv1/models/payment_method.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.payment_method_billing_address import PaymentMethodBillingAddress +from typing import Optional, Set +from typing_extensions import Self + +class PaymentMethod(BaseModel): + """ + PaymentMethod + """ # noqa: E501 + billing_address: Optional[PaymentMethodBillingAddress] = None + card_type: Optional[StrictStr] = None + cardholder_name: Optional[StrictStr] = None + created_at: Optional[datetime] = None + created_by_user: Optional[Href] = None + default: Optional[StrictBool] = None + email: Optional[StrictStr] = None + expiration_month: Optional[StrictStr] = None + expiration_year: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + organization: Optional[Href] = None + projects: Optional[List[Href]] = None + type: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["billing_address", "card_type", "cardholder_name", "created_at", "created_by_user", "default", "email", "expiration_month", "expiration_year", "href", "id", "name", "organization", "projects", "type", "updated_at"] + + 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 PaymentMethod 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of billing_address + if self.billing_address: + _dict['billing_address'] = self.billing_address.to_dict() + # override the default output from pydantic by calling `to_dict()` of created_by_user + if self.created_by_user: + _dict['created_by_user'] = self.created_by_user.to_dict() + # override the default output from pydantic by calling `to_dict()` of organization + if self.organization: + _dict['organization'] = self.organization.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in projects (list) + _items = [] + if self.projects: + for _item in self.projects: + if _item: + _items.append(_item.to_dict()) + _dict['projects'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PaymentMethod from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "billing_address": PaymentMethodBillingAddress.from_dict(obj["billing_address"]) if obj.get("billing_address") is not None else None, + "card_type": obj.get("card_type"), + "cardholder_name": obj.get("cardholder_name"), + "created_at": obj.get("created_at"), + "created_by_user": Href.from_dict(obj["created_by_user"]) if obj.get("created_by_user") is not None else None, + "default": obj.get("default"), + "email": obj.get("email"), + "expiration_month": obj.get("expiration_month"), + "expiration_year": obj.get("expiration_year"), + "href": obj.get("href"), + "id": obj.get("id"), + "name": obj.get("name"), + "organization": Href.from_dict(obj["organization"]) if obj.get("organization") is not None else None, + "projects": [Href.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None, + "type": obj.get("type"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/payment_method_billing_address.py b/equinix/services/metalv1/models/payment_method_billing_address.py new file mode 100644 index 00000000..5b37fd38 --- /dev/null +++ b/equinix/services/metalv1/models/payment_method_billing_address.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 PaymentMethodBillingAddress(BaseModel): + """ + PaymentMethodBillingAddress + """ # noqa: E501 + country_code_alpha2: Optional[StrictStr] = None + href: Optional[StrictStr] = None + postal_code: Optional[StrictStr] = None + street_address: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["country_code_alpha2", "href", "postal_code", "street_address"] + + 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 PaymentMethodBillingAddress 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PaymentMethodBillingAddress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country_code_alpha2": obj.get("country_code_alpha2"), + "href": obj.get("href"), + "postal_code": obj.get("postal_code"), + "street_address": obj.get("street_address") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/payment_method_create_input.py b/equinix/services/metalv1/models/payment_method_create_input.py new file mode 100644 index 00000000..df4efe96 --- /dev/null +++ b/equinix/services/metalv1/models/payment_method_create_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PaymentMethodCreateInput(BaseModel): + """ + PaymentMethodCreateInput + """ # noqa: E501 + default: Optional[StrictBool] = None + href: Optional[StrictStr] = None + name: StrictStr + nonce: StrictStr + __properties: ClassVar[List[str]] = ["default", "href", "name", "nonce"] + + 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 PaymentMethodCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PaymentMethodCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "default": obj.get("default"), + "href": obj.get("href"), + "name": obj.get("name"), + "nonce": obj.get("nonce") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/payment_method_list.py b/equinix/services/metalv1/models/payment_method_list.py new file mode 100644 index 00000000..0c4a53a4 --- /dev/null +++ b/equinix/services/metalv1/models/payment_method_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.payment_method import PaymentMethod +from typing import Optional, Set +from typing_extensions import Self + +class PaymentMethodList(BaseModel): + """ + PaymentMethodList + """ # noqa: E501 + href: Optional[StrictStr] = None + payment_methods: Optional[List[PaymentMethod]] = None + __properties: ClassVar[List[str]] = ["href", "payment_methods"] + + 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 PaymentMethodList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 payment_methods (list) + _items = [] + if self.payment_methods: + for _item in self.payment_methods: + if _item: + _items.append(_item.to_dict()) + _dict['payment_methods'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PaymentMethodList 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"), + "payment_methods": [PaymentMethod.from_dict(_item) for _item in obj["payment_methods"]] if obj.get("payment_methods") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/payment_method_update_input.py b/equinix/services/metalv1/models/payment_method_update_input.py new file mode 100644 index 00000000..61e27c67 --- /dev/null +++ b/equinix/services/metalv1/models/payment_method_update_input.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PaymentMethodUpdateInput(BaseModel): + """ + PaymentMethodUpdateInput + """ # noqa: E501 + billing_address: Optional[Dict[str, Any]] = None + cardholder_name: Optional[StrictStr] = None + default: Optional[StrictBool] = None + expiration_month: Optional[StrictStr] = None + expiration_year: Optional[StrictInt] = None + href: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["billing_address", "cardholder_name", "default", "expiration_month", "expiration_year", "href", "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 PaymentMethodUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PaymentMethodUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "billing_address": obj.get("billing_address"), + "cardholder_name": obj.get("cardholder_name"), + "default": obj.get("default"), + "expiration_month": obj.get("expiration_month"), + "expiration_year": obj.get("expiration_year"), + "href": obj.get("href"), + "name": obj.get("name") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan.py b/equinix/services/metalv1/models/plan.py new file mode 100644 index 00000000..10464dc2 --- /dev/null +++ b/equinix/services/metalv1/models/plan.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.plan_available_in_inner import PlanAvailableInInner +from equinix.services.metalv1.models.plan_available_in_metros_inner import PlanAvailableInMetrosInner +from equinix.services.metalv1.models.plan_specs import PlanSpecs +from typing import Optional, Set +from typing_extensions import Self + +class Plan(BaseModel): + """ + Plan + """ # noqa: E501 + available_in: Optional[List[PlanAvailableInInner]] = Field(default=None, description="Shows which facilities the plan is available in, and the facility-based price if it is different from the default price.") + available_in_metros: Optional[List[PlanAvailableInMetrosInner]] = Field(default=None, description="Shows which metros the plan is available in, and the metro-based price if it is different from the default price.") + categories: Optional[List[StrictStr]] = Field(default=None, description="Categories of the plan, like compute or storage. A Plan can belong to multiple categories.") + var_class: Optional[StrictStr] = Field(default=None, alias="class") + deployment_types: Optional[Annotated[List[StrictStr], Field(min_length=0)]] = None + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + legacy: Optional[StrictBool] = Field(default=None, description="Deprecated. Always return false") + line: Optional[StrictStr] = None + name: Optional[StrictStr] = None + pricing: Optional[Dict[str, Any]] = None + slug: Optional[StrictStr] = None + specs: Optional[PlanSpecs] = None + type: Optional[StrictStr] = Field(default=None, description="The plan type") + __properties: ClassVar[List[str]] = ["available_in", "available_in_metros", "categories", "class", "deployment_types", "description", "href", "id", "legacy", "line", "name", "pricing", "slug", "specs", "type"] + + @field_validator('deployment_types') + def deployment_types_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['on_demand', 'spot_market']): + raise ValueError("each list item must be one of ('on_demand', 'spot_market')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['standard', 'workload_optimized', 'custom']): + raise ValueError("must be one of enum values ('standard', 'workload_optimized', 'custom')") + return value + + 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 Plan 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 available_in (list) + _items = [] + if self.available_in: + for _item in self.available_in: + if _item: + _items.append(_item.to_dict()) + _dict['available_in'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in available_in_metros (list) + _items = [] + if self.available_in_metros: + for _item in self.available_in_metros: + if _item: + _items.append(_item.to_dict()) + _dict['available_in_metros'] = _items + # override the default output from pydantic by calling `to_dict()` of specs + if self.specs: + _dict['specs'] = self.specs.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Plan from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "available_in": [PlanAvailableInInner.from_dict(_item) for _item in obj["available_in"]] if obj.get("available_in") is not None else None, + "available_in_metros": [PlanAvailableInMetrosInner.from_dict(_item) for _item in obj["available_in_metros"]] if obj.get("available_in_metros") is not None else None, + "categories": obj.get("categories"), + "class": obj.get("class"), + "deployment_types": obj.get("deployment_types"), + "description": obj.get("description"), + "href": obj.get("href"), + "id": obj.get("id"), + "legacy": obj.get("legacy"), + "line": obj.get("line"), + "name": obj.get("name"), + "pricing": obj.get("pricing"), + "slug": obj.get("slug"), + "specs": PlanSpecs.from_dict(obj["specs"]) if obj.get("specs") is not None else None, + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_available_in_inner.py b/equinix/services/metalv1/models/plan_available_in_inner.py new file mode 100644 index 00000000..732fcb69 --- /dev/null +++ b/equinix/services/metalv1/models/plan_available_in_inner.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_available_in_inner_price import PlanAvailableInInnerPrice +from typing import Optional, Set +from typing_extensions import Self + +class PlanAvailableInInner(BaseModel): + """ + PlanAvailableInInner + """ # noqa: E501 + href: Optional[StrictStr] = Field(default=None, description="href to the Facility") + price: Optional[PlanAvailableInInnerPrice] = None + __properties: ClassVar[List[str]] = ["href", "price"] + + 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 PlanAvailableInInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of price + if self.price: + _dict['price'] = self.price.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanAvailableInInner 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"), + "price": PlanAvailableInInnerPrice.from_dict(obj["price"]) if obj.get("price") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_available_in_inner_price.py b/equinix/services/metalv1/models/plan_available_in_inner_price.py new file mode 100644 index 00000000..f5cb9e8c --- /dev/null +++ b/equinix/services/metalv1/models/plan_available_in_inner_price.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class PlanAvailableInInnerPrice(BaseModel): + """ + PlanAvailableInInnerPrice + """ # noqa: E501 + hour: Optional[Union[StrictFloat, StrictInt]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["hour", "href"] + + 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 PlanAvailableInInnerPrice 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanAvailableInInnerPrice from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hour": obj.get("hour"), + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_available_in_metros_inner.py b/equinix/services/metalv1/models/plan_available_in_metros_inner.py new file mode 100644 index 00000000..6a4fb74d --- /dev/null +++ b/equinix/services/metalv1/models/plan_available_in_metros_inner.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_available_in_inner_price import PlanAvailableInInnerPrice +from typing import Optional, Set +from typing_extensions import Self + +class PlanAvailableInMetrosInner(BaseModel): + """ + PlanAvailableInMetrosInner + """ # noqa: E501 + href: Optional[StrictStr] = Field(default=None, description="href to the Metro") + price: Optional[PlanAvailableInInnerPrice] = None + __properties: ClassVar[List[str]] = ["href", "price"] + + 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 PlanAvailableInMetrosInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of price + if self.price: + _dict['price'] = self.price.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanAvailableInMetrosInner 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"), + "price": PlanAvailableInInnerPrice.from_dict(obj["price"]) if obj.get("price") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_id_name.py b/equinix/services/metalv1/models/plan_id_name.py new file mode 100644 index 00000000..82d71304 --- /dev/null +++ b/equinix/services/metalv1/models/plan_id_name.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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 PlanIdName(BaseModel): + """ + PlanIdName + """ # noqa: E501 + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["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 PlanIdName 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanIdName 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"), + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_list.py b/equinix/services/metalv1/models/plan_list.py new file mode 100644 index 00000000..e866dbaa --- /dev/null +++ b/equinix/services/metalv1/models/plan_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.plan import Plan +from typing import Optional, Set +from typing_extensions import Self + +class PlanList(BaseModel): + """ + PlanList + """ # noqa: E501 + href: Optional[StrictStr] = None + plans: Optional[List[Plan]] = None + __properties: ClassVar[List[str]] = ["href", "plans"] + + 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 PlanList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 plans (list) + _items = [] + if self.plans: + for _item in self.plans: + if _item: + _items.append(_item.to_dict()) + _dict['plans'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanList 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"), + "plans": [Plan.from_dict(_item) for _item in obj["plans"]] if obj.get("plans") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_specs.py b/equinix/services/metalv1/models/plan_specs.py new file mode 100644 index 00000000..ef977053 --- /dev/null +++ b/equinix/services/metalv1/models/plan_specs.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.plan_specs_cpus_inner import PlanSpecsCpusInner +from equinix.services.metalv1.models.plan_specs_drives_inner import PlanSpecsDrivesInner +from equinix.services.metalv1.models.plan_specs_features import PlanSpecsFeatures +from equinix.services.metalv1.models.plan_specs_memory import PlanSpecsMemory +from equinix.services.metalv1.models.plan_specs_nics_inner import PlanSpecsNicsInner +from typing import Optional, Set +from typing_extensions import Self + +class PlanSpecs(BaseModel): + """ + PlanSpecs + """ # noqa: E501 + cpus: Optional[List[PlanSpecsCpusInner]] = None + drives: Optional[List[PlanSpecsDrivesInner]] = None + features: Optional[PlanSpecsFeatures] = None + href: Optional[StrictStr] = None + memory: Optional[PlanSpecsMemory] = None + nics: Optional[List[PlanSpecsNicsInner]] = None + __properties: ClassVar[List[str]] = ["cpus", "drives", "features", "href", "memory", "nics"] + + 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 PlanSpecs 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 cpus (list) + _items = [] + if self.cpus: + for _item in self.cpus: + if _item: + _items.append(_item.to_dict()) + _dict['cpus'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in drives (list) + _items = [] + if self.drives: + for _item in self.drives: + if _item: + _items.append(_item.to_dict()) + _dict['drives'] = _items + # override the default output from pydantic by calling `to_dict()` of features + if self.features: + _dict['features'] = self.features.to_dict() + # override the default output from pydantic by calling `to_dict()` of memory + if self.memory: + _dict['memory'] = self.memory.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in nics (list) + _items = [] + if self.nics: + for _item in self.nics: + if _item: + _items.append(_item.to_dict()) + _dict['nics'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSpecs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cpus": [PlanSpecsCpusInner.from_dict(_item) for _item in obj["cpus"]] if obj.get("cpus") is not None else None, + "drives": [PlanSpecsDrivesInner.from_dict(_item) for _item in obj["drives"]] if obj.get("drives") is not None else None, + "features": PlanSpecsFeatures.from_dict(obj["features"]) if obj.get("features") is not None else None, + "href": obj.get("href"), + "memory": PlanSpecsMemory.from_dict(obj["memory"]) if obj.get("memory") is not None else None, + "nics": [PlanSpecsNicsInner.from_dict(_item) for _item in obj["nics"]] if obj.get("nics") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_specs_cpus_inner.py b/equinix/services/metalv1/models/plan_specs_cpus_inner.py new file mode 100644 index 00000000..37bec6d4 --- /dev/null +++ b/equinix/services/metalv1/models/plan_specs_cpus_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PlanSpecsCpusInner(BaseModel): + """ + PlanSpecsCpusInner + """ # noqa: E501 + count: Optional[StrictInt] = None + href: Optional[StrictStr] = None + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["count", "href", "type"] + + 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 PlanSpecsCpusInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSpecsCpusInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "count": obj.get("count"), + "href": obj.get("href"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_specs_drives_inner.py b/equinix/services/metalv1/models/plan_specs_drives_inner.py new file mode 100644 index 00000000..44113847 --- /dev/null +++ b/equinix/services/metalv1/models/plan_specs_drives_inner.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 PlanSpecsDrivesInner(BaseModel): + """ + PlanSpecsDrivesInner + """ # noqa: E501 + category: Optional[StrictStr] = Field(default=None, description="Values may include 'boot', 'cache', 'storage'") + count: Optional[StrictInt] = None + href: Optional[StrictStr] = None + size: Optional[StrictStr] = None + type: Optional[StrictStr] = Field(default=None, description="Values may include 'HDD', 'SSD', 'NVME'") + __properties: ClassVar[List[str]] = ["category", "count", "href", "size", "type"] + + 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 PlanSpecsDrivesInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSpecsDrivesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category"), + "count": obj.get("count"), + "href": obj.get("href"), + "size": obj.get("size"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_specs_features.py b/equinix/services/metalv1/models/plan_specs_features.py new file mode 100644 index 00000000..1746ae0e --- /dev/null +++ b/equinix/services/metalv1/models/plan_specs_features.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PlanSpecsFeatures(BaseModel): + """ + PlanSpecsFeatures + """ # noqa: E501 + href: Optional[StrictStr] = None + raid: Optional[StrictBool] = None + txt: Optional[StrictBool] = None + uefi: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["href", "raid", "txt", "uefi"] + + 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 PlanSpecsFeatures 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSpecsFeatures 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"), + "raid": obj.get("raid"), + "txt": obj.get("txt"), + "uefi": obj.get("uefi") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_specs_memory.py b/equinix/services/metalv1/models/plan_specs_memory.py new file mode 100644 index 00000000..7233522b --- /dev/null +++ b/equinix/services/metalv1/models/plan_specs_memory.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 PlanSpecsMemory(BaseModel): + """ + PlanSpecsMemory + """ # noqa: E501 + href: Optional[StrictStr] = None + total: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "total"] + + 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 PlanSpecsMemory 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSpecsMemory 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"), + "total": obj.get("total") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/plan_specs_nics_inner.py b/equinix/services/metalv1/models/plan_specs_nics_inner.py new file mode 100644 index 00000000..4b857643 --- /dev/null +++ b/equinix/services/metalv1/models/plan_specs_nics_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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 PlanSpecsNicsInner(BaseModel): + """ + PlanSpecsNicsInner + """ # noqa: E501 + count: Optional[StrictInt] = None + href: Optional[StrictStr] = None + type: Optional[StrictStr] = Field(default=None, description="Values may include '1Gbps', '10Gbps', '25Gbps'") + __properties: ClassVar[List[str]] = ["count", "href", "type"] + + 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 PlanSpecsNicsInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PlanSpecsNicsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "count": obj.get("count"), + "href": obj.get("href"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port.py b/equinix/services/metalv1/models/port.py new file mode 100644 index 00000000..fa0d2f99 --- /dev/null +++ b/equinix/services/metalv1/models/port.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.bond_port_data import BondPortData +from equinix.services.metalv1.models.port_data import PortData +from typing import Optional, Set +from typing_extensions import Self + +class Port(BaseModel): + """ + Port is a hardware port associated with a reserved or instantiated hardware device. + """ # noqa: E501 + bond: Optional[BondPortData] = None + data: Optional[PortData] = None + disbond_operation_supported: Optional[StrictBool] = Field(default=None, description="Indicates whether or not the bond can be broken on the port (when applicable).") + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + native_virtual_network: Optional[VirtualNetwork] = None + network_type: Optional[StrictStr] = Field(default=None, description="Composite network type of the bond") + type: Optional[StrictStr] = Field(default=None, description="Type is either \"NetworkBondPort\" for bond ports or \"NetworkPort\" for bondable ethernet ports") + virtual_networks: Optional[List[VirtualNetwork]] = None + __properties: ClassVar[List[str]] = ["bond", "data", "disbond_operation_supported", "href", "id", "name", "native_virtual_network", "network_type", "type", "virtual_networks"] + + @field_validator('network_type') + def network_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['layer2-bonded', 'layer2-individual', 'layer3', 'hybrid', 'hybrid-bonded']): + raise ValueError("must be one of enum values ('layer2-bonded', 'layer2-individual', 'layer3', 'hybrid', 'hybrid-bonded')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['NetworkPort', 'NetworkBondPort']): + raise ValueError("must be one of enum values ('NetworkPort', 'NetworkBondPort')") + return value + + 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 Port 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of bond + if self.bond: + _dict['bond'] = self.bond.to_dict() + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # override the default output from pydantic by calling `to_dict()` of native_virtual_network + if self.native_virtual_network: + _dict['native_virtual_network'] = self.native_virtual_network.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in virtual_networks (list) + _items = [] + if self.virtual_networks: + for _item in self.virtual_networks: + if _item: + _items.append(_item.to_dict()) + _dict['virtual_networks'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Port from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bond": BondPortData.from_dict(obj["bond"]) if obj.get("bond") is not None else None, + "data": PortData.from_dict(obj["data"]) if obj.get("data") is not None else None, + "disbond_operation_supported": obj.get("disbond_operation_supported"), + "href": obj.get("href"), + "id": obj.get("id"), + "name": obj.get("name"), + "native_virtual_network": VirtualNetwork.from_dict(obj["native_virtual_network"]) if obj.get("native_virtual_network") is not None else None, + "network_type": obj.get("network_type"), + "type": obj.get("type"), + "virtual_networks": [VirtualNetwork.from_dict(_item) for _item in obj["virtual_networks"]] if obj.get("virtual_networks") is not None else None + }) + return _obj + +from equinix.services.metalv1.models.virtual_network import VirtualNetwork +# TODO: Rewrite to not use raise_errors +Port.model_rebuild(raise_errors=False) + diff --git a/equinix/services/metalv1/models/port_assign_input.py b/equinix/services/metalv1/models/port_assign_input.py new file mode 100644 index 00000000..6ab47ae7 --- /dev/null +++ b/equinix/services/metalv1/models/port_assign_input.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class PortAssignInput(BaseModel): + """ + PortAssignInput + """ # noqa: E501 + href: Optional[StrictStr] = None + vnid: Optional[StrictStr] = Field(default=None, description="Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself. ") + __properties: ClassVar[List[str]] = ["href", "vnid"] + + 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 PortAssignInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortAssignInput 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"), + "vnid": obj.get("vnid") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port_convert_layer3_input.py b/equinix/services/metalv1/models/port_convert_layer3_input.py new file mode 100644 index 00000000..917dd77e --- /dev/null +++ b/equinix/services/metalv1/models/port_convert_layer3_input.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.port_convert_layer3_input_request_ips_inner import PortConvertLayer3InputRequestIpsInner +from typing import Optional, Set +from typing_extensions import Self + +class PortConvertLayer3Input(BaseModel): + """ + PortConvertLayer3Input + """ # noqa: E501 + href: Optional[StrictStr] = None + request_ips: Optional[List[PortConvertLayer3InputRequestIpsInner]] = None + __properties: ClassVar[List[str]] = ["href", "request_ips"] + + 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 PortConvertLayer3Input 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 request_ips (list) + _items = [] + if self.request_ips: + for _item in self.request_ips: + if _item: + _items.append(_item.to_dict()) + _dict['request_ips'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortConvertLayer3Input 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"), + "request_ips": [PortConvertLayer3InputRequestIpsInner.from_dict(_item) for _item in obj["request_ips"]] if obj.get("request_ips") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port_convert_layer3_input_request_ips_inner.py b/equinix/services/metalv1/models/port_convert_layer3_input_request_ips_inner.py new file mode 100644 index 00000000..88a5c826 --- /dev/null +++ b/equinix/services/metalv1/models/port_convert_layer3_input_request_ips_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PortConvertLayer3InputRequestIpsInner(BaseModel): + """ + PortConvertLayer3InputRequestIpsInner + """ # noqa: E501 + address_family: Optional[StrictInt] = None + href: Optional[StrictStr] = None + public: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["address_family", "href", "public"] + + 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 PortConvertLayer3InputRequestIpsInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortConvertLayer3InputRequestIpsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address_family": obj.get("address_family"), + "href": obj.get("href"), + "public": obj.get("public") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port_data.py b/equinix/services/metalv1/models/port_data.py new file mode 100644 index 00000000..c160a6fe --- /dev/null +++ b/equinix/services/metalv1/models/port_data.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PortData(BaseModel): + """ + PortData + """ # noqa: E501 + bonded: Optional[StrictBool] = Field(default=None, description="Bonded is true for NetworkPort ports in a bond and NetworkBondPort ports that are active") + href: Optional[StrictStr] = None + mac: Optional[StrictStr] = Field(default=None, description="MAC address is set for NetworkPort ports") + __properties: ClassVar[List[str]] = ["bonded", "href", "mac"] + + 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 PortData 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bonded": obj.get("bonded"), + "href": obj.get("href"), + "mac": obj.get("mac") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port_vlan_assignment.py b/equinix/services/metalv1/models/port_vlan_assignment.py new file mode 100644 index 00000000..b18b898d --- /dev/null +++ b/equinix/services/metalv1/models/port_vlan_assignment.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class PortVlanAssignment(BaseModel): + """ + PortVlanAssignment + """ # noqa: E501 + created_at: Optional[datetime] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + native: Optional[StrictBool] = None + port: Optional[Href] = None + state: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + virtual_network: Optional[Href] = None + vlan: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["created_at", "href", "id", "native", "port", "state", "updated_at", "virtual_network", "vlan"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['assigned', 'unassigning']): + raise ValueError("must be one of enum values ('assigned', 'unassigning')") + return value + + 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 PortVlanAssignment 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of port + if self.port: + _dict['port'] = self.port.to_dict() + # override the default output from pydantic by calling `to_dict()` of virtual_network + if self.virtual_network: + _dict['virtual_network'] = self.virtual_network.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortVlanAssignment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "href": obj.get("href"), + "id": obj.get("id"), + "native": obj.get("native"), + "port": Href.from_dict(obj["port"]) if obj.get("port") is not None else None, + "state": obj.get("state"), + "updated_at": obj.get("updated_at"), + "virtual_network": Href.from_dict(obj["virtual_network"]) if obj.get("virtual_network") is not None else None, + "vlan": obj.get("vlan") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port_vlan_assignment_batch.py b/equinix/services/metalv1/models/port_vlan_assignment_batch.py new file mode 100644 index 00000000..bcf5cb5c --- /dev/null +++ b/equinix/services/metalv1/models/port_vlan_assignment_batch.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.port import Port +from equinix.services.metalv1.models.port_vlan_assignment_batch_vlan_assignments_inner import PortVlanAssignmentBatchVlanAssignmentsInner +from typing import Optional, Set +from typing_extensions import Self + +class PortVlanAssignmentBatch(BaseModel): + """ + PortVlanAssignmentBatch + """ # noqa: E501 + created_at: Optional[datetime] = None + error_messages: Optional[List[StrictStr]] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + port: Optional[Port] = None + project: Optional[Href] = None + quantity: Optional[StrictInt] = None + state: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + vlan_assignments: Optional[List[PortVlanAssignmentBatchVlanAssignmentsInner]] = None + __properties: ClassVar[List[str]] = ["created_at", "error_messages", "href", "id", "port", "project", "quantity", "state", "updated_at", "vlan_assignments"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['queued', 'in_progress', 'completed', 'failed']): + raise ValueError("must be one of enum values ('queued', 'in_progress', 'completed', 'failed')") + return value + + 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 PortVlanAssignmentBatch 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of port + if self.port: + _dict['port'] = self.port.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in vlan_assignments (list) + _items = [] + if self.vlan_assignments: + for _item in self.vlan_assignments: + if _item: + _items.append(_item.to_dict()) + _dict['vlan_assignments'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortVlanAssignmentBatch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "error_messages": obj.get("error_messages"), + "href": obj.get("href"), + "id": obj.get("id"), + "port": Port.from_dict(obj["port"]) if obj.get("port") is not None else None, + "project": Href.from_dict(obj["project"]) if obj.get("project") is not None else None, + "quantity": obj.get("quantity"), + "state": obj.get("state"), + "updated_at": obj.get("updated_at"), + "vlan_assignments": [PortVlanAssignmentBatchVlanAssignmentsInner.from_dict(_item) for _item in obj["vlan_assignments"]] if obj.get("vlan_assignments") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port_vlan_assignment_batch_create_input.py b/equinix/services/metalv1/models/port_vlan_assignment_batch_create_input.py new file mode 100644 index 00000000..1a80c2b6 --- /dev/null +++ b/equinix/services/metalv1/models/port_vlan_assignment_batch_create_input.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.port_vlan_assignment_batch_create_input_vlan_assignments_inner import PortVlanAssignmentBatchCreateInputVlanAssignmentsInner +from typing import Optional, Set +from typing_extensions import Self + +class PortVlanAssignmentBatchCreateInput(BaseModel): + """ + PortVlanAssignmentBatchCreateInput + """ # noqa: E501 + href: Optional[StrictStr] = None + vlan_assignments: Optional[List[PortVlanAssignmentBatchCreateInputVlanAssignmentsInner]] = None + __properties: ClassVar[List[str]] = ["href", "vlan_assignments"] + + 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 PortVlanAssignmentBatchCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 vlan_assignments (list) + _items = [] + if self.vlan_assignments: + for _item in self.vlan_assignments: + if _item: + _items.append(_item.to_dict()) + _dict['vlan_assignments'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortVlanAssignmentBatchCreateInput 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"), + "vlan_assignments": [PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.from_dict(_item) for _item in obj["vlan_assignments"]] if obj.get("vlan_assignments") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port_vlan_assignment_batch_create_input_vlan_assignments_inner.py b/equinix/services/metalv1/models/port_vlan_assignment_batch_create_input_vlan_assignments_inner.py new file mode 100644 index 00000000..f05ac90c --- /dev/null +++ b/equinix/services/metalv1/models/port_vlan_assignment_batch_create_input_vlan_assignments_inner.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PortVlanAssignmentBatchCreateInputVlanAssignmentsInner(BaseModel): + """ + PortVlanAssignmentBatchCreateInputVlanAssignmentsInner + """ # noqa: E501 + href: Optional[StrictStr] = None + native: Optional[StrictBool] = None + state: Optional[StrictStr] = None + vlan: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "native", "state", "vlan"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['assigned', 'unassigned']): + raise ValueError("must be one of enum values ('assigned', 'unassigned')") + return value + + 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 PortVlanAssignmentBatchCreateInputVlanAssignmentsInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortVlanAssignmentBatchCreateInputVlanAssignmentsInner 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"), + "native": obj.get("native"), + "state": obj.get("state"), + "vlan": obj.get("vlan") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port_vlan_assignment_batch_list.py b/equinix/services/metalv1/models/port_vlan_assignment_batch_list.py new file mode 100644 index 00000000..7dd8713f --- /dev/null +++ b/equinix/services/metalv1/models/port_vlan_assignment_batch_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.port_vlan_assignment_batch import PortVlanAssignmentBatch +from typing import Optional, Set +from typing_extensions import Self + +class PortVlanAssignmentBatchList(BaseModel): + """ + PortVlanAssignmentBatchList + """ # noqa: E501 + batches: Optional[List[PortVlanAssignmentBatch]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["batches", "href"] + + 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 PortVlanAssignmentBatchList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 batches (list) + _items = [] + if self.batches: + for _item in self.batches: + if _item: + _items.append(_item.to_dict()) + _dict['batches'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortVlanAssignmentBatchList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "batches": [PortVlanAssignmentBatch.from_dict(_item) for _item in obj["batches"]] if obj.get("batches") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port_vlan_assignment_batch_vlan_assignments_inner.py b/equinix/services/metalv1/models/port_vlan_assignment_batch_vlan_assignments_inner.py new file mode 100644 index 00000000..9a4ba9bf --- /dev/null +++ b/equinix/services/metalv1/models/port_vlan_assignment_batch_vlan_assignments_inner.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PortVlanAssignmentBatchVlanAssignmentsInner(BaseModel): + """ + PortVlanAssignmentBatchVlanAssignmentsInner + """ # noqa: E501 + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + native: Optional[StrictBool] = None + state: Optional[StrictStr] = None + vlan: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["href", "id", "native", "state", "vlan"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['assigned', 'unassigned']): + raise ValueError("must be one of enum values ('assigned', 'unassigned')") + return value + + 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 PortVlanAssignmentBatchVlanAssignmentsInner 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortVlanAssignmentBatchVlanAssignmentsInner 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"), + "id": obj.get("id"), + "native": obj.get("native"), + "state": obj.get("state"), + "vlan": obj.get("vlan") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/port_vlan_assignment_list.py b/equinix/services/metalv1/models/port_vlan_assignment_list.py new file mode 100644 index 00000000..10715f39 --- /dev/null +++ b/equinix/services/metalv1/models/port_vlan_assignment_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.port_vlan_assignment import PortVlanAssignment +from typing import Optional, Set +from typing_extensions import Self + +class PortVlanAssignmentList(BaseModel): + """ + PortVlanAssignmentList + """ # noqa: E501 + href: Optional[StrictStr] = None + vlan_assignments: Optional[List[PortVlanAssignment]] = None + __properties: ClassVar[List[str]] = ["href", "vlan_assignments"] + + 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 PortVlanAssignmentList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 vlan_assignments (list) + _items = [] + if self.vlan_assignments: + for _item in self.vlan_assignments: + if _item: + _items.append(_item.to_dict()) + _dict['vlan_assignments'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PortVlanAssignmentList 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"), + "vlan_assignments": [PortVlanAssignment.from_dict(_item) for _item in obj["vlan_assignments"]] if obj.get("vlan_assignments") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/project.py b/equinix/services/metalv1/models/project.py new file mode 100644 index 00000000..5807dc80 --- /dev/null +++ b/equinix/services/metalv1/models/project.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class Project(BaseModel): + """ + Project + """ # noqa: E501 + backend_transfer_enabled: Optional[StrictBool] = None + bgp_config: Optional[Href] = None + created_at: Optional[datetime] = None + customdata: Optional[Dict[str, Any]] = None + devices: Optional[List[Href]] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + invitations: Optional[List[Href]] = None + max_devices: Optional[Dict[str, Any]] = None + members: Optional[List[Href]] = None + memberships: Optional[List[Href]] = None + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=80)]] = Field(default=None, description="The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis.") + network_status: Optional[Dict[str, Any]] = None + organization: Optional[Href] = None + payment_method: Optional[Href] = None + ssh_keys: Optional[List[Href]] = None + tags: Optional[List[StrictStr]] = None + type: Optional[StrictStr] = Field(default=None, description="The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers.") + updated_at: Optional[datetime] = None + url: Optional[StrictStr] = None + volumes: Optional[List[Href]] = None + __properties: ClassVar[List[str]] = ["backend_transfer_enabled", "bgp_config", "created_at", "customdata", "devices", "href", "id", "invitations", "max_devices", "members", "memberships", "name", "network_status", "organization", "payment_method", "ssh_keys", "tags", "type", "updated_at", "url", "volumes"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'vmce']): + raise ValueError("must be one of enum values ('default', 'vmce')") + return value + + 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 Project 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of bgp_config + if self.bgp_config: + _dict['bgp_config'] = self.bgp_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in devices (list) + _items = [] + if self.devices: + for _item in self.devices: + if _item: + _items.append(_item.to_dict()) + _dict['devices'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in invitations (list) + _items = [] + if self.invitations: + for _item in self.invitations: + if _item: + _items.append(_item.to_dict()) + _dict['invitations'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in members (list) + _items = [] + if self.members: + for _item in self.members: + if _item: + _items.append(_item.to_dict()) + _dict['members'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in memberships (list) + _items = [] + if self.memberships: + for _item in self.memberships: + if _item: + _items.append(_item.to_dict()) + _dict['memberships'] = _items + # override the default output from pydantic by calling `to_dict()` of organization + if self.organization: + _dict['organization'] = self.organization.to_dict() + # override the default output from pydantic by calling `to_dict()` of payment_method + if self.payment_method: + _dict['payment_method'] = self.payment_method.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in ssh_keys (list) + _items = [] + if self.ssh_keys: + for _item in self.ssh_keys: + if _item: + _items.append(_item.to_dict()) + _dict['ssh_keys'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in volumes (list) + _items = [] + if self.volumes: + for _item in self.volumes: + if _item: + _items.append(_item.to_dict()) + _dict['volumes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Project from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "backend_transfer_enabled": obj.get("backend_transfer_enabled"), + "bgp_config": Href.from_dict(obj["bgp_config"]) if obj.get("bgp_config") is not None else None, + "created_at": obj.get("created_at"), + "customdata": obj.get("customdata"), + "devices": [Href.from_dict(_item) for _item in obj["devices"]] if obj.get("devices") is not None else None, + "href": obj.get("href"), + "id": obj.get("id"), + "invitations": [Href.from_dict(_item) for _item in obj["invitations"]] if obj.get("invitations") is not None else None, + "max_devices": obj.get("max_devices"), + "members": [Href.from_dict(_item) for _item in obj["members"]] if obj.get("members") is not None else None, + "memberships": [Href.from_dict(_item) for _item in obj["memberships"]] if obj.get("memberships") is not None else None, + "name": obj.get("name"), + "network_status": obj.get("network_status"), + "organization": Href.from_dict(obj["organization"]) if obj.get("organization") is not None else None, + "payment_method": Href.from_dict(obj["payment_method"]) if obj.get("payment_method") is not None else None, + "ssh_keys": [Href.from_dict(_item) for _item in obj["ssh_keys"]] if obj.get("ssh_keys") is not None else None, + "tags": obj.get("tags"), + "type": obj.get("type"), + "updated_at": obj.get("updated_at"), + "url": obj.get("url"), + "volumes": [Href.from_dict(_item) for _item in obj["volumes"]] if obj.get("volumes") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/project_create_from_root_input.py b/equinix/services/metalv1/models/project_create_from_root_input.py new file mode 100644 index 00000000..2e237aab --- /dev/null +++ b/equinix/services/metalv1/models/project_create_from_root_input.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ProjectCreateFromRootInput(BaseModel): + """ + ProjectCreateFromRootInput + """ # noqa: E501 + customdata: Optional[Dict[str, Any]] = None + href: Optional[StrictStr] = None + name: Annotated[str, Field(min_length=1, strict=True, max_length=80)] = Field(description="The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis.") + organization_id: Optional[StrictStr] = None + payment_method_id: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + type: Optional[StrictStr] = Field(default=None, description="The type of the project. If no type is specified the project type will automatically be `default` Projects of type 'vmce' are part of an in development feature and not available to all customers.") + __properties: ClassVar[List[str]] = ["customdata", "href", "name", "organization_id", "payment_method_id", "tags", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'vmce']): + raise ValueError("must be one of enum values ('default', 'vmce')") + return value + + 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 ProjectCreateFromRootInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectCreateFromRootInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "customdata": obj.get("customdata"), + "href": obj.get("href"), + "name": obj.get("name"), + "organization_id": obj.get("organization_id"), + "payment_method_id": obj.get("payment_method_id"), + "tags": obj.get("tags"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/project_create_input.py b/equinix/services/metalv1/models/project_create_input.py new file mode 100644 index 00000000..8ae58a46 --- /dev/null +++ b/equinix/services/metalv1/models/project_create_input.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ProjectCreateInput(BaseModel): + """ + ProjectCreateInput + """ # noqa: E501 + customdata: Optional[Dict[str, Any]] = None + href: Optional[StrictStr] = None + name: Annotated[str, Field(min_length=1, strict=True, max_length=80)] = Field(description="The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis.") + payment_method_id: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + type: Optional[StrictStr] = Field(default=None, description="The type of the project. If no type is specified the project type will automatically be `default` Projects of type 'vmce' are part of an in development feature and not available to all customers.") + __properties: ClassVar[List[str]] = ["customdata", "href", "name", "payment_method_id", "tags", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'vmce']): + raise ValueError("must be one of enum values ('default', 'vmce')") + return value + + 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 ProjectCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "customdata": obj.get("customdata"), + "href": obj.get("href"), + "name": obj.get("name"), + "payment_method_id": obj.get("payment_method_id"), + "tags": obj.get("tags"), + "type": obj.get("type") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/project_id_name.py b/equinix/services/metalv1/models/project_id_name.py new file mode 100644 index 00000000..f9be3d2c --- /dev/null +++ b/equinix/services/metalv1/models/project_id_name.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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 ProjectIdName(BaseModel): + """ + ProjectIdName + """ # noqa: E501 + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["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 ProjectIdName 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectIdName 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"), + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/project_list.py b/equinix/services/metalv1/models/project_list.py new file mode 100644 index 00000000..0134c729 --- /dev/null +++ b/equinix/services/metalv1/models/project_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.meta import Meta +from equinix.services.metalv1.models.project import Project +from typing import Optional, Set +from typing_extensions import Self + +class ProjectList(BaseModel): + """ + ProjectList + """ # noqa: E501 + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + projects: Optional[List[Project]] = None + __properties: ClassVar[List[str]] = ["href", "meta", "projects"] + + 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 ProjectList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in projects (list) + _items = [] + if self.projects: + for _item in self.projects: + if _item: + _items.append(_item.to_dict()) + _dict['projects'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectList 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"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "projects": [Project.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/project_update_input.py b/equinix/services/metalv1/models/project_update_input.py new file mode 100644 index 00000000..7c9488d5 --- /dev/null +++ b/equinix/services/metalv1/models/project_update_input.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ProjectUpdateInput(BaseModel): + """ + ProjectUpdateInput + """ # noqa: E501 + backend_transfer_enabled: Optional[StrictBool] = None + customdata: Optional[Dict[str, Any]] = None + href: Optional[StrictStr] = None + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=80)]] = Field(default=None, description="The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis.") + payment_method_id: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["backend_transfer_enabled", "customdata", "href", "name", "payment_method_id", "tags"] + + 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 ProjectUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "backend_transfer_enabled": obj.get("backend_transfer_enabled"), + "customdata": obj.get("customdata"), + "href": obj.get("href"), + "name": obj.get("name"), + "payment_method_id": obj.get("payment_method_id"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/project_usage.py b/equinix/services/metalv1/models/project_usage.py new file mode 100644 index 00000000..5e9538ab --- /dev/null +++ b/equinix/services/metalv1/models/project_usage.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Metal API + + 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 ProjectUsage(BaseModel): + """ + ProjectUsage + """ # noqa: E501 + facility: Optional[StrictStr] = None + href: Optional[StrictStr] = None + name: Optional[StrictStr] = None + plan: Optional[StrictStr] = None + plan_version: Optional[StrictStr] = None + price: Optional[StrictStr] = None + quantity: Optional[StrictStr] = None + total: Optional[StrictStr] = None + type: Optional[StrictStr] = None + unit: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["facility", "href", "name", "plan", "plan_version", "price", "quantity", "total", "type", "unit"] + + 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 ProjectUsage 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectUsage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "facility": obj.get("facility"), + "href": obj.get("href"), + "name": obj.get("name"), + "plan": obj.get("plan"), + "plan_version": obj.get("plan_version"), + "price": obj.get("price"), + "quantity": obj.get("quantity"), + "total": obj.get("total"), + "type": obj.get("type"), + "unit": obj.get("unit") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/project_usage_list.py b/equinix/services/metalv1/models/project_usage_list.py new file mode 100644 index 00000000..d5ebc0f0 --- /dev/null +++ b/equinix/services/metalv1/models/project_usage_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.project_usage import ProjectUsage +from typing import Optional, Set +from typing_extensions import Self + +class ProjectUsageList(BaseModel): + """ + ProjectUsageList + """ # noqa: E501 + href: Optional[StrictStr] = None + usages: Optional[List[ProjectUsage]] = None + __properties: ClassVar[List[str]] = ["href", "usages"] + + 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 ProjectUsageList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 usages (list) + _items = [] + if self.usages: + for _item in self.usages: + if _item: + _items.append(_item.to_dict()) + _dict['usages'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectUsageList 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"), + "usages": [ProjectUsage.from_dict(_item) for _item in obj["usages"]] if obj.get("usages") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/raid.py b/equinix/services/metalv1/models/raid.py new file mode 100644 index 00000000..11b1f6a7 --- /dev/null +++ b/equinix/services/metalv1/models/raid.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 Raid(BaseModel): + """ + Raid + """ # noqa: E501 + devices: Optional[List[StrictStr]] = None + href: Optional[StrictStr] = None + level: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["devices", "href", "level", "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 Raid 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Raid from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "devices": obj.get("devices"), + "href": obj.get("href"), + "level": obj.get("level"), + "name": obj.get("name") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/recovery_code_list.py b/equinix/services/metalv1/models/recovery_code_list.py new file mode 100644 index 00000000..f90563ee --- /dev/null +++ b/equinix/services/metalv1/models/recovery_code_list.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 RecoveryCodeList(BaseModel): + """ + RecoveryCodeList + """ # noqa: E501 + href: Optional[StrictStr] = None + recovery_codes: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["href", "recovery_codes"] + + 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 RecoveryCodeList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RecoveryCodeList 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"), + "recovery_codes": obj.get("recovery_codes") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/request_ip_reservation201_response.py b/equinix/services/metalv1/models/request_ip_reservation201_response.py new file mode 100644 index 00000000..79ea3ac2 --- /dev/null +++ b/equinix/services/metalv1/models/request_ip_reservation201_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.ip_reservation import IPReservation +from equinix.services.metalv1.models.vrf_ip_reservation import VrfIpReservation +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +REQUESTIPRESERVATION201RESPONSE_ONE_OF_SCHEMAS = ["IPReservation", "VrfIpReservation"] + +class RequestIPReservation201Response(BaseModel): + """ + RequestIPReservation201Response + """ + # data type: IPReservation + oneof_schema_1_validator: Optional[IPReservation] = None + # data type: VrfIpReservation + oneof_schema_2_validator: Optional[VrfIpReservation] = None + actual_instance: Optional[Union[IPReservation, VrfIpReservation]] = None + one_of_schemas: List[str] = Field(default=Literal["IPReservation", "VrfIpReservation"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = RequestIPReservation201Response.model_construct() + error_messages = [] + match = 0 + # validate data type: IPReservation + if not isinstance(v, IPReservation): + error_messages.append(f"Error! Input type `{type(v)}` is not `IPReservation`") + else: + match += 1 + # validate data type: VrfIpReservation + if not isinstance(v, VrfIpReservation): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfIpReservation`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in RequestIPReservation201Response with oneOf schemas: IPReservation, VrfIpReservation. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in RequestIPReservation201Response with oneOf schemas: IPReservation, VrfIpReservation. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into IPReservation + try: + instance.actual_instance = IPReservation.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VrfIpReservation + try: + instance.actual_instance = VrfIpReservation.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into RequestIPReservation201Response with oneOf schemas: IPReservation, VrfIpReservation. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into RequestIPReservation201Response with oneOf schemas: IPReservation, VrfIpReservation. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], IPReservation, VrfIpReservation]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/request_ip_reservation_request.py b/equinix/services/metalv1/models/request_ip_reservation_request.py new file mode 100644 index 00000000..4af04179 --- /dev/null +++ b/equinix/services/metalv1/models/request_ip_reservation_request.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.ip_reservation_request_input import IPReservationRequestInput +from equinix.services.metalv1.models.vrf_ip_reservation_create_input import VrfIpReservationCreateInput +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +REQUESTIPRESERVATIONREQUEST_ONE_OF_SCHEMAS = ["IPReservationRequestInput", "VrfIpReservationCreateInput"] + +class RequestIPReservationRequest(BaseModel): + """ + RequestIPReservationRequest + """ + # data type: IPReservationRequestInput + oneof_schema_1_validator: Optional[IPReservationRequestInput] = None + # data type: VrfIpReservationCreateInput + oneof_schema_2_validator: Optional[VrfIpReservationCreateInput] = None + actual_instance: Optional[Union[IPReservationRequestInput, VrfIpReservationCreateInput]] = None + one_of_schemas: List[str] = Field(default=Literal["IPReservationRequestInput", "VrfIpReservationCreateInput"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = RequestIPReservationRequest.model_construct() + error_messages = [] + match = 0 + # validate data type: IPReservationRequestInput + if not isinstance(v, IPReservationRequestInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `IPReservationRequestInput`") + else: + match += 1 + # validate data type: VrfIpReservationCreateInput + if not isinstance(v, VrfIpReservationCreateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfIpReservationCreateInput`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in RequestIPReservationRequest with oneOf schemas: IPReservationRequestInput, VrfIpReservationCreateInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in RequestIPReservationRequest with oneOf schemas: IPReservationRequestInput, VrfIpReservationCreateInput. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into IPReservationRequestInput + try: + instance.actual_instance = IPReservationRequestInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VrfIpReservationCreateInput + try: + instance.actual_instance = VrfIpReservationCreateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into RequestIPReservationRequest with oneOf schemas: IPReservationRequestInput, VrfIpReservationCreateInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into RequestIPReservationRequest with oneOf schemas: IPReservationRequestInput, VrfIpReservationCreateInput. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], IPReservationRequestInput, VrfIpReservationCreateInput]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/self_service_reservation_item_request.py b/equinix/services/metalv1/models/self_service_reservation_item_request.py new file mode 100644 index 00000000..14e4956f --- /dev/null +++ b/equinix/services/metalv1/models/self_service_reservation_item_request.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 SelfServiceReservationItemRequest(BaseModel): + """ + SelfServiceReservationItemRequest + """ # noqa: E501 + href: Optional[StrictStr] = None + metro_id: Optional[StrictStr] = Field(default=None, description="Metro ID of the item.") + plan_id: Optional[StrictStr] = Field(default=None, description="Plan ID of the item.") + quantity: Optional[StrictInt] = Field(default=None, description="Number of items.") + term: Optional[StrictStr] = Field(default=None, description="Contract term of the item.") + __properties: ClassVar[List[str]] = ["href", "metro_id", "plan_id", "quantity", "term"] + + 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 SelfServiceReservationItemRequest 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SelfServiceReservationItemRequest 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"), + "metro_id": obj.get("metro_id"), + "plan_id": obj.get("plan_id"), + "quantity": obj.get("quantity"), + "term": obj.get("term") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/self_service_reservation_item_response.py b/equinix/services/metalv1/models/self_service_reservation_item_response.py new file mode 100644 index 00000000..45a14a87 --- /dev/null +++ b/equinix/services/metalv1/models/self_service_reservation_item_response.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.plan import Plan +from typing import Optional, Set +from typing_extensions import Self + +class SelfServiceReservationItemResponse(BaseModel): + """ + SelfServiceReservationItemResponse + """ # noqa: E501 + amount: Optional[Union[StrictFloat, StrictInt]] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + metro_code: Optional[StrictStr] = None + metro_id: Optional[StrictStr] = None + metro_name: Optional[StrictStr] = None + plan: Optional[Plan] = None + plan_categories: Optional[List[StrictStr]] = None + plan_id: Optional[StrictStr] = None + plan_name: Optional[StrictStr] = None + plan_slug: Optional[StrictStr] = None + quantity: Optional[StrictInt] = None + term: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["amount", "href", "id", "metro_code", "metro_id", "metro_name", "plan", "plan_categories", "plan_id", "plan_name", "plan_slug", "quantity", "term"] + + 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 SelfServiceReservationItemResponse 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of plan + if self.plan: + _dict['plan'] = self.plan.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SelfServiceReservationItemResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "amount": obj.get("amount"), + "href": obj.get("href"), + "id": obj.get("id"), + "metro_code": obj.get("metro_code"), + "metro_id": obj.get("metro_id"), + "metro_name": obj.get("metro_name"), + "plan": Plan.from_dict(obj["plan"]) if obj.get("plan") is not None else None, + "plan_categories": obj.get("plan_categories"), + "plan_id": obj.get("plan_id"), + "plan_name": obj.get("plan_name"), + "plan_slug": obj.get("plan_slug"), + "quantity": obj.get("quantity"), + "term": obj.get("term") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/self_service_reservation_list.py b/equinix/services/metalv1/models/self_service_reservation_list.py new file mode 100644 index 00000000..a6de3e1c --- /dev/null +++ b/equinix/services/metalv1/models/self_service_reservation_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.self_service_reservation_response import SelfServiceReservationResponse +from typing import Optional, Set +from typing_extensions import Self + +class SelfServiceReservationList(BaseModel): + """ + SelfServiceReservationList + """ # noqa: E501 + href: Optional[StrictStr] = None + reservations: Optional[List[SelfServiceReservationResponse]] = None + __properties: ClassVar[List[str]] = ["href", "reservations"] + + 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 SelfServiceReservationList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 reservations (list) + _items = [] + if self.reservations: + for _item in self.reservations: + if _item: + _items.append(_item.to_dict()) + _dict['reservations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SelfServiceReservationList 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"), + "reservations": [SelfServiceReservationResponse.from_dict(_item) for _item in obj["reservations"]] if obj.get("reservations") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/self_service_reservation_response.py b/equinix/services/metalv1/models/self_service_reservation_response.py new file mode 100644 index 00000000..1e82abad --- /dev/null +++ b/equinix/services/metalv1/models/self_service_reservation_response.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.create_self_service_reservation_request_period import CreateSelfServiceReservationRequestPeriod +from equinix.services.metalv1.models.self_service_reservation_item_response import SelfServiceReservationItemResponse +from typing import Optional, Set +from typing_extensions import Self + +class SelfServiceReservationResponse(BaseModel): + """ + SelfServiceReservationResponse + """ # noqa: E501 + created_at: Optional[datetime] = None + href: Optional[StrictStr] = None + item: Optional[List[SelfServiceReservationItemResponse]] = None + notes: Optional[StrictStr] = None + organization: Optional[StrictStr] = None + organization_id: Optional[StrictStr] = None + period: Optional[CreateSelfServiceReservationRequestPeriod] = None + project: Optional[StrictStr] = None + project_id: Optional[StrictStr] = None + start_date: Optional[datetime] = None + status: Optional[StrictStr] = None + total_cost: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["created_at", "href", "item", "notes", "organization", "organization_id", "period", "project", "project_id", "start_date", "status", "total_cost"] + + 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 SelfServiceReservationResponse 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 item (list) + _items = [] + if self.item: + for _item in self.item: + if _item: + _items.append(_item.to_dict()) + _dict['item'] = _items + # override the default output from pydantic by calling `to_dict()` of period + if self.period: + _dict['period'] = self.period.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SelfServiceReservationResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "href": obj.get("href"), + "item": [SelfServiceReservationItemResponse.from_dict(_item) for _item in obj["item"]] if obj.get("item") is not None else None, + "notes": obj.get("notes"), + "organization": obj.get("organization"), + "organization_id": obj.get("organization_id"), + "period": CreateSelfServiceReservationRequestPeriod.from_dict(obj["period"]) if obj.get("period") is not None else None, + "project": obj.get("project"), + "project_id": obj.get("project_id"), + "start_date": obj.get("start_date"), + "status": obj.get("status"), + "total_cost": obj.get("total_cost") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/server_info.py b/equinix/services/metalv1/models/server_info.py new file mode 100644 index 00000000..719cc6a1 --- /dev/null +++ b/equinix/services/metalv1/models/server_info.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class ServerInfo(BaseModel): + """ + ServerInfo + """ # noqa: E501 + facility: Optional[StrictStr] = None + href: Optional[StrictStr] = None + metro: Optional[StrictStr] = Field(default=None, description="The metro ID or code to check the capacity in.") + plan: Optional[StrictStr] = Field(default=None, description="The plan ID or slug to check the capacity of.") + quantity: Optional[StrictStr] = Field(default=None, description="The number of servers to check the capacity of.") + __properties: ClassVar[List[str]] = ["facility", "href", "metro", "plan", "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 ServerInfo 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ServerInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "facility": obj.get("facility"), + "href": obj.get("href"), + "metro": obj.get("metro"), + "plan": obj.get("plan"), + "quantity": obj.get("quantity") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/shared_port_vc_vlan_create_input.py b/equinix/services/metalv1/models/shared_port_vc_vlan_create_input.py new file mode 100644 index 00000000..0a302215 --- /dev/null +++ b/equinix/services/metalv1/models/shared_port_vc_vlan_create_input.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SharedPortVCVlanCreateInput(BaseModel): + """ + SharedPortVCVlanCreateInput + """ # noqa: E501 + contact_email: Optional[StrictStr] = Field(default=None, description="The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key.") + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + metro: StrictStr = Field(description="A Metro ID or code. When creating 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), or shared connections, 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.") + name: StrictStr + project: StrictStr + speed: Optional[StrictStr] = Field(default=None, description="A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs.") + tags: Optional[List[StrictStr]] = None + type: StrictStr + vlans: List[StrictInt] = Field(description="A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits.") + __properties: ClassVar[List[str]] = ["contact_email", "description", "href", "metro", "name", "project", "speed", "tags", "type", "vlans"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['shared_port_vlan']): + raise ValueError("must be one of enum values ('shared_port_vlan')") + return value + + 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 SharedPortVCVlanCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SharedPortVCVlanCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "contact_email": obj.get("contact_email"), + "description": obj.get("description"), + "href": obj.get("href"), + "metro": obj.get("metro"), + "name": obj.get("name"), + "project": obj.get("project"), + "speed": obj.get("speed"), + "tags": obj.get("tags"), + "type": obj.get("type"), + "vlans": obj.get("vlans") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_market_prices_list.py b/equinix/services/metalv1/models/spot_market_prices_list.py new file mode 100644 index 00000000..9eeaef09 --- /dev/null +++ b/equinix/services/metalv1/models/spot_market_prices_list.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.spot_prices_report import SpotPricesReport +from typing import Optional, Set +from typing_extensions import Self + +class SpotMarketPricesList(BaseModel): + """ + SpotMarketPricesList + """ # noqa: E501 + href: Optional[StrictStr] = None + spot_market_prices: Optional[SpotPricesReport] = None + __properties: ClassVar[List[str]] = ["href", "spot_market_prices"] + + 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 SpotMarketPricesList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of spot_market_prices + if self.spot_market_prices: + _dict['spot_market_prices'] = self.spot_market_prices.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotMarketPricesList 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"), + "spot_market_prices": SpotPricesReport.from_dict(obj["spot_market_prices"]) if obj.get("spot_market_prices") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_market_prices_per_metro_list.py b/equinix/services/metalv1/models/spot_market_prices_per_metro_list.py new file mode 100644 index 00000000..31dfd33b --- /dev/null +++ b/equinix/services/metalv1/models/spot_market_prices_per_metro_list.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.spot_market_prices_per_metro_report import SpotMarketPricesPerMetroReport +from typing import Optional, Set +from typing_extensions import Self + +class SpotMarketPricesPerMetroList(BaseModel): + """ + SpotMarketPricesPerMetroList + """ # noqa: E501 + href: Optional[StrictStr] = None + spot_market_prices: Optional[SpotMarketPricesPerMetroReport] = None + __properties: ClassVar[List[str]] = ["href", "spot_market_prices"] + + 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 SpotMarketPricesPerMetroList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of spot_market_prices + if self.spot_market_prices: + _dict['spot_market_prices'] = self.spot_market_prices.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotMarketPricesPerMetroList 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"), + "spot_market_prices": SpotMarketPricesPerMetroReport.from_dict(obj["spot_market_prices"]) if obj.get("spot_market_prices") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_market_prices_per_metro_report.py b/equinix/services/metalv1/models/spot_market_prices_per_metro_report.py new file mode 100644 index 00000000..1e98e256 --- /dev/null +++ b/equinix/services/metalv1/models/spot_market_prices_per_metro_report.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.spot_prices_per_facility import SpotPricesPerFacility +from typing import Optional, Set +from typing_extensions import Self + +class SpotMarketPricesPerMetroReport(BaseModel): + """ + SpotMarketPricesPerMetroReport + """ # noqa: E501 + am: Optional[SpotPricesPerFacility] = None + ch: Optional[SpotPricesPerFacility] = None + da: Optional[SpotPricesPerFacility] = None + href: Optional[StrictStr] = None + la: Optional[SpotPricesPerFacility] = None + ny: Optional[SpotPricesPerFacility] = None + sg: Optional[SpotPricesPerFacility] = None + sv: Optional[SpotPricesPerFacility] = None + __properties: ClassVar[List[str]] = ["am", "ch", "da", "href", "la", "ny", "sg", "sv"] + + 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 SpotMarketPricesPerMetroReport 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of am + if self.am: + _dict['am'] = self.am.to_dict() + # override the default output from pydantic by calling `to_dict()` of ch + if self.ch: + _dict['ch'] = self.ch.to_dict() + # override the default output from pydantic by calling `to_dict()` of da + if self.da: + _dict['da'] = self.da.to_dict() + # override the default output from pydantic by calling `to_dict()` of la + if self.la: + _dict['la'] = self.la.to_dict() + # override the default output from pydantic by calling `to_dict()` of ny + if self.ny: + _dict['ny'] = self.ny.to_dict() + # override the default output from pydantic by calling `to_dict()` of sg + if self.sg: + _dict['sg'] = self.sg.to_dict() + # override the default output from pydantic by calling `to_dict()` of sv + if self.sv: + _dict['sv'] = self.sv.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotMarketPricesPerMetroReport from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "am": SpotPricesPerFacility.from_dict(obj["am"]) if obj.get("am") is not None else None, + "ch": SpotPricesPerFacility.from_dict(obj["ch"]) if obj.get("ch") is not None else None, + "da": SpotPricesPerFacility.from_dict(obj["da"]) if obj.get("da") is not None else None, + "href": obj.get("href"), + "la": SpotPricesPerFacility.from_dict(obj["la"]) if obj.get("la") is not None else None, + "ny": SpotPricesPerFacility.from_dict(obj["ny"]) if obj.get("ny") is not None else None, + "sg": SpotPricesPerFacility.from_dict(obj["sg"]) if obj.get("sg") is not None else None, + "sv": SpotPricesPerFacility.from_dict(obj["sv"]) if obj.get("sv") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_market_request.py b/equinix/services/metalv1/models/spot_market_request.py new file mode 100644 index 00000000..a14ab0cb --- /dev/null +++ b/equinix/services/metalv1/models/spot_market_request.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.spot_market_request_metro import SpotMarketRequestMetro +from typing import Optional, Set +from typing_extensions import Self + +class SpotMarketRequest(BaseModel): + """ + SpotMarketRequest + """ # noqa: E501 + created_at: Optional[datetime] = None + devices_max: Optional[StrictInt] = None + devices_min: Optional[StrictInt] = None + end_at: Optional[datetime] = None + facilities: Optional[Href] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + instances: Optional[Href] = None + max_bid_price: Optional[Union[StrictFloat, StrictInt]] = None + metro: Optional[SpotMarketRequestMetro] = None + project: Optional[Href] = None + __properties: ClassVar[List[str]] = ["created_at", "devices_max", "devices_min", "end_at", "facilities", "href", "id", "instances", "max_bid_price", "metro", "project"] + + 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 SpotMarketRequest 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of facilities + if self.facilities: + _dict['facilities'] = self.facilities.to_dict() + # override the default output from pydantic by calling `to_dict()` of instances + if self.instances: + _dict['instances'] = self.instances.to_dict() + # override the default output from pydantic by calling `to_dict()` of metro + if self.metro: + _dict['metro'] = self.metro.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotMarketRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "devices_max": obj.get("devices_max"), + "devices_min": obj.get("devices_min"), + "end_at": obj.get("end_at"), + "facilities": Href.from_dict(obj["facilities"]) if obj.get("facilities") is not None else None, + "href": obj.get("href"), + "id": obj.get("id"), + "instances": Href.from_dict(obj["instances"]) if obj.get("instances") is not None else None, + "max_bid_price": obj.get("max_bid_price"), + "metro": SpotMarketRequestMetro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "project": Href.from_dict(obj["project"]) if obj.get("project") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_market_request_create_input.py b/equinix/services/metalv1/models/spot_market_request_create_input.py new file mode 100644 index 00000000..b17c8d02 --- /dev/null +++ b/equinix/services/metalv1/models/spot_market_request_create_input.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from equinix.services.metalv1.models.spot_market_request_create_input_instance_parameters import SpotMarketRequestCreateInputInstanceParameters +from typing import Optional, Set +from typing_extensions import Self + +class SpotMarketRequestCreateInput(BaseModel): + """ + SpotMarketRequestCreateInput + """ # noqa: E501 + devices_max: Optional[StrictInt] = None + devices_min: Optional[StrictInt] = None + end_at: Optional[datetime] = None + facilities: Optional[List[StrictStr]] = None + href: Optional[StrictStr] = None + instance_parameters: Optional[SpotMarketRequestCreateInputInstanceParameters] = None + max_bid_price: Optional[Union[StrictFloat, StrictInt]] = None + metro: Optional[StrictStr] = Field(default=None, description="The metro ID or code the spot market request will be created in.") + __properties: ClassVar[List[str]] = ["devices_max", "devices_min", "end_at", "facilities", "href", "instance_parameters", "max_bid_price", "metro"] + + 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 SpotMarketRequestCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of instance_parameters + if self.instance_parameters: + _dict['instance_parameters'] = self.instance_parameters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotMarketRequestCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "devices_max": obj.get("devices_max"), + "devices_min": obj.get("devices_min"), + "end_at": obj.get("end_at"), + "facilities": obj.get("facilities"), + "href": obj.get("href"), + "instance_parameters": SpotMarketRequestCreateInputInstanceParameters.from_dict(obj["instance_parameters"]) if obj.get("instance_parameters") is not None else None, + "max_bid_price": obj.get("max_bid_price"), + "metro": obj.get("metro") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_market_request_create_input_instance_parameters.py b/equinix/services/metalv1/models/spot_market_request_create_input_instance_parameters.py new file mode 100644 index 00000000..0ad4d979 --- /dev/null +++ b/equinix/services/metalv1/models/spot_market_request_create_input_instance_parameters.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SpotMarketRequestCreateInputInstanceParameters(BaseModel): + """ + SpotMarketRequestCreateInputInstanceParameters + """ # noqa: E501 + always_pxe: Optional[StrictBool] = None + billing_cycle: Optional[StrictStr] = None + customdata: Optional[Dict[str, Any]] = None + description: Optional[StrictStr] = None + features: Optional[List[StrictStr]] = None + hostname: Optional[StrictStr] = None + hostnames: Optional[List[StrictStr]] = None + href: Optional[StrictStr] = None + locked: Optional[StrictBool] = Field(default=None, description="Whether the device should be locked, preventing accidental deletion.") + no_ssh_keys: Optional[StrictBool] = None + operating_system: Optional[StrictStr] = None + plan: Optional[StrictStr] = None + private_ipv4_subnet_size: Optional[StrictInt] = None + project_ssh_keys: Optional[List[StrictStr]] = None + public_ipv4_subnet_size: Optional[StrictInt] = None + tags: Optional[List[StrictStr]] = None + termination_time: Optional[datetime] = None + user_ssh_keys: Optional[List[StrictStr]] = Field(default=None, description="The UUIDs of users whose SSH keys should be included on the provisioned device.") + userdata: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["always_pxe", "billing_cycle", "customdata", "description", "features", "hostname", "hostnames", "href", "locked", "no_ssh_keys", "operating_system", "plan", "private_ipv4_subnet_size", "project_ssh_keys", "public_ipv4_subnet_size", "tags", "termination_time", "user_ssh_keys", "userdata"] + + 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 SpotMarketRequestCreateInputInstanceParameters 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotMarketRequestCreateInputInstanceParameters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "always_pxe": obj.get("always_pxe"), + "billing_cycle": obj.get("billing_cycle"), + "customdata": obj.get("customdata"), + "description": obj.get("description"), + "features": obj.get("features"), + "hostname": obj.get("hostname"), + "hostnames": obj.get("hostnames"), + "href": obj.get("href"), + "locked": obj.get("locked"), + "no_ssh_keys": obj.get("no_ssh_keys"), + "operating_system": obj.get("operating_system"), + "plan": obj.get("plan"), + "private_ipv4_subnet_size": obj.get("private_ipv4_subnet_size"), + "project_ssh_keys": obj.get("project_ssh_keys"), + "public_ipv4_subnet_size": obj.get("public_ipv4_subnet_size"), + "tags": obj.get("tags"), + "termination_time": obj.get("termination_time"), + "user_ssh_keys": obj.get("user_ssh_keys"), + "userdata": obj.get("userdata") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_market_request_list.py b/equinix/services/metalv1/models/spot_market_request_list.py new file mode 100644 index 00000000..c5add3b2 --- /dev/null +++ b/equinix/services/metalv1/models/spot_market_request_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.spot_market_request import SpotMarketRequest +from typing import Optional, Set +from typing_extensions import Self + +class SpotMarketRequestList(BaseModel): + """ + SpotMarketRequestList + """ # noqa: E501 + href: Optional[StrictStr] = None + spot_market_requests: Optional[List[SpotMarketRequest]] = None + __properties: ClassVar[List[str]] = ["href", "spot_market_requests"] + + 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 SpotMarketRequestList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 spot_market_requests (list) + _items = [] + if self.spot_market_requests: + for _item in self.spot_market_requests: + if _item: + _items.append(_item.to_dict()) + _dict['spot_market_requests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotMarketRequestList 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"), + "spot_market_requests": [SpotMarketRequest.from_dict(_item) for _item in obj["spot_market_requests"]] if obj.get("spot_market_requests") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_market_request_metro.py b/equinix/services/metalv1/models/spot_market_request_metro.py new file mode 100644 index 00000000..00326492 --- /dev/null +++ b/equinix/services/metalv1/models/spot_market_request_metro.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 SpotMarketRequestMetro(BaseModel): + """ + SpotMarketRequestMetro + """ # noqa: E501 + code: Optional[StrictStr] = None + country: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __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 SpotMarketRequestMetro 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotMarketRequestMetro 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") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_prices_datapoints.py b/equinix/services/metalv1/models/spot_prices_datapoints.py new file mode 100644 index 00000000..281a3552 --- /dev/null +++ b/equinix/services/metalv1/models/spot_prices_datapoints.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class SpotPricesDatapoints(BaseModel): + """ + SpotPricesDatapoints + """ # noqa: E501 + datapoints: Optional[List[List[Union[StrictFloat, StrictInt]]]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["datapoints", "href"] + + 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 SpotPricesDatapoints 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotPricesDatapoints from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "datapoints": obj.get("datapoints"), + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_prices_history_report.py b/equinix/services/metalv1/models/spot_prices_history_report.py new file mode 100644 index 00000000..b0447ecc --- /dev/null +++ b/equinix/services/metalv1/models/spot_prices_history_report.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.spot_prices_datapoints import SpotPricesDatapoints +from typing import Optional, Set +from typing_extensions import Self + +class SpotPricesHistoryReport(BaseModel): + """ + SpotPricesHistoryReport + """ # noqa: E501 + href: Optional[StrictStr] = None + prices_history: Optional[SpotPricesDatapoints] = None + __properties: ClassVar[List[str]] = ["href", "prices_history"] + + 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 SpotPricesHistoryReport 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of prices_history + if self.prices_history: + _dict['prices_history'] = self.prices_history.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotPricesHistoryReport 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"), + "prices_history": SpotPricesDatapoints.from_dict(obj["prices_history"]) if obj.get("prices_history") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_prices_per_baremetal.py b/equinix/services/metalv1/models/spot_prices_per_baremetal.py new file mode 100644 index 00000000..705f81bf --- /dev/null +++ b/equinix/services/metalv1/models/spot_prices_per_baremetal.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class SpotPricesPerBaremetal(BaseModel): + """ + SpotPricesPerBaremetal + """ # noqa: E501 + href: Optional[StrictStr] = None + price: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["href", "price"] + + 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 SpotPricesPerBaremetal 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotPricesPerBaremetal 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"), + "price": obj.get("price") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_prices_per_facility.py b/equinix/services/metalv1/models/spot_prices_per_facility.py new file mode 100644 index 00000000..ad534839 --- /dev/null +++ b/equinix/services/metalv1/models/spot_prices_per_facility.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_prices_per_baremetal import SpotPricesPerBaremetal +from typing import Optional, Set +from typing_extensions import Self + +class SpotPricesPerFacility(BaseModel): + """ + SpotPricesPerFacility + """ # noqa: E501 + baremetal_0: Optional[SpotPricesPerBaremetal] = None + baremetal_1: Optional[SpotPricesPerBaremetal] = None + baremetal_2: Optional[SpotPricesPerBaremetal] = None + baremetal_2a: Optional[SpotPricesPerBaremetal] = None + baremetal_2a2: Optional[SpotPricesPerBaremetal] = None + baremetal_3: Optional[SpotPricesPerBaremetal] = None + baremetal_s: Optional[SpotPricesPerBaremetal] = None + c2_medium_x86: Optional[SpotPricesPerBaremetal] = Field(default=None, alias="c2.medium.x86") + href: Optional[StrictStr] = None + m2_xlarge_x86: Optional[SpotPricesPerBaremetal] = Field(default=None, alias="m2.xlarge.x86") + __properties: ClassVar[List[str]] = ["baremetal_0", "baremetal_1", "baremetal_2", "baremetal_2a", "baremetal_2a2", "baremetal_3", "baremetal_s", "c2.medium.x86", "href", "m2.xlarge.x86"] + + 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 SpotPricesPerFacility 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of baremetal_0 + if self.baremetal_0: + _dict['baremetal_0'] = self.baremetal_0.to_dict() + # override the default output from pydantic by calling `to_dict()` of baremetal_1 + if self.baremetal_1: + _dict['baremetal_1'] = self.baremetal_1.to_dict() + # override the default output from pydantic by calling `to_dict()` of baremetal_2 + if self.baremetal_2: + _dict['baremetal_2'] = self.baremetal_2.to_dict() + # override the default output from pydantic by calling `to_dict()` of baremetal_2a + if self.baremetal_2a: + _dict['baremetal_2a'] = self.baremetal_2a.to_dict() + # override the default output from pydantic by calling `to_dict()` of baremetal_2a2 + if self.baremetal_2a2: + _dict['baremetal_2a2'] = self.baremetal_2a2.to_dict() + # override the default output from pydantic by calling `to_dict()` of baremetal_3 + if self.baremetal_3: + _dict['baremetal_3'] = self.baremetal_3.to_dict() + # override the default output from pydantic by calling `to_dict()` of baremetal_s + if self.baremetal_s: + _dict['baremetal_s'] = self.baremetal_s.to_dict() + # override the default output from pydantic by calling `to_dict()` of c2_medium_x86 + if self.c2_medium_x86: + _dict['c2.medium.x86'] = self.c2_medium_x86.to_dict() + # override the default output from pydantic by calling `to_dict()` of m2_xlarge_x86 + if self.m2_xlarge_x86: + _dict['m2.xlarge.x86'] = self.m2_xlarge_x86.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotPricesPerFacility from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "baremetal_0": SpotPricesPerBaremetal.from_dict(obj["baremetal_0"]) if obj.get("baremetal_0") is not None else None, + "baremetal_1": SpotPricesPerBaremetal.from_dict(obj["baremetal_1"]) if obj.get("baremetal_1") is not None else None, + "baremetal_2": SpotPricesPerBaremetal.from_dict(obj["baremetal_2"]) if obj.get("baremetal_2") is not None else None, + "baremetal_2a": SpotPricesPerBaremetal.from_dict(obj["baremetal_2a"]) if obj.get("baremetal_2a") is not None else None, + "baremetal_2a2": SpotPricesPerBaremetal.from_dict(obj["baremetal_2a2"]) if obj.get("baremetal_2a2") is not None else None, + "baremetal_3": SpotPricesPerBaremetal.from_dict(obj["baremetal_3"]) if obj.get("baremetal_3") is not None else None, + "baremetal_s": SpotPricesPerBaremetal.from_dict(obj["baremetal_s"]) if obj.get("baremetal_s") is not None else None, + "c2.medium.x86": SpotPricesPerBaremetal.from_dict(obj["c2.medium.x86"]) if obj.get("c2.medium.x86") is not None else None, + "href": obj.get("href"), + "m2.xlarge.x86": SpotPricesPerBaremetal.from_dict(obj["m2.xlarge.x86"]) if obj.get("m2.xlarge.x86") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_prices_per_new_facility.py b/equinix/services/metalv1/models/spot_prices_per_new_facility.py new file mode 100644 index 00000000..9ecee404 --- /dev/null +++ b/equinix/services/metalv1/models/spot_prices_per_new_facility.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.spot_prices_per_baremetal import SpotPricesPerBaremetal +from typing import Optional, Set +from typing_extensions import Self + +class SpotPricesPerNewFacility(BaseModel): + """ + SpotPricesPerNewFacility + """ # noqa: E501 + baremetal_1e: Optional[SpotPricesPerBaremetal] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["baremetal_1e", "href"] + + 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 SpotPricesPerNewFacility 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of baremetal_1e + if self.baremetal_1e: + _dict['baremetal_1e'] = self.baremetal_1e.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotPricesPerNewFacility from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "baremetal_1e": SpotPricesPerBaremetal.from_dict(obj["baremetal_1e"]) if obj.get("baremetal_1e") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/spot_prices_report.py b/equinix/services/metalv1/models/spot_prices_report.py new file mode 100644 index 00000000..5892847f --- /dev/null +++ b/equinix/services/metalv1/models/spot_prices_report.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.spot_prices_per_facility import SpotPricesPerFacility +from equinix.services.metalv1.models.spot_prices_per_new_facility import SpotPricesPerNewFacility +from typing import Optional, Set +from typing_extensions import Self + +class SpotPricesReport(BaseModel): + """ + SpotPricesReport + """ # noqa: E501 + ams1: Optional[SpotPricesPerFacility] = None + atl1: Optional[SpotPricesPerNewFacility] = None + dfw1: Optional[SpotPricesPerNewFacility] = None + ewr1: Optional[SpotPricesPerFacility] = None + fra1: Optional[SpotPricesPerNewFacility] = None + href: Optional[StrictStr] = None + iad1: Optional[SpotPricesPerNewFacility] = None + lax1: Optional[SpotPricesPerNewFacility] = None + nrt1: Optional[SpotPricesPerFacility] = None + ord1: Optional[SpotPricesPerNewFacility] = None + sea1: Optional[SpotPricesPerNewFacility] = None + sin1: Optional[SpotPricesPerNewFacility] = None + sjc1: Optional[SpotPricesPerFacility] = None + syd1: Optional[SpotPricesPerNewFacility] = None + yyz1: Optional[SpotPricesPerNewFacility] = None + __properties: ClassVar[List[str]] = ["ams1", "atl1", "dfw1", "ewr1", "fra1", "href", "iad1", "lax1", "nrt1", "ord1", "sea1", "sin1", "sjc1", "syd1", "yyz1"] + + 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 SpotPricesReport 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of ams1 + if self.ams1: + _dict['ams1'] = self.ams1.to_dict() + # override the default output from pydantic by calling `to_dict()` of atl1 + if self.atl1: + _dict['atl1'] = self.atl1.to_dict() + # override the default output from pydantic by calling `to_dict()` of dfw1 + if self.dfw1: + _dict['dfw1'] = self.dfw1.to_dict() + # override the default output from pydantic by calling `to_dict()` of ewr1 + if self.ewr1: + _dict['ewr1'] = self.ewr1.to_dict() + # override the default output from pydantic by calling `to_dict()` of fra1 + if self.fra1: + _dict['fra1'] = self.fra1.to_dict() + # override the default output from pydantic by calling `to_dict()` of iad1 + if self.iad1: + _dict['iad1'] = self.iad1.to_dict() + # override the default output from pydantic by calling `to_dict()` of lax1 + if self.lax1: + _dict['lax1'] = self.lax1.to_dict() + # override the default output from pydantic by calling `to_dict()` of nrt1 + if self.nrt1: + _dict['nrt1'] = self.nrt1.to_dict() + # override the default output from pydantic by calling `to_dict()` of ord1 + if self.ord1: + _dict['ord1'] = self.ord1.to_dict() + # override the default output from pydantic by calling `to_dict()` of sea1 + if self.sea1: + _dict['sea1'] = self.sea1.to_dict() + # override the default output from pydantic by calling `to_dict()` of sin1 + if self.sin1: + _dict['sin1'] = self.sin1.to_dict() + # override the default output from pydantic by calling `to_dict()` of sjc1 + if self.sjc1: + _dict['sjc1'] = self.sjc1.to_dict() + # override the default output from pydantic by calling `to_dict()` of syd1 + if self.syd1: + _dict['syd1'] = self.syd1.to_dict() + # override the default output from pydantic by calling `to_dict()` of yyz1 + if self.yyz1: + _dict['yyz1'] = self.yyz1.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotPricesReport from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ams1": SpotPricesPerFacility.from_dict(obj["ams1"]) if obj.get("ams1") is not None else None, + "atl1": SpotPricesPerNewFacility.from_dict(obj["atl1"]) if obj.get("atl1") is not None else None, + "dfw1": SpotPricesPerNewFacility.from_dict(obj["dfw1"]) if obj.get("dfw1") is not None else None, + "ewr1": SpotPricesPerFacility.from_dict(obj["ewr1"]) if obj.get("ewr1") is not None else None, + "fra1": SpotPricesPerNewFacility.from_dict(obj["fra1"]) if obj.get("fra1") is not None else None, + "href": obj.get("href"), + "iad1": SpotPricesPerNewFacility.from_dict(obj["iad1"]) if obj.get("iad1") is not None else None, + "lax1": SpotPricesPerNewFacility.from_dict(obj["lax1"]) if obj.get("lax1") is not None else None, + "nrt1": SpotPricesPerFacility.from_dict(obj["nrt1"]) if obj.get("nrt1") is not None else None, + "ord1": SpotPricesPerNewFacility.from_dict(obj["ord1"]) if obj.get("ord1") is not None else None, + "sea1": SpotPricesPerNewFacility.from_dict(obj["sea1"]) if obj.get("sea1") is not None else None, + "sin1": SpotPricesPerNewFacility.from_dict(obj["sin1"]) if obj.get("sin1") is not None else None, + "sjc1": SpotPricesPerFacility.from_dict(obj["sjc1"]) if obj.get("sjc1") is not None else None, + "syd1": SpotPricesPerNewFacility.from_dict(obj["syd1"]) if obj.get("syd1") is not None else None, + "yyz1": SpotPricesPerNewFacility.from_dict(obj["yyz1"]) if obj.get("yyz1") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ssh_key.py b/equinix/services/metalv1/models/ssh_key.py new file mode 100644 index 00000000..a4915422 --- /dev/null +++ b/equinix/services/metalv1/models/ssh_key.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class SSHKey(BaseModel): + """ + SSHKey + """ # noqa: E501 + created_at: Optional[datetime] = None + entity: Optional[Href] = None + fingerprint: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + key: Optional[StrictStr] = None + label: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["created_at", "entity", "fingerprint", "href", "id", "key", "label", "tags", "updated_at"] + + 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 SSHKey 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of entity + if self.entity: + _dict['entity'] = self.entity.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SSHKey from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "entity": Href.from_dict(obj["entity"]) if obj.get("entity") is not None else None, + "fingerprint": obj.get("fingerprint"), + "href": obj.get("href"), + "id": obj.get("id"), + "key": obj.get("key"), + "label": obj.get("label"), + "tags": obj.get("tags"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ssh_key_create_input.py b/equinix/services/metalv1/models/ssh_key_create_input.py new file mode 100644 index 00000000..e291c483 --- /dev/null +++ b/equinix/services/metalv1/models/ssh_key_create_input.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class SSHKeyCreateInput(BaseModel): + """ + SSHKeyCreateInput + """ # noqa: E501 + href: Optional[StrictStr] = None + instances_ids: Optional[List[StrictStr]] = Field(default=None, description="List of instance UUIDs to associate SSH key with, when empty array is sent all instances belonging to entity will be included") + key: Optional[StrictStr] = None + label: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["href", "instances_ids", "key", "label", "tags"] + + 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 SSHKeyCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SSHKeyCreateInput 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"), + "instances_ids": obj.get("instances_ids"), + "key": obj.get("key"), + "label": obj.get("label"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ssh_key_input.py b/equinix/services/metalv1/models/ssh_key_input.py new file mode 100644 index 00000000..daa3cc61 --- /dev/null +++ b/equinix/services/metalv1/models/ssh_key_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 SSHKeyInput(BaseModel): + """ + SSHKeyInput + """ # noqa: E501 + href: Optional[StrictStr] = None + key: Optional[StrictStr] = None + label: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["href", "key", "label", "tags"] + + 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 SSHKeyInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SSHKeyInput 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"), + "key": obj.get("key"), + "label": obj.get("label"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/ssh_key_list.py b/equinix/services/metalv1/models/ssh_key_list.py new file mode 100644 index 00000000..6b462710 --- /dev/null +++ b/equinix/services/metalv1/models/ssh_key_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.ssh_key import SSHKey +from typing import Optional, Set +from typing_extensions import Self + +class SSHKeyList(BaseModel): + """ + SSHKeyList + """ # noqa: E501 + href: Optional[StrictStr] = None + ssh_keys: Optional[List[SSHKey]] = None + __properties: ClassVar[List[str]] = ["href", "ssh_keys"] + + 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 SSHKeyList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 ssh_keys (list) + _items = [] + if self.ssh_keys: + for _item in self.ssh_keys: + if _item: + _items.append(_item.to_dict()) + _dict['ssh_keys'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SSHKeyList 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"), + "ssh_keys": [SSHKey.from_dict(_item) for _item in obj["ssh_keys"]] if obj.get("ssh_keys") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/storage.py b/equinix/services/metalv1/models/storage.py new file mode 100644 index 00000000..418fa96d --- /dev/null +++ b/equinix/services/metalv1/models/storage.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.disk import Disk +from equinix.services.metalv1.models.filesystem import Filesystem +from equinix.services.metalv1.models.raid import Raid +from typing import Optional, Set +from typing_extensions import Self + +class Storage(BaseModel): + """ + Storage + """ # noqa: E501 + disks: Optional[List[Disk]] = None + filesystems: Optional[List[Filesystem]] = None + href: Optional[StrictStr] = None + raid: Optional[List[Raid]] = None + __properties: ClassVar[List[str]] = ["disks", "filesystems", "href", "raid"] + + 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 Storage 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 disks (list) + _items = [] + if self.disks: + for _item in self.disks: + if _item: + _items.append(_item.to_dict()) + _dict['disks'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in filesystems (list) + _items = [] + if self.filesystems: + for _item in self.filesystems: + if _item: + _items.append(_item.to_dict()) + _dict['filesystems'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in raid (list) + _items = [] + if self.raid: + for _item in self.raid: + if _item: + _items.append(_item.to_dict()) + _dict['raid'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Storage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "disks": [Disk.from_dict(_item) for _item in obj["disks"]] if obj.get("disks") is not None else None, + "filesystems": [Filesystem.from_dict(_item) for _item in obj["filesystems"]] if obj.get("filesystems") is not None else None, + "href": obj.get("href"), + "raid": [Raid.from_dict(_item) for _item in obj["raid"]] if obj.get("raid") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/support_request_input.py b/equinix/services/metalv1/models/support_request_input.py new file mode 100644 index 00000000..cc66fd36 --- /dev/null +++ b/equinix/services/metalv1/models/support_request_input.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SupportRequestInput(BaseModel): + """ + SupportRequestInput + """ # noqa: E501 + device_id: Optional[StrictStr] = None + href: Optional[StrictStr] = None + message: StrictStr + priority: Optional[StrictStr] = None + project_id: Optional[StrictStr] = None + subject: StrictStr + __properties: ClassVar[List[str]] = ["device_id", "href", "message", "priority", "project_id", "subject"] + + @field_validator('priority') + def priority_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['urgent', 'high', 'medium', 'low']): + raise ValueError("must be one of enum values ('urgent', 'high', 'medium', 'low')") + return value + + 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 SupportRequestInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SupportRequestInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "device_id": obj.get("device_id"), + "href": obj.get("href"), + "message": obj.get("message"), + "priority": obj.get("priority"), + "project_id": obj.get("project_id"), + "subject": obj.get("subject") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/transfer_request.py b/equinix/services/metalv1/models/transfer_request.py new file mode 100644 index 00000000..30fc0a63 --- /dev/null +++ b/equinix/services/metalv1/models/transfer_request.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class TransferRequest(BaseModel): + """ + TransferRequest + """ # noqa: E501 + created_at: Optional[datetime] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + project: Optional[Href] = None + target_organization: Optional[Href] = None + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["created_at", "href", "id", "project", "target_organization", "updated_at"] + + 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 TransferRequest 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of target_organization + if self.target_organization: + _dict['target_organization'] = self.target_organization.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TransferRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "href": obj.get("href"), + "id": obj.get("id"), + "project": Href.from_dict(obj["project"]) if obj.get("project") is not None else None, + "target_organization": Href.from_dict(obj["target_organization"]) if obj.get("target_organization") is not None else None, + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/transfer_request_input.py b/equinix/services/metalv1/models/transfer_request_input.py new file mode 100644 index 00000000..b689b32b --- /dev/null +++ b/equinix/services/metalv1/models/transfer_request_input.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 TransferRequestInput(BaseModel): + """ + TransferRequestInput + """ # noqa: E501 + href: Optional[StrictStr] = None + target_organization_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "target_organization_id"] + + 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 TransferRequestInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TransferRequestInput 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"), + "target_organization_id": obj.get("target_organization_id") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/transfer_request_list.py b/equinix/services/metalv1/models/transfer_request_list.py new file mode 100644 index 00000000..ad3530ce --- /dev/null +++ b/equinix/services/metalv1/models/transfer_request_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.transfer_request import TransferRequest +from typing import Optional, Set +from typing_extensions import Self + +class TransferRequestList(BaseModel): + """ + TransferRequestList + """ # noqa: E501 + href: Optional[StrictStr] = None + transfers: Optional[List[TransferRequest]] = None + __properties: ClassVar[List[str]] = ["href", "transfers"] + + 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 TransferRequestList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 transfers (list) + _items = [] + if self.transfers: + for _item in self.transfers: + if _item: + _items.append(_item.to_dict()) + _dict['transfers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TransferRequestList 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"), + "transfers": [TransferRequest.from_dict(_item) for _item in obj["transfers"]] if obj.get("transfers") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/update_email_input.py b/equinix/services/metalv1/models/update_email_input.py new file mode 100644 index 00000000..c4d863b4 --- /dev/null +++ b/equinix/services/metalv1/models/update_email_input.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UpdateEmailInput(BaseModel): + """ + UpdateEmailInput + """ # noqa: E501 + default: Optional[StrictBool] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["default", "href"] + + 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 UpdateEmailInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateEmailInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "default": obj.get("default"), + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/user.py b/equinix/services/metalv1/models/user.py new file mode 100644 index 00000000..c3b142db --- /dev/null +++ b/equinix/services/metalv1/models/user.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from typing import Optional, Set +from typing_extensions import Self + +class User(BaseModel): + """ + User + """ # noqa: E501 + avatar_thumb_url: Optional[StrictStr] = None + avatar_url: Optional[StrictStr] = None + created_at: Optional[datetime] = None + customdata: Optional[Dict[str, Any]] = None + default_organization_id: Optional[StrictStr] = None + default_project_id: Optional[StrictStr] = None + email: Optional[StrictStr] = None + emails: Optional[List[Href]] = None + first_name: Optional[StrictStr] = None + fraud_score: Optional[StrictStr] = None + full_name: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + last_login_at: Optional[datetime] = None + last_name: Optional[StrictStr] = None + max_organizations: Optional[StrictInt] = None + max_projects: Optional[StrictInt] = None + phone_number: Optional[StrictStr] = None + short_id: Optional[StrictStr] = None + timezone: Optional[StrictStr] = None + two_factor_auth: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["avatar_thumb_url", "avatar_url", "created_at", "customdata", "default_organization_id", "default_project_id", "email", "emails", "first_name", "fraud_score", "full_name", "href", "id", "last_login_at", "last_name", "max_organizations", "max_projects", "phone_number", "short_id", "timezone", "two_factor_auth", "updated_at"] + + 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 User 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 emails (list) + _items = [] + if self.emails: + for _item in self.emails: + if _item: + _items.append(_item.to_dict()) + _dict['emails'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of User from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "avatar_thumb_url": obj.get("avatar_thumb_url"), + "avatar_url": obj.get("avatar_url"), + "created_at": obj.get("created_at"), + "customdata": obj.get("customdata"), + "default_organization_id": obj.get("default_organization_id"), + "default_project_id": obj.get("default_project_id"), + "email": obj.get("email"), + "emails": [Href.from_dict(_item) for _item in obj["emails"]] if obj.get("emails") is not None else None, + "first_name": obj.get("first_name"), + "fraud_score": obj.get("fraud_score"), + "full_name": obj.get("full_name"), + "href": obj.get("href"), + "id": obj.get("id"), + "last_login_at": obj.get("last_login_at"), + "last_name": obj.get("last_name"), + "max_organizations": obj.get("max_organizations"), + "max_projects": obj.get("max_projects"), + "phone_number": obj.get("phone_number"), + "short_id": obj.get("short_id"), + "timezone": obj.get("timezone"), + "two_factor_auth": obj.get("two_factor_auth"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/user_create_input.py b/equinix/services/metalv1/models/user_create_input.py new file mode 100644 index 00000000..724ee037 --- /dev/null +++ b/equinix/services/metalv1/models/user_create_input.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.email_input import EmailInput +from typing import Optional, Set +from typing_extensions import Self + +class UserCreateInput(BaseModel): + """ + UserCreateInput + """ # noqa: E501 + company_name: Optional[StrictStr] = None + company_url: Optional[StrictStr] = None + customdata: Optional[Dict[str, Any]] = None + emails: List[EmailInput] + first_name: StrictStr + href: Optional[StrictStr] = None + invitation_id: Optional[StrictStr] = None + last_name: StrictStr + level: Optional[StrictStr] = None + nonce: Optional[StrictStr] = None + password: Optional[StrictStr] = None + phone_number: Optional[StrictStr] = None + social_accounts: Optional[Dict[str, Any]] = None + timezone: Optional[StrictStr] = None + title: Optional[StrictStr] = None + two_factor_auth: Optional[StrictStr] = None + verified_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["company_name", "company_url", "customdata", "emails", "first_name", "href", "invitation_id", "last_name", "level", "nonce", "password", "phone_number", "social_accounts", "timezone", "title", "two_factor_auth", "verified_at"] + + 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 UserCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 emails (list) + _items = [] + if self.emails: + for _item in self.emails: + if _item: + _items.append(_item.to_dict()) + _dict['emails'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "company_name": obj.get("company_name"), + "company_url": obj.get("company_url"), + "customdata": obj.get("customdata"), + "emails": [EmailInput.from_dict(_item) for _item in obj["emails"]] if obj.get("emails") is not None else None, + "first_name": obj.get("first_name"), + "href": obj.get("href"), + "invitation_id": obj.get("invitation_id"), + "last_name": obj.get("last_name"), + "level": obj.get("level"), + "nonce": obj.get("nonce"), + "password": obj.get("password"), + "phone_number": obj.get("phone_number"), + "social_accounts": obj.get("social_accounts"), + "timezone": obj.get("timezone"), + "title": obj.get("title"), + "two_factor_auth": obj.get("two_factor_auth"), + "verified_at": obj.get("verified_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/user_limited.py b/equinix/services/metalv1/models/user_limited.py new file mode 100644 index 00000000..30d2ddc0 --- /dev/null +++ b/equinix/services/metalv1/models/user_limited.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class UserLimited(BaseModel): + """ + UserLimited + """ # noqa: E501 + avatar_thumb_url: Optional[StrictStr] = Field(default=None, description="Avatar thumbnail URL of the User") + avatar_url: Optional[StrictStr] = Field(default=None, description="Avatar URL of the User") + full_name: Optional[StrictStr] = Field(default=None, description="Full name of the User") + href: Optional[StrictStr] = Field(default=None, description="API URL uniquely representing the User") + id: StrictStr = Field(description="ID of the User") + __properties: ClassVar[List[str]] = ["avatar_thumb_url", "avatar_url", "full_name", "href", "id"] + + 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 UserLimited 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserLimited from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "avatar_thumb_url": obj.get("avatar_thumb_url"), + "avatar_url": obj.get("avatar_url"), + "full_name": obj.get("full_name"), + "href": obj.get("href"), + "id": obj.get("id") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/user_list.py b/equinix/services/metalv1/models/user_list.py new file mode 100644 index 00000000..f34c36da --- /dev/null +++ b/equinix/services/metalv1/models/user_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.meta import Meta +from equinix.services.metalv1.models.user import User +from typing import Optional, Set +from typing_extensions import Self + +class UserList(BaseModel): + """ + UserList + """ # noqa: E501 + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + users: Optional[List[User]] = None + __properties: ClassVar[List[str]] = ["href", "meta", "users"] + + 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 UserList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in users (list) + _items = [] + if self.users: + for _item in self.users: + if _item: + _items.append(_item.to_dict()) + _dict['users'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserList 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"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "users": [User.from_dict(_item) for _item in obj["users"]] if obj.get("users") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/user_lite.py b/equinix/services/metalv1/models/user_lite.py new file mode 100644 index 00000000..0bf461b4 --- /dev/null +++ b/equinix/services/metalv1/models/user_lite.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UserLite(BaseModel): + """ + UserLite + """ # noqa: E501 + avatar_thumb_url: Optional[StrictStr] = Field(default=None, description="Avatar thumbnail URL of the User") + created_at: Optional[datetime] = Field(default=None, description="When the user was created") + email: Optional[StrictStr] = Field(default=None, description="Primary email address of the User") + first_name: Optional[StrictStr] = Field(default=None, description="First name of the User") + full_name: Optional[StrictStr] = Field(default=None, description="Full name of the User") + href: Optional[StrictStr] = Field(default=None, description="API URL uniquely representing the User") + id: StrictStr = Field(description="ID of the User") + last_name: Optional[StrictStr] = Field(default=None, description="Last name of the User") + short_id: StrictStr = Field(description="Short ID of the User") + updated_at: Optional[datetime] = Field(default=None, description="When the user details were last updated") + __properties: ClassVar[List[str]] = ["avatar_thumb_url", "created_at", "email", "first_name", "full_name", "href", "id", "last_name", "short_id", "updated_at"] + + 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 UserLite 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserLite from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "avatar_thumb_url": obj.get("avatar_thumb_url"), + "created_at": obj.get("created_at"), + "email": obj.get("email"), + "first_name": obj.get("first_name"), + "full_name": obj.get("full_name"), + "href": obj.get("href"), + "id": obj.get("id"), + "last_name": obj.get("last_name"), + "short_id": obj.get("short_id"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/user_update_input.py b/equinix/services/metalv1/models/user_update_input.py new file mode 100644 index 00000000..831c70dd --- /dev/null +++ b/equinix/services/metalv1/models/user_update_input.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Metal API + + 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 UserUpdateInput(BaseModel): + """ + UserUpdateInput + """ # noqa: E501 + customdata: Optional[Dict[str, Any]] = None + first_name: Optional[StrictStr] = None + href: Optional[StrictStr] = None + last_name: Optional[StrictStr] = None + password: Optional[StrictStr] = None + phone_number: Optional[StrictStr] = None + timezone: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["customdata", "first_name", "href", "last_name", "password", "phone_number", "timezone"] + + 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 UserUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "customdata": obj.get("customdata"), + "first_name": obj.get("first_name"), + "href": obj.get("href"), + "last_name": obj.get("last_name"), + "password": obj.get("password"), + "phone_number": obj.get("phone_number"), + "timezone": obj.get("timezone") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/userdata.py b/equinix/services/metalv1/models/userdata.py new file mode 100644 index 00000000..a54ce086 --- /dev/null +++ b/equinix/services/metalv1/models/userdata.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 Userdata(BaseModel): + """ + Userdata + """ # noqa: E501 + href: Optional[StrictStr] = None + userdata: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "userdata"] + + 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 Userdata 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Userdata 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"), + "userdata": obj.get("userdata") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/verify_email.py b/equinix/services/metalv1/models/verify_email.py new file mode 100644 index 00000000..89ef3ded --- /dev/null +++ b/equinix/services/metalv1/models/verify_email.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class VerifyEmail(BaseModel): + """ + VerifyEmail + """ # noqa: E501 + href: Optional[StrictStr] = None + user_token: StrictStr = Field(description="User verification token") + __properties: ClassVar[List[str]] = ["href", "user_token"] + + 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 VerifyEmail 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VerifyEmail 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"), + "user_token": obj.get("user_token") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/virtual_circuit.py b/equinix/services/metalv1/models/virtual_circuit.py new file mode 100644 index 00000000..b2db7087 --- /dev/null +++ b/equinix/services/metalv1/models/virtual_circuit.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +VIRTUALCIRCUIT_ONE_OF_SCHEMAS = ["VlanVirtualCircuit", "VrfVirtualCircuit"] + +class VirtualCircuit(BaseModel): + """ + VirtualCircuit + """ + # data type: VlanVirtualCircuit + oneof_schema_1_validator: Optional[VlanVirtualCircuit] = None + # data type: VrfVirtualCircuit + oneof_schema_2_validator: Optional[VrfVirtualCircuit] = None + actual_instance: Optional[Union[VlanVirtualCircuit, VrfVirtualCircuit]] = None + one_of_schemas: List[str] = Field(default=Literal["VlanVirtualCircuit", "VrfVirtualCircuit"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = VirtualCircuit.model_construct() + error_messages = [] + match = 0 + # validate data type: VlanVirtualCircuit + if not isinstance(v, VlanVirtualCircuit): + error_messages.append(f"Error! Input type `{type(v)}` is not `VlanVirtualCircuit`") + else: + match += 1 + # validate data type: VrfVirtualCircuit + if not isinstance(v, VrfVirtualCircuit): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfVirtualCircuit`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in VirtualCircuit with oneOf schemas: VlanVirtualCircuit, VrfVirtualCircuit. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in VirtualCircuit with oneOf schemas: VlanVirtualCircuit, VrfVirtualCircuit. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into VlanVirtualCircuit + try: + instance.actual_instance = VlanVirtualCircuit.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VrfVirtualCircuit + try: + instance.actual_instance = VrfVirtualCircuit.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into VirtualCircuit with oneOf schemas: VlanVirtualCircuit, VrfVirtualCircuit. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into VirtualCircuit with oneOf schemas: VlanVirtualCircuit, VrfVirtualCircuit. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], VlanVirtualCircuit, VrfVirtualCircuit]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + +from equinix.services.metalv1.models.vlan_virtual_circuit import VlanVirtualCircuit +from equinix.services.metalv1.models.vrf_virtual_circuit import VrfVirtualCircuit +# TODO: Rewrite to not use raise_errors +VirtualCircuit.model_rebuild(raise_errors=False) + diff --git a/equinix/services/metalv1/models/virtual_circuit_create_input.py b/equinix/services/metalv1/models/virtual_circuit_create_input.py new file mode 100644 index 00000000..27617042 --- /dev/null +++ b/equinix/services/metalv1/models/virtual_circuit_create_input.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.vlan_virtual_circuit_create_input import VlanVirtualCircuitCreateInput +from equinix.services.metalv1.models.vrf_virtual_circuit_create_input import VrfVirtualCircuitCreateInput +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +VIRTUALCIRCUITCREATEINPUT_ONE_OF_SCHEMAS = ["VlanVirtualCircuitCreateInput", "VrfVirtualCircuitCreateInput"] + +class VirtualCircuitCreateInput(BaseModel): + """ + VirtualCircuitCreateInput + """ + # data type: VlanVirtualCircuitCreateInput + oneof_schema_1_validator: Optional[VlanVirtualCircuitCreateInput] = None + # data type: VrfVirtualCircuitCreateInput + oneof_schema_2_validator: Optional[VrfVirtualCircuitCreateInput] = None + actual_instance: Optional[Union[VlanVirtualCircuitCreateInput, VrfVirtualCircuitCreateInput]] = None + one_of_schemas: List[str] = Field(default=Literal["VlanVirtualCircuitCreateInput", "VrfVirtualCircuitCreateInput"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = VirtualCircuitCreateInput.model_construct() + error_messages = [] + match = 0 + # validate data type: VlanVirtualCircuitCreateInput + if not isinstance(v, VlanVirtualCircuitCreateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `VlanVirtualCircuitCreateInput`") + else: + match += 1 + # validate data type: VrfVirtualCircuitCreateInput + if not isinstance(v, VrfVirtualCircuitCreateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfVirtualCircuitCreateInput`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in VirtualCircuitCreateInput with oneOf schemas: VlanVirtualCircuitCreateInput, VrfVirtualCircuitCreateInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in VirtualCircuitCreateInput with oneOf schemas: VlanVirtualCircuitCreateInput, VrfVirtualCircuitCreateInput. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into VlanVirtualCircuitCreateInput + try: + instance.actual_instance = VlanVirtualCircuitCreateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VrfVirtualCircuitCreateInput + try: + instance.actual_instance = VrfVirtualCircuitCreateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into VirtualCircuitCreateInput with oneOf schemas: VlanVirtualCircuitCreateInput, VrfVirtualCircuitCreateInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into VirtualCircuitCreateInput with oneOf schemas: VlanVirtualCircuitCreateInput, VrfVirtualCircuitCreateInput. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], VlanVirtualCircuitCreateInput, VrfVirtualCircuitCreateInput]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/virtual_circuit_list.py b/equinix/services/metalv1/models/virtual_circuit_list.py new file mode 100644 index 00000000..38e4dea3 --- /dev/null +++ b/equinix/services/metalv1/models/virtual_circuit_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.virtual_circuit import VirtualCircuit +from typing import Optional, Set +from typing_extensions import Self + +class VirtualCircuitList(BaseModel): + """ + VirtualCircuitList + """ # noqa: E501 + href: Optional[StrictStr] = None + virtual_circuits: Optional[List[VirtualCircuit]] = None + __properties: ClassVar[List[str]] = ["href", "virtual_circuits"] + + 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 VirtualCircuitList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 virtual_circuits (list) + _items = [] + if self.virtual_circuits: + for _item in self.virtual_circuits: + if _item: + _items.append(_item.to_dict()) + _dict['virtual_circuits'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VirtualCircuitList 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"), + "virtual_circuits": [VirtualCircuit.from_dict(_item) for _item in obj["virtual_circuits"]] if obj.get("virtual_circuits") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/virtual_circuit_update_input.py b/equinix/services/metalv1/models/virtual_circuit_update_input.py new file mode 100644 index 00000000..c2705d0b --- /dev/null +++ b/equinix/services/metalv1/models/virtual_circuit_update_input.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.vlan_virtual_circuit_update_input import VlanVirtualCircuitUpdateInput +from equinix.services.metalv1.models.vrf_virtual_circuit_update_input import VrfVirtualCircuitUpdateInput +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +VIRTUALCIRCUITUPDATEINPUT_ONE_OF_SCHEMAS = ["VlanVirtualCircuitUpdateInput", "VrfVirtualCircuitUpdateInput"] + +class VirtualCircuitUpdateInput(BaseModel): + """ + VirtualCircuitUpdateInput + """ + # data type: VlanVirtualCircuitUpdateInput + oneof_schema_1_validator: Optional[VlanVirtualCircuitUpdateInput] = None + # data type: VrfVirtualCircuitUpdateInput + oneof_schema_2_validator: Optional[VrfVirtualCircuitUpdateInput] = None + actual_instance: Optional[Union[VlanVirtualCircuitUpdateInput, VrfVirtualCircuitUpdateInput]] = None + one_of_schemas: List[str] = Field(default=Literal["VlanVirtualCircuitUpdateInput", "VrfVirtualCircuitUpdateInput"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = VirtualCircuitUpdateInput.model_construct() + error_messages = [] + match = 0 + # validate data type: VlanVirtualCircuitUpdateInput + if not isinstance(v, VlanVirtualCircuitUpdateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `VlanVirtualCircuitUpdateInput`") + else: + match += 1 + # validate data type: VrfVirtualCircuitUpdateInput + if not isinstance(v, VrfVirtualCircuitUpdateInput): + error_messages.append(f"Error! Input type `{type(v)}` is not `VrfVirtualCircuitUpdateInput`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in VirtualCircuitUpdateInput with oneOf schemas: VlanVirtualCircuitUpdateInput, VrfVirtualCircuitUpdateInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in VirtualCircuitUpdateInput with oneOf schemas: VlanVirtualCircuitUpdateInput, VrfVirtualCircuitUpdateInput. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into VlanVirtualCircuitUpdateInput + try: + instance.actual_instance = VlanVirtualCircuitUpdateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into VrfVirtualCircuitUpdateInput + try: + instance.actual_instance = VrfVirtualCircuitUpdateInput.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into VirtualCircuitUpdateInput with oneOf schemas: VlanVirtualCircuitUpdateInput, VrfVirtualCircuitUpdateInput. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into VirtualCircuitUpdateInput with oneOf schemas: VlanVirtualCircuitUpdateInput, VrfVirtualCircuitUpdateInput. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], VlanVirtualCircuitUpdateInput, VrfVirtualCircuitUpdateInput]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/virtual_network.py b/equinix/services/metalv1/models/virtual_network.py new file mode 100644 index 00000000..41abf079 --- /dev/null +++ b/equinix/services/metalv1/models/virtual_network.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.metal_gateway_lite import MetalGatewayLite +from equinix.services.metalv1.models.metro import Metro +from equinix.services.metalv1.models.project import Project +from typing import Optional, Set +from typing_extensions import Self + +class VirtualNetwork(BaseModel): + """ + VirtualNetwork + """ # noqa: E501 + assigned_to: Optional[Project] = None + assigned_to_virtual_circuit: Optional[StrictBool] = Field(default=None, description="True if the virtual network is attached to a virtual circuit. False if not.") + created_at: Optional[datetime] = None + description: Optional[StrictStr] = None + facility: Optional[Href] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + instances: Optional[List[Device]] = Field(default=None, description="A list of instances with ports currently associated to this Virtual Network.") + metal_gateways: Optional[List[MetalGatewayLite]] = Field(default=None, description="A list of metal gateways currently associated to this Virtual Network.") + metro: Optional[Metro] = None + metro_code: Optional[StrictStr] = Field(default=None, description="The Metro code of the metro in which this Virtual Network is defined.") + tags: Optional[List[StrictStr]] = None + vxlan: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["assigned_to", "assigned_to_virtual_circuit", "created_at", "description", "facility", "href", "id", "instances", "metal_gateways", "metro", "metro_code", "tags", "vxlan"] + + 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 VirtualNetwork 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of assigned_to + if self.assigned_to: + _dict['assigned_to'] = self.assigned_to.to_dict() + # override the default output from pydantic by calling `to_dict()` of facility + if self.facility: + _dict['facility'] = self.facility.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in instances (list) + _items = [] + if self.instances: + for _item in self.instances: + if _item: + _items.append(_item.to_dict()) + _dict['instances'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in metal_gateways (list) + _items = [] + if self.metal_gateways: + for _item in self.metal_gateways: + if _item: + _items.append(_item.to_dict()) + _dict['metal_gateways'] = _items + # override the default output from pydantic by calling `to_dict()` of metro + if self.metro: + _dict['metro'] = self.metro.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VirtualNetwork from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "assigned_to": Project.from_dict(obj["assigned_to"]) if obj.get("assigned_to") is not None else None, + "assigned_to_virtual_circuit": obj.get("assigned_to_virtual_circuit"), + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "facility": Href.from_dict(obj["facility"]) if obj.get("facility") is not None else None, + "href": obj.get("href"), + "id": obj.get("id"), + "instances": [Device.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None, + "metal_gateways": [MetalGatewayLite.from_dict(_item) for _item in obj["metal_gateways"]] if obj.get("metal_gateways") is not None else None, + "metro": Metro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "metro_code": obj.get("metro_code"), + "tags": obj.get("tags"), + "vxlan": obj.get("vxlan") + }) + return _obj + +from equinix.services.metalv1.models.device import Device +# TODO: Rewrite to not use raise_errors +VirtualNetwork.model_rebuild(raise_errors=False) + diff --git a/equinix/services/metalv1/models/virtual_network_create_input.py b/equinix/services/metalv1/models/virtual_network_create_input.py new file mode 100644 index 00000000..b2bdd93c --- /dev/null +++ b/equinix/services/metalv1/models/virtual_network_create_input.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 VirtualNetworkCreateInput(BaseModel): + """ + VirtualNetworkCreateInput + """ # noqa: E501 + description: Optional[StrictStr] = None + facility: Optional[StrictStr] = Field(default=None, description="The UUID (or facility code) for the Facility in which to create this Virtual network.") + href: Optional[StrictStr] = None + metro: Optional[StrictStr] = Field(default=None, description="The UUID (or metro code) for the Metro in which to create this Virtual Network.") + tags: Optional[List[StrictStr]] = None + vxlan: Optional[StrictInt] = Field(default=None, description="VLAN ID between 2-3999. Must be unique for the project within the Metro in which this Virtual Network is being created. If no value is specified, the next-available VLAN ID in the range 1000-1999 will be automatically selected.") + __properties: ClassVar[List[str]] = ["description", "facility", "href", "metro", "tags", "vxlan"] + + 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 VirtualNetworkCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VirtualNetworkCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "facility": obj.get("facility"), + "href": obj.get("href"), + "metro": obj.get("metro"), + "tags": obj.get("tags"), + "vxlan": obj.get("vxlan") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/virtual_network_list.py b/equinix/services/metalv1/models/virtual_network_list.py new file mode 100644 index 00000000..2832c0b2 --- /dev/null +++ b/equinix/services/metalv1/models/virtual_network_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.virtual_network import VirtualNetwork +from typing import Optional, Set +from typing_extensions import Self + +class VirtualNetworkList(BaseModel): + """ + VirtualNetworkList + """ # noqa: E501 + href: Optional[StrictStr] = None + virtual_networks: Optional[List[VirtualNetwork]] = None + __properties: ClassVar[List[str]] = ["href", "virtual_networks"] + + 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 VirtualNetworkList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 virtual_networks (list) + _items = [] + if self.virtual_networks: + for _item in self.virtual_networks: + if _item: + _items.append(_item.to_dict()) + _dict['virtual_networks'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VirtualNetworkList 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"), + "virtual_networks": [VirtualNetwork.from_dict(_item) for _item in obj["virtual_networks"]] if obj.get("virtual_networks") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/virtual_network_update_input.py b/equinix/services/metalv1/models/virtual_network_update_input.py new file mode 100644 index 00000000..cf33f306 --- /dev/null +++ b/equinix/services/metalv1/models/virtual_network_update_input.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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 VirtualNetworkUpdateInput(BaseModel): + """ + VirtualNetworkUpdateInput + """ # noqa: E501 + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["description", "href", "tags"] + + 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 VirtualNetworkUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VirtualNetworkUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "href": obj.get("href"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vlan_csp_connection_create_input.py b/equinix/services/metalv1/models/vlan_csp_connection_create_input.py new file mode 100644 index 00000000..110088c9 --- /dev/null +++ b/equinix/services/metalv1/models/vlan_csp_connection_create_input.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.vlan_csp_connection_create_input_fabric_provider import VlanCSPConnectionCreateInputFabricProvider +from typing import Optional, Set +from typing_extensions import Self + +class VlanCSPConnectionCreateInput(BaseModel): + """ + VlanCSPConnectionCreateInput + """ # noqa: E501 + contact_email: Optional[StrictStr] = Field(default=None, description="The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key.") + description: Optional[StrictStr] = None + fabric_provider: VlanCSPConnectionCreateInputFabricProvider + href: Optional[StrictStr] = None + metro: StrictStr = Field(description="A Metro ID or code. When creating 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), or shared connections, 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.") + name: StrictStr + project: StrictStr + speed: Optional[StrictStr] = Field(default=None, description="A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs.") + tags: Optional[List[StrictStr]] = None + type: StrictStr + vlans: List[StrictInt] = Field(description="A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits.") + __properties: ClassVar[List[str]] = ["contact_email", "description", "fabric_provider", "href", "metro", "name", "project", "speed", "tags", "type", "vlans"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['shared_port_vlan_to_csp']): + raise ValueError("must be one of enum values ('shared_port_vlan_to_csp')") + return value + + 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 VlanCSPConnectionCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of fabric_provider + if self.fabric_provider: + _dict['fabric_provider'] = self.fabric_provider.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VlanCSPConnectionCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "contact_email": obj.get("contact_email"), + "description": obj.get("description"), + "fabric_provider": VlanCSPConnectionCreateInputFabricProvider.from_dict(obj["fabric_provider"]) if obj.get("fabric_provider") is not None else None, + "href": obj.get("href"), + "metro": obj.get("metro"), + "name": obj.get("name"), + "project": obj.get("project"), + "speed": obj.get("speed"), + "tags": obj.get("tags"), + "type": obj.get("type"), + "vlans": obj.get("vlans") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vlan_csp_connection_create_input_fabric_provider.py b/equinix/services/metalv1/models/vlan_csp_connection_create_input_fabric_provider.py new file mode 100644 index 00000000..ec5a32c0 --- /dev/null +++ b/equinix/services/metalv1/models/vlan_csp_connection_create_input_fabric_provider.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Metal API + + 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 json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from equinix.services.metalv1.models.aws_fabric_provider import AWSFabricProvider +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +VLANCSPCONNECTIONCREATEINPUTFABRICPROVIDER_ONE_OF_SCHEMAS = ["AWSFabricProvider"] + +class VlanCSPConnectionCreateInputFabricProvider(BaseModel): + """ + Configuration information for connecting to external cloud service provider. + """ + # data type: AWSFabricProvider + oneof_schema_1_validator: Optional[AWSFabricProvider] = None + actual_instance: Optional[Union[AWSFabricProvider]] = None + one_of_schemas: List[str] = Field(default=Literal["AWSFabricProvider"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = VlanCSPConnectionCreateInputFabricProvider.model_construct() + error_messages = [] + match = 0 + # validate data type: AWSFabricProvider + if not isinstance(v, AWSFabricProvider): + error_messages.append(f"Error! Input type `{type(v)}` is not `AWSFabricProvider`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in VlanCSPConnectionCreateInputFabricProvider with oneOf schemas: AWSFabricProvider. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in VlanCSPConnectionCreateInputFabricProvider with oneOf schemas: AWSFabricProvider. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into AWSFabricProvider + try: + instance.actual_instance = AWSFabricProvider.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into VlanCSPConnectionCreateInputFabricProvider with oneOf schemas: AWSFabricProvider. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into VlanCSPConnectionCreateInputFabricProvider with oneOf schemas: AWSFabricProvider. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AWSFabricProvider]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/equinix/services/metalv1/models/vlan_fabric_vc_create_input.py b/equinix/services/metalv1/models/vlan_fabric_vc_create_input.py new file mode 100644 index 00000000..87ba3d9b --- /dev/null +++ b/equinix/services/metalv1/models/vlan_fabric_vc_create_input.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class VlanFabricVcCreateInput(BaseModel): + """ + VlanFabricVcCreateInput + """ # noqa: E501 + contact_email: Optional[StrictStr] = Field(default=None, description="The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key.") + description: Optional[StrictStr] = None + facility_id: Optional[StrictStr] = None + href: Optional[StrictStr] = None + metro: StrictStr = Field(description="A Metro ID or code. When creating 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), or shared connections, 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.") + name: StrictStr + project: Optional[StrictStr] = None + redundancy: StrictStr = Field(description="Either 'primary' or 'redundant'.") + service_token_type: StrictStr = Field(description="Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details.") + speed: Optional[StrictStr] = Field(default=None, description="A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs.") + tags: Optional[List[StrictStr]] = None + type: StrictStr = Field(description="When requesting for a Fabric VC, the value of this field should be 'shared'.") + vlans: List[StrictInt] = Field(description="A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits.") + __properties: ClassVar[List[str]] = ["contact_email", "description", "facility_id", "href", "metro", "name", "project", "redundancy", "service_token_type", "speed", "tags", "type", "vlans"] + + @field_validator('service_token_type') + def service_token_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['a_side', 'z_side']): + raise ValueError("must be one of enum values ('a_side', 'z_side')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['shared']): + raise ValueError("must be one of enum values ('shared')") + return value + + 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 VlanFabricVcCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VlanFabricVcCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "contact_email": obj.get("contact_email"), + "description": obj.get("description"), + "facility_id": obj.get("facility_id"), + "href": obj.get("href"), + "metro": obj.get("metro"), + "name": obj.get("name"), + "project": obj.get("project"), + "redundancy": obj.get("redundancy"), + "service_token_type": obj.get("service_token_type"), + "speed": obj.get("speed"), + "tags": obj.get("tags"), + "type": obj.get("type"), + "vlans": obj.get("vlans") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vlan_virtual_circuit.py b/equinix/services/metalv1/models/vlan_virtual_circuit.py new file mode 100644 index 00000000..4a55c8c0 --- /dev/null +++ b/equinix/services/metalv1/models/vlan_virtual_circuit.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.project import Project +from typing import Optional, Set +from typing_extensions import Self + +class VlanVirtualCircuit(BaseModel): + """ + VlanVirtualCircuit + """ # noqa: E501 + bill: Optional[StrictBool] = Field(default=False, description="True if the Virtual Circuit is being billed. Currently, only Virtual Circuits of Fabric VCs (Metal Billed) will be billed. Usage will start the first time the Virtual Circuit becomes active, and will not stop until it is deleted from Metal.") + bill_type: Optional[StrictStr] = Field(default=None, description="Fabric Billed if the Virtual Circuit is billed by Fabric. Metal Billed if the Virtual Circuit is billed by Metal. Legacy Virtual Circuits will have a value of nil.") + created_at: Optional[datetime] = None + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + nni_vlan: Optional[StrictInt] = None + port: Optional[InterconnectionPort] = None + project: Optional[Project] = None + provider_connection_id: Optional[StrictStr] = Field(default=None, description="This field is relevant if using the `shared_port_vlan_to_csp` interconnection type. Once activated on the CSP, this field should contain the resource name that the virtual circuit is connected to on the provider's end.") + speed: Optional[StrictInt] = Field(default=None, description="For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual Circuits on Fabric VCs (both Metal and Fabric Billed) that have found their corresponding Fabric connection, this is the actual speed of the interconnection that was configured when setting up the interconnection on the Fabric Portal. Details on Fabric VCs are included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details.") + status: Optional[StrictStr] = Field(default=None, description="The status of a Virtual Circuit is always 'pending' on creation. The status can turn to 'Waiting on Customer VLAN' if a Metro VLAN was not set yet on the Virtual Circuit and is the last step needed for full activation. For Dedicated interconnections, as long as the Dedicated Port has been associated to the Virtual Circuit and a NNI VNID has been set, it will turn to 'waiting_on_customer_vlan'. For Fabric VCs, it will only change to 'waiting_on_customer_vlan' once the corresponding Fabric connection has been found on the Fabric side. If the Fabric service token associated with the Virtual Circuit hasn't been redeemed on Fabric within the expiry time, it will change to an `expired` status. Once a Metro VLAN is set on the Virtual Circuit (which for Fabric VCs, can be set on creation of a Fabric VC) and the necessary set up is done, it will turn into 'Activating' status as it tries to activate the Virtual Circuit. Once the Virtual Circuit fully activates and is configured on the switch, it will turn to staus 'active'. For Fabric VCs (Metal Billed), we will start billing the moment the status of the Virtual Circuit turns to 'active'. If there are any changes to the VLAN after the Virtual Circuit is in an 'active' status, the status will show 'changing_vlan' if a new VLAN has been provided, or 'deactivating' if we are removing the VLAN. When a deletion request is issued for the Virtual Circuit, it will move to a 'deleting' status, and we will immediately unconfigure the switch for the Virtual Circuit and issue a deletion on any associated Fabric connections. Any associated Metro VLANs on the virtual circuit will also be unassociated after the switch has been successfully unconfigured. If there are any associated Fabric connections, we will only fully delete the Virtual Circuit once we have checked that the Fabric connection was fully deprovisioned on Fabric.") + tags: Optional[List[StrictStr]] = None + type: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + virtual_network: Optional[Href] = None + vnid: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["bill", "bill_type", "created_at", "description", "href", "id", "name", "nni_vlan", "port", "project", "provider_connection_id", "speed", "status", "tags", "type", "updated_at", "virtual_network", "vnid"] + + @field_validator('bill_type') + def bill_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['metal_billed', 'fabric_billed']): + raise ValueError("must be one of enum values ('metal_billed', 'fabric_billed')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['pending', 'waiting_on_customer_vlan', 'activating', 'changing_vlan', 'deactivating', 'deleting', 'active', 'expired', 'activation_failed', 'changing_vlan_failed', 'deactivation_failed', 'delete_failed', 'configure_fabric_routing_protocols']): + raise ValueError("must be one of enum values ('pending', 'waiting_on_customer_vlan', 'activating', 'changing_vlan', 'deactivating', 'deleting', 'active', 'expired', 'activation_failed', 'changing_vlan_failed', 'deactivation_failed', 'delete_failed', 'configure_fabric_routing_protocols')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['vlan']): + raise ValueError("must be one of enum values ('vlan')") + return value + + 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 VlanVirtualCircuit 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of port + if self.port: + _dict['port'] = self.port.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of virtual_network + if self.virtual_network: + _dict['virtual_network'] = self.virtual_network.to_dict() + # set to None if bill_type (nullable) is None + # and model_fields_set contains the field + if self.bill_type is None and "bill_type" in self.model_fields_set: + _dict['bill_type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VlanVirtualCircuit from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bill": obj.get("bill") if obj.get("bill") is not None else False, + "bill_type": obj.get("bill_type"), + "created_at": obj.get("created_at"), + "description": obj.get("description"), + "href": obj.get("href"), + "id": obj.get("id"), + "name": obj.get("name"), + "nni_vlan": obj.get("nni_vlan"), + "port": InterconnectionPort.from_dict(obj["port"]) if obj.get("port") is not None else None, + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, + "provider_connection_id": obj.get("provider_connection_id"), + "speed": obj.get("speed"), + "status": obj.get("status"), + "tags": obj.get("tags"), + "type": obj.get("type"), + "updated_at": obj.get("updated_at"), + "virtual_network": Href.from_dict(obj["virtual_network"]) if obj.get("virtual_network") is not None else None, + "vnid": obj.get("vnid") + }) + return _obj + +from equinix.services.metalv1.models.interconnection_port import InterconnectionPort +# TODO: Rewrite to not use raise_errors +VlanVirtualCircuit.model_rebuild(raise_errors=False) + diff --git a/equinix/services/metalv1/models/vlan_virtual_circuit_create_input.py b/equinix/services/metalv1/models/vlan_virtual_circuit_create_input.py new file mode 100644 index 00000000..67257ab1 --- /dev/null +++ b/equinix/services/metalv1/models/vlan_virtual_circuit_create_input.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VlanVirtualCircuitCreateInput(BaseModel): + """ + VlanVirtualCircuitCreateInput + """ # noqa: E501 + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + name: Optional[StrictStr] = None + nni_vlan: Optional[Annotated[int, Field(le=4094, strict=True, ge=2)]] = None + project_id: StrictStr + speed: Optional[StrictStr] = Field(default=None, description="speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps')") + tags: Optional[List[StrictStr]] = None + vnid: Optional[StrictStr] = Field(default=None, description="A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project (sent as integer).") + __properties: ClassVar[List[str]] = ["description", "href", "name", "nni_vlan", "project_id", "speed", "tags", "vnid"] + + 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 VlanVirtualCircuitCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VlanVirtualCircuitCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "href": obj.get("href"), + "name": obj.get("name"), + "nni_vlan": obj.get("nni_vlan"), + "project_id": obj.get("project_id"), + "speed": obj.get("speed"), + "tags": obj.get("tags"), + "vnid": obj.get("vnid") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vlan_virtual_circuit_update_input.py b/equinix/services/metalv1/models/vlan_virtual_circuit_update_input.py new file mode 100644 index 00000000..026af12f --- /dev/null +++ b/equinix/services/metalv1/models/vlan_virtual_circuit_update_input.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class VlanVirtualCircuitUpdateInput(BaseModel): + """ + VlanVirtualCircuitUpdateInput + """ # noqa: E501 + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + name: Optional[StrictStr] = None + speed: Optional[StrictStr] = Field(default=None, description="Speed can be changed only if it is an interconnection on a Dedicated Port") + tags: Optional[List[StrictStr]] = None + vnid: Optional[StrictStr] = Field(default=None, description="A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project.") + __properties: ClassVar[List[str]] = ["description", "href", "name", "speed", "tags", "vnid"] + + 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 VlanVirtualCircuitUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VlanVirtualCircuitUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "href": obj.get("href"), + "name": obj.get("name"), + "speed": obj.get("speed"), + "tags": obj.get("tags"), + "vnid": obj.get("vnid") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf.py b/equinix/services/metalv1/models/vrf.py new file mode 100644 index 00000000..fe333b80 --- /dev/null +++ b/equinix/services/metalv1/models/vrf.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.metro import Metro +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.user import User +from typing import Optional, Set +from typing_extensions import Self + +class Vrf(BaseModel): + """ + Vrf + """ # noqa: E501 + bgp_dynamic_neighbors_bfd_enabled: Optional[StrictBool] = Field(default=None, description="Toggle BFD on dynamic bgp neighbors sessions") + bgp_dynamic_neighbors_enabled: Optional[StrictBool] = Field(default=None, description="Toggle to enable the dynamic bgp neighbors feature on the VRF") + bgp_dynamic_neighbors_export_route_map: Optional[StrictBool] = Field(default=None, description="Toggle to export the VRF route-map to the dynamic bgp neighbors") + bill: Optional[StrictBool] = Field(default=False, description="True if the VRF is being billed. Usage will start when the first VRF Virtual Circuit is active, and will only stop when the VRF has been deleted.") + created_at: Optional[datetime] = None + created_by: Optional[User] = None + description: Optional[StrictStr] = Field(default=None, description="Optional field that can be set to describe the VRF") + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + ip_ranges: Optional[List[StrictStr]] = Field(default=None, description="A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/59\"].") + local_asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="A 4-byte ASN associated with the VRF.") + metro: Optional[Metro] = None + name: Optional[StrictStr] = None + project: Optional[Project] = None + tags: Optional[List[StrictStr]] = None + updated_at: Optional[datetime] = None + virtual_circuits: Optional[List[VrfVirtualCircuit]] = Field(default=None, description="Virtual circuits that are in the VRF") + __properties: ClassVar[List[str]] = ["bgp_dynamic_neighbors_bfd_enabled", "bgp_dynamic_neighbors_enabled", "bgp_dynamic_neighbors_export_route_map", "bill", "created_at", "created_by", "description", "href", "id", "ip_ranges", "local_asn", "metro", "name", "project", "tags", "updated_at", "virtual_circuits"] + + 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 Vrf 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of created_by + if self.created_by: + _dict['created_by'] = self.created_by.to_dict() + # override the default output from pydantic by calling `to_dict()` of metro + if self.metro: + _dict['metro'] = self.metro.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in virtual_circuits (list) + _items = [] + if self.virtual_circuits: + for _item in self.virtual_circuits: + if _item: + _items.append(_item.to_dict()) + _dict['virtual_circuits'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Vrf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bgp_dynamic_neighbors_bfd_enabled": obj.get("bgp_dynamic_neighbors_bfd_enabled"), + "bgp_dynamic_neighbors_enabled": obj.get("bgp_dynamic_neighbors_enabled"), + "bgp_dynamic_neighbors_export_route_map": obj.get("bgp_dynamic_neighbors_export_route_map"), + "bill": obj.get("bill") if obj.get("bill") is not None else False, + "created_at": obj.get("created_at"), + "created_by": User.from_dict(obj["created_by"]) if obj.get("created_by") is not None else None, + "description": obj.get("description"), + "href": obj.get("href"), + "id": obj.get("id"), + "ip_ranges": obj.get("ip_ranges"), + "local_asn": obj.get("local_asn"), + "metro": Metro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "name": obj.get("name"), + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, + "tags": obj.get("tags"), + "updated_at": obj.get("updated_at"), + "virtual_circuits": [VrfVirtualCircuit.from_dict(_item) for _item in obj["virtual_circuits"]] if obj.get("virtual_circuits") is not None else None + }) + return _obj + +from equinix.services.metalv1.models.vrf_virtual_circuit import VrfVirtualCircuit +# TODO: Rewrite to not use raise_errors +Vrf.model_rebuild(raise_errors=False) + diff --git a/equinix/services/metalv1/models/vrf_bgp_neighbors.py b/equinix/services/metalv1/models/vrf_bgp_neighbors.py new file mode 100644 index 00000000..969ca612 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_bgp_neighbors.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VrfBGPNeighbors(BaseModel): + """ + VrfBGPNeighbors + """ # noqa: E501 + href: Optional[StrictStr] = None + peer_as: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="The ASN of the peer that advertised the prefix.") + peer_ip: Optional[StrictStr] = None + state: Optional[StrictStr] = Field(default=None, description="The current status of the connection to the BGP peer. State is either up or down.") + __properties: ClassVar[List[str]] = ["href", "peer_as", "peer_ip", "state"] + + 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 VrfBGPNeighbors 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfBGPNeighbors 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"), + "peer_as": obj.get("peer_as"), + "peer_ip": obj.get("peer_ip"), + "state": obj.get("state") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_bgp_neighbors_list.py b/equinix/services/metalv1/models/vrf_bgp_neighbors_list.py new file mode 100644 index 00000000..c63cc651 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_bgp_neighbors_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.vrf_bgp_neighbors import VrfBGPNeighbors +from typing import Optional, Set +from typing_extensions import Self + +class VrfBGPNeighborsList(BaseModel): + """ + VrfBGPNeighborsList + """ # noqa: E501 + bgp_neighbors: Optional[List[VrfBGPNeighbors]] = None + href: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["bgp_neighbors", "href"] + + 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 VrfBGPNeighborsList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 bgp_neighbors (list) + _items = [] + if self.bgp_neighbors: + for _item in self.bgp_neighbors: + if _item: + _items.append(_item.to_dict()) + _dict['bgp_neighbors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfBGPNeighborsList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bgp_neighbors": [VrfBGPNeighbors.from_dict(_item) for _item in obj["bgp_neighbors"]] if obj.get("bgp_neighbors") is not None else None, + "href": obj.get("href") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_create_input.py b/equinix/services/metalv1/models/vrf_create_input.py new file mode 100644 index 00000000..9cff1afb --- /dev/null +++ b/equinix/services/metalv1/models/vrf_create_input.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VrfCreateInput(BaseModel): + """ + VrfCreateInput + """ # noqa: E501 + bgp_dynamic_neighbors_bfd_enabled: Optional[StrictBool] = Field(default=None, description="Toggle BFD on dynamic bgp neighbors sessions") + bgp_dynamic_neighbors_enabled: Optional[StrictBool] = Field(default=None, description="Toggle to enable the dynamic bgp neighbors feature on the VRF") + bgp_dynamic_neighbors_export_route_map: Optional[StrictBool] = Field(default=None, description="Toggle to export the VRF route-map to the dynamic bgp neighbors") + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + ip_ranges: Optional[List[StrictStr]] = Field(default=None, description="A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/59\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /59 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits.") + local_asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = None + metro: StrictStr = Field(description="The UUID (or metro code) for the Metro in which to create this VRF.") + name: StrictStr + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["bgp_dynamic_neighbors_bfd_enabled", "bgp_dynamic_neighbors_enabled", "bgp_dynamic_neighbors_export_route_map", "description", "href", "ip_ranges", "local_asn", "metro", "name", "tags"] + + 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 VrfCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bgp_dynamic_neighbors_bfd_enabled": obj.get("bgp_dynamic_neighbors_bfd_enabled"), + "bgp_dynamic_neighbors_enabled": obj.get("bgp_dynamic_neighbors_enabled"), + "bgp_dynamic_neighbors_export_route_map": obj.get("bgp_dynamic_neighbors_export_route_map"), + "description": obj.get("description"), + "href": obj.get("href"), + "ip_ranges": obj.get("ip_ranges"), + "local_asn": obj.get("local_asn"), + "metro": obj.get("metro"), + "name": obj.get("name"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_fabric_vc_create_input.py b/equinix/services/metalv1/models/vrf_fabric_vc_create_input.py new file mode 100644 index 00000000..7550813b --- /dev/null +++ b/equinix/services/metalv1/models/vrf_fabric_vc_create_input.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class VrfFabricVcCreateInput(BaseModel): + """ + VrfFabricVcCreateInput + """ # noqa: E501 + contact_email: Optional[StrictStr] = Field(default=None, description="The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key.") + description: Optional[StrictStr] = None + facility_id: Optional[StrictStr] = None + href: Optional[StrictStr] = None + metro: StrictStr = Field(description="A Metro ID or code. When creating 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), or shared connections, 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.") + name: StrictStr + project: Optional[StrictStr] = None + redundancy: StrictStr = Field(description="Either 'primary' or 'redundant'.") + service_token_type: StrictStr = Field(description="Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details.") + speed: Optional[StrictStr] = Field(default=None, description="A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs.") + tags: Optional[List[StrictStr]] = None + type: StrictStr = Field(description="When requesting for a Fabric VC, the value of this field should be 'shared'.") + vrfs: List[StrictStr] = Field(description="This field holds a list of VRF UUIDs that will be set automatically on the virtual circuits of Fabric VCs on creation, and can hold up to two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. The first UUID will be set on the primary virtual circuit, while the second UUID will be set on the secondary. The two UUIDs can be the same if both the primary and secondary virtual circuits will be in the same VRF. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details.") + __properties: ClassVar[List[str]] = ["contact_email", "description", "facility_id", "href", "metro", "name", "project", "redundancy", "service_token_type", "speed", "tags", "type", "vrfs"] + + @field_validator('service_token_type') + def service_token_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['a_side', 'z_side']): + raise ValueError("must be one of enum values ('a_side', 'z_side')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['shared']): + raise ValueError("must be one of enum values ('shared')") + return value + + 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 VrfFabricVcCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfFabricVcCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "contact_email": obj.get("contact_email"), + "description": obj.get("description"), + "facility_id": obj.get("facility_id"), + "href": obj.get("href"), + "metro": obj.get("metro"), + "name": obj.get("name"), + "project": obj.get("project"), + "redundancy": obj.get("redundancy"), + "service_token_type": obj.get("service_token_type"), + "speed": obj.get("speed"), + "tags": obj.get("tags"), + "type": obj.get("type"), + "vrfs": obj.get("vrfs") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_ip_reservation.py b/equinix/services/metalv1/models/vrf_ip_reservation.py new file mode 100644 index 00000000..7959a6e7 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_ip_reservation.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.metal_gateway_lite import MetalGatewayLite +from equinix.services.metalv1.models.metro import Metro +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.vrf import Vrf +from typing import Optional, Set +from typing_extensions import Self + +class VrfIpReservation(BaseModel): + """ + VrfIpReservation + """ # noqa: E501 + address: Optional[StrictStr] = None + address_family: Optional[StrictInt] = None + bill: Optional[StrictBool] = None + cidr: Optional[StrictInt] = None + created_at: Optional[datetime] = None + created_by: Optional[Href] = None + customdata: Optional[Dict[str, Any]] = None + details: Optional[StrictStr] = None + gateway: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + manageable: Optional[StrictBool] = None + management: Optional[StrictBool] = None + metal_gateway: Optional[MetalGatewayLite] = None + metro: Optional[Metro] = None + netmask: Optional[StrictStr] = None + network: Optional[StrictStr] = None + project: Optional[Project] = None + project_lite: Optional[Project] = None + public: Optional[StrictBool] = None + state: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + type: StrictStr + vrf: Vrf + __properties: ClassVar[List[str]] = ["address", "address_family", "bill", "cidr", "created_at", "created_by", "customdata", "details", "gateway", "href", "id", "manageable", "management", "metal_gateway", "metro", "netmask", "network", "project", "project_lite", "public", "state", "tags", "type", "vrf"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['vrf']): + raise ValueError("must be one of enum values ('vrf')") + return value + + 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 VrfIpReservation 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of created_by + if self.created_by: + _dict['created_by'] = self.created_by.to_dict() + # override the default output from pydantic by calling `to_dict()` of metal_gateway + if self.metal_gateway: + _dict['metal_gateway'] = self.metal_gateway.to_dict() + # override the default output from pydantic by calling `to_dict()` of metro + if self.metro: + _dict['metro'] = self.metro.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of project_lite + if self.project_lite: + _dict['project_lite'] = self.project_lite.to_dict() + # override the default output from pydantic by calling `to_dict()` of vrf + if self.vrf: + _dict['vrf'] = self.vrf.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfIpReservation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "address_family": obj.get("address_family"), + "bill": obj.get("bill"), + "cidr": obj.get("cidr"), + "created_at": obj.get("created_at"), + "created_by": Href.from_dict(obj["created_by"]) if obj.get("created_by") is not None else None, + "customdata": obj.get("customdata"), + "details": obj.get("details"), + "gateway": obj.get("gateway"), + "href": obj.get("href"), + "id": obj.get("id"), + "manageable": obj.get("manageable"), + "management": obj.get("management"), + "metal_gateway": MetalGatewayLite.from_dict(obj["metal_gateway"]) if obj.get("metal_gateway") is not None else None, + "metro": Metro.from_dict(obj["metro"]) if obj.get("metro") is not None else None, + "netmask": obj.get("netmask"), + "network": obj.get("network"), + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, + "project_lite": Project.from_dict(obj["project_lite"]) if obj.get("project_lite") is not None else None, + "public": obj.get("public"), + "state": obj.get("state"), + "tags": obj.get("tags"), + "type": obj.get("type"), + "vrf": Vrf.from_dict(obj["vrf"]) if obj.get("vrf") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_ip_reservation_create_input.py b/equinix/services/metalv1/models/vrf_ip_reservation_create_input.py new file mode 100644 index 00000000..eb331a1f --- /dev/null +++ b/equinix/services/metalv1/models/vrf_ip_reservation_create_input.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Metal API + + 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 VrfIpReservationCreateInput(BaseModel): + """ + VrfIpReservationCreateInput + """ # noqa: E501 + cidr: StrictInt = Field(description="The size of the VRF IP Reservation's subnet. The following subnet sizes are supported: - IPv4: between 22 - 29 inclusive - IPv6: exactly 64 ") + customdata: Optional[Dict[str, Any]] = None + details: Optional[StrictStr] = None + href: Optional[StrictStr] = None + network: StrictStr = Field(description="The starting address for this VRF IP Reservation's subnet. Both IPv4 and IPv6 are supported.") + tags: Optional[List[StrictStr]] = None + type: StrictStr = Field(description="Must be set to 'vrf'") + vrf_id: StrictStr = Field(description="The ID of the VRF in which this VRF IP Reservation is created. The VRF must have an existing IP Range that contains the requested subnet. This field may be aliased as just 'vrf'.") + __properties: ClassVar[List[str]] = ["cidr", "customdata", "details", "href", "network", "tags", "type", "vrf_id"] + + 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 VrfIpReservationCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfIpReservationCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cidr": obj.get("cidr"), + "customdata": obj.get("customdata"), + "details": obj.get("details"), + "href": obj.get("href"), + "network": obj.get("network"), + "tags": obj.get("tags"), + "type": obj.get("type"), + "vrf_id": obj.get("vrf_id") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_ip_reservation_list.py b/equinix/services/metalv1/models/vrf_ip_reservation_list.py new file mode 100644 index 00000000..ae4dae33 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_ip_reservation_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.vrf_ip_reservation import VrfIpReservation +from typing import Optional, Set +from typing_extensions import Self + +class VrfIpReservationList(BaseModel): + """ + VrfIpReservationList + """ # noqa: E501 + href: Optional[StrictStr] = None + ip_addresses: Optional[List[VrfIpReservation]] = None + __properties: ClassVar[List[str]] = ["href", "ip_addresses"] + + 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 VrfIpReservationList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 ip_addresses (list) + _items = [] + if self.ip_addresses: + for _item in self.ip_addresses: + if _item: + _items.append(_item.to_dict()) + _dict['ip_addresses'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfIpReservationList 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"), + "ip_addresses": [VrfIpReservation.from_dict(_item) for _item in obj["ip_addresses"]] if obj.get("ip_addresses") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_learned_routes.py b/equinix/services/metalv1/models/vrf_learned_routes.py new file mode 100644 index 00000000..b38b9a75 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_learned_routes.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VrfLearnedRoutes(BaseModel): + """ + VrfLearnedRoutes + """ # noqa: E501 + href: Optional[StrictStr] = None + origin_as: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="The ASN of the peer that advertised the prefix.") + prefix: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["href", "origin_as", "prefix"] + + 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 VrfLearnedRoutes 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfLearnedRoutes 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"), + "origin_as": obj.get("origin_as"), + "prefix": obj.get("prefix") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_learned_routes_list.py b/equinix/services/metalv1/models/vrf_learned_routes_list.py new file mode 100644 index 00000000..b46c3ec8 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_learned_routes_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.vrf_learned_routes import VrfLearnedRoutes +from typing import Optional, Set +from typing_extensions import Self + +class VrfLearnedRoutesList(BaseModel): + """ + VrfLearnedRoutesList + """ # noqa: E501 + href: Optional[StrictStr] = None + learned_routes: Optional[List[VrfLearnedRoutes]] = None + __properties: ClassVar[List[str]] = ["href", "learned_routes"] + + 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 VrfLearnedRoutesList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _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 learned_routes (list) + _items = [] + if self.learned_routes: + for _item in self.learned_routes: + if _item: + _items.append(_item.to_dict()) + _dict['learned_routes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfLearnedRoutesList 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"), + "learned_routes": [VrfLearnedRoutes.from_dict(_item) for _item in obj["learned_routes"]] if obj.get("learned_routes") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_list.py b/equinix/services/metalv1/models/vrf_list.py new file mode 100644 index 00000000..581d8081 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.meta import Meta +from equinix.services.metalv1.models.vrf import Vrf +from typing import Optional, Set +from typing_extensions import Self + +class VrfList(BaseModel): + """ + VrfList + """ # noqa: E501 + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + vrfs: Optional[List[Vrf]] = None + __properties: ClassVar[List[str]] = ["href", "meta", "vrfs"] + + 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 VrfList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in vrfs (list) + _items = [] + if self.vrfs: + for _item in self.vrfs: + if _item: + _items.append(_item.to_dict()) + _dict['vrfs'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfList 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"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "vrfs": [Vrf.from_dict(_item) for _item in obj["vrfs"]] if obj.get("vrfs") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_metal_gateway.py b/equinix/services/metalv1/models/vrf_metal_gateway.py new file mode 100644 index 00000000..c942d99a --- /dev/null +++ b/equinix/services/metalv1/models/vrf_metal_gateway.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.href import Href +from equinix.services.metalv1.models.project import Project +from equinix.services.metalv1.models.virtual_network import VirtualNetwork +from equinix.services.metalv1.models.vrf import Vrf +from equinix.services.metalv1.models.vrf_ip_reservation import VrfIpReservation +from typing import Optional, Set +from typing_extensions import Self + +class VrfMetalGateway(BaseModel): + """ + VrfMetalGateway + """ # noqa: E501 + created_at: Optional[datetime] = None + created_by: Optional[Href] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + ip_reservation: Optional[VrfIpReservation] = None + project: Optional[Project] = None + state: Optional[StrictStr] = Field(default=None, description="The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted.") + updated_at: Optional[datetime] = None + virtual_network: Optional[VirtualNetwork] = None + vrf: Optional[Vrf] = None + __properties: ClassVar[List[str]] = ["created_at", "created_by", "href", "id", "ip_reservation", "project", "state", "updated_at", "virtual_network", "vrf"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready', 'active', 'deleting']): + raise ValueError("must be one of enum values ('ready', 'active', 'deleting')") + return value + + 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 VrfMetalGateway 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of created_by + if self.created_by: + _dict['created_by'] = self.created_by.to_dict() + # override the default output from pydantic by calling `to_dict()` of ip_reservation + if self.ip_reservation: + _dict['ip_reservation'] = self.ip_reservation.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of virtual_network + if self.virtual_network: + _dict['virtual_network'] = self.virtual_network.to_dict() + # override the default output from pydantic by calling `to_dict()` of vrf + if self.vrf: + _dict['vrf'] = self.vrf.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfMetalGateway from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "created_by": Href.from_dict(obj["created_by"]) if obj.get("created_by") is not None else None, + "href": obj.get("href"), + "id": obj.get("id"), + "ip_reservation": VrfIpReservation.from_dict(obj["ip_reservation"]) if obj.get("ip_reservation") is not None else None, + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, + "state": obj.get("state"), + "updated_at": obj.get("updated_at"), + "virtual_network": VirtualNetwork.from_dict(obj["virtual_network"]) if obj.get("virtual_network") is not None else None, + "vrf": Vrf.from_dict(obj["vrf"]) if obj.get("vrf") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_metal_gateway_create_input.py b/equinix/services/metalv1/models/vrf_metal_gateway_create_input.py new file mode 100644 index 00000000..dae5cfbb --- /dev/null +++ b/equinix/services/metalv1/models/vrf_metal_gateway_create_input.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class VrfMetalGatewayCreateInput(BaseModel): + """ + VrfMetalGatewayCreateInput + """ # noqa: E501 + href: Optional[StrictStr] = None + ip_reservation_id: StrictStr = Field(description="The UUID an a VRF IP Reservation that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the VRF IP Reservation and the Virtual Network must reside in the same Metro.") + virtual_network_id: StrictStr = Field(description="The UUID of a Metro Virtual Network that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the Virtual Network and the VRF IP Reservation must reside in the same metro. In the case of the IP reservation being an IPv6 based VRF IP Reservation, the Virtual Network must not already have an associated IPv6 based VRF IP Reservation. There can be exactly one IPv6 based VRF IP Reservation associated to a Virtual Network.") + __properties: ClassVar[List[str]] = ["href", "ip_reservation_id", "virtual_network_id"] + + 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 VrfMetalGatewayCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfMetalGatewayCreateInput 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"), + "ip_reservation_id": obj.get("ip_reservation_id"), + "virtual_network_id": obj.get("virtual_network_id") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_route.py b/equinix/services/metalv1/models/vrf_route.py new file mode 100644 index 00000000..721f4f15 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_route.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from equinix.services.metalv1.models.virtual_network import VirtualNetwork +from equinix.services.metalv1.models.vrf import Vrf +from equinix.services.metalv1.models.vrf_metal_gateway import VrfMetalGateway +from typing import Optional, Set +from typing_extensions import Self + +class VrfRoute(BaseModel): + """ + VrfRoute + """ # noqa: E501 + created_at: Optional[datetime] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = Field(default=None, description="The unique identifier for the newly-created resource") + metal_gateway: Optional[VrfMetalGateway] = None + next_hop: Optional[StrictStr] = Field(default=None, description="The next-hop IPv4 address for the route") + prefix: Optional[StrictStr] = Field(default=None, description="The IPv4 prefix for the route, in CIDR-style notation") + status: Optional[StrictStr] = Field(default=None, description="The status of the route. Potential values are \"pending\", \"active\", \"deleting\", and \"error\", representing various lifecycle states of the route and whether or not it has been successfully configured on the network") + tags: Optional[List[StrictStr]] = None + type: Optional[StrictStr] = Field(default=None, description="VRF route type, like 'bgp', 'connected', and 'static'. Currently, only static routes are supported") + updated_at: Optional[datetime] = None + virtual_network: Optional[VirtualNetwork] = None + vrf: Optional[Vrf] = None + __properties: ClassVar[List[str]] = ["created_at", "href", "id", "metal_gateway", "next_hop", "prefix", "status", "tags", "type", "updated_at", "virtual_network", "vrf"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['pending', 'active', 'deleting', 'error']): + raise ValueError("must be one of enum values ('pending', 'active', 'deleting', 'error')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['static']): + raise ValueError("must be one of enum values ('static')") + return value + + 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 VrfRoute 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. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "href", + "id", + "status", + "type", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metal_gateway + if self.metal_gateway: + _dict['metal_gateway'] = self.metal_gateway.to_dict() + # override the default output from pydantic by calling `to_dict()` of virtual_network + if self.virtual_network: + _dict['virtual_network'] = self.virtual_network.to_dict() + # override the default output from pydantic by calling `to_dict()` of vrf + if self.vrf: + _dict['vrf'] = self.vrf.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfRoute from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "href": obj.get("href"), + "id": obj.get("id"), + "metal_gateway": VrfMetalGateway.from_dict(obj["metal_gateway"]) if obj.get("metal_gateway") is not None else None, + "next_hop": obj.get("next_hop"), + "prefix": obj.get("prefix"), + "status": obj.get("status"), + "tags": obj.get("tags"), + "type": obj.get("type"), + "updated_at": obj.get("updated_at"), + "virtual_network": VirtualNetwork.from_dict(obj["virtual_network"]) if obj.get("virtual_network") is not None else None, + "vrf": Vrf.from_dict(obj["vrf"]) if obj.get("vrf") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_route_create_input.py b/equinix/services/metalv1/models/vrf_route_create_input.py new file mode 100644 index 00000000..5b9e9392 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_route_create_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class VrfRouteCreateInput(BaseModel): + """ + VrfRouteCreateInput + """ # noqa: E501 + href: Optional[StrictStr] = None + next_hop: StrictStr = Field(description="The IPv4 address within the VRF of the host that will handle this route") + prefix: StrictStr = Field(description="The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be \"0.0.0.0/0\"") + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["href", "next_hop", "prefix", "tags"] + + 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 VrfRouteCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfRouteCreateInput 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"), + "next_hop": obj.get("next_hop"), + "prefix": obj.get("prefix"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_route_list.py b/equinix/services/metalv1/models/vrf_route_list.py new file mode 100644 index 00000000..d7046286 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_route_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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 equinix.services.metalv1.models.meta import Meta +from equinix.services.metalv1.models.vrf_route import VrfRoute +from typing import Optional, Set +from typing_extensions import Self + +class VrfRouteList(BaseModel): + """ + VrfRouteList + """ # noqa: E501 + href: Optional[StrictStr] = None + meta: Optional[Meta] = None + routes: Optional[List[VrfRoute]] = None + __properties: ClassVar[List[str]] = ["href", "meta", "routes"] + + 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 VrfRouteList 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in routes (list) + _items = [] + if self.routes: + for _item in self.routes: + if _item: + _items.append(_item.to_dict()) + _dict['routes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfRouteList 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"), + "meta": Meta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "routes": [VrfRoute.from_dict(_item) for _item in obj["routes"]] if obj.get("routes") is not None else None + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_route_update_input.py b/equinix/services/metalv1/models/vrf_route_update_input.py new file mode 100644 index 00000000..ca0ac36e --- /dev/null +++ b/equinix/services/metalv1/models/vrf_route_update_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Metal API + + 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 typing import Optional, Set +from typing_extensions import Self + +class VrfRouteUpdateInput(BaseModel): + """ + VrfRouteUpdateInput + """ # noqa: E501 + href: Optional[StrictStr] = None + next_hop: Optional[StrictStr] = Field(default=None, description="The IPv4 address within the VRF of the host that will handle this route") + prefix: Optional[StrictStr] = Field(default=None, description="The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be \"0.0.0.0/0\"") + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["href", "next_hop", "prefix", "tags"] + + 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 VrfRouteUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfRouteUpdateInput 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"), + "next_hop": obj.get("next_hop"), + "prefix": obj.get("prefix"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_update_input.py b/equinix/services/metalv1/models/vrf_update_input.py new file mode 100644 index 00000000..ba9e1e68 --- /dev/null +++ b/equinix/services/metalv1/models/vrf_update_input.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class VrfUpdateInput(BaseModel): + """ + VrfUpdateInput + """ # noqa: E501 + bgp_dynamic_neighbors_bfd_enabled: Optional[StrictBool] = Field(default=None, description="Toggle BFD on dynamic bgp neighbors sessions") + bgp_dynamic_neighbors_enabled: Optional[StrictBool] = Field(default=None, description="Toggle to enable the dynamic bgp neighbors feature on the VRF") + bgp_dynamic_neighbors_export_route_map: Optional[StrictBool] = Field(default=None, description="Toggle to export the VRF route-map to the dynamic bgp neighbors") + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + ip_ranges: Optional[List[StrictStr]] = Field(default=None, description="A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/59\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /59 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\\'s associated Metal Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. Specifying a value of `[]` will remove all existing IP Ranges from the VRF.") + local_asn: Optional[StrictInt] = Field(default=None, description="The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance.") + name: Optional[StrictStr] = None + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["bgp_dynamic_neighbors_bfd_enabled", "bgp_dynamic_neighbors_enabled", "bgp_dynamic_neighbors_export_route_map", "description", "href", "ip_ranges", "local_asn", "name", "tags"] + + 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 VrfUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bgp_dynamic_neighbors_bfd_enabled": obj.get("bgp_dynamic_neighbors_bfd_enabled"), + "bgp_dynamic_neighbors_enabled": obj.get("bgp_dynamic_neighbors_enabled"), + "bgp_dynamic_neighbors_export_route_map": obj.get("bgp_dynamic_neighbors_export_route_map"), + "description": obj.get("description"), + "href": obj.get("href"), + "ip_ranges": obj.get("ip_ranges"), + "local_asn": obj.get("local_asn"), + "name": obj.get("name"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_virtual_circuit.py b/equinix/services/metalv1/models/vrf_virtual_circuit.py new file mode 100644 index 00000000..d870167c --- /dev/null +++ b/equinix/services/metalv1/models/vrf_virtual_circuit.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Metal API + + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from equinix.services.metalv1.models.project import Project +from typing import Optional, Set +from typing_extensions import Self + +class VrfVirtualCircuit(BaseModel): + """ + VrfVirtualCircuit + """ # noqa: E501 + created_at: Optional[datetime] = None + customer_ip: Optional[StrictStr] = Field(default=None, description="An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used.") + customer_ipv6: Optional[StrictStr] = Field(default=None, description="An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, the last usable IP address in the subnet IPv6 will be used.") + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + id: Optional[StrictStr] = None + md5: Optional[StrictStr] = Field(default=None, description="The MD5 password for the BGP peering in plaintext (not a checksum).") + metal_ip: Optional[StrictStr] = Field(default=None, description="An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used.") + metal_ipv6: Optional[StrictStr] = Field(default=None, description="An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, the first usable IPv6 address in the subnet IPv6 will be used.") + name: Optional[StrictStr] = None + nni_vlan: Optional[StrictInt] = None + peer_asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="The peer ASN that will be used with the VRF on the Virtual Circuit.") + port: Optional[InterconnectionPort] = None + project: Optional[Project] = None + speed: Optional[StrictInt] = Field(default=None, description="integer representing bps speed") + status: Optional[StrictStr] = Field(default=None, description="The status changes of a VRF virtual circuit are generally the same as Virtual Circuits that aren't in a VRF. However, for VRF Virtual Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' once the Fabric service token associated with the virtual circuit has been redeemed on Fabric, and Metal has found the associated Fabric connection. At this point, users can update the subnet, MD5 password, customer IP and/or metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, we require all peering details to be set on creation of a VRF Virtual Circuit. The status will change to `changing_peering_details` whenever an active VRF Virtual Circuit has any of its peering details updated.") + subnet: Optional[StrictStr] = Field(default=None, description="The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP.") + subnet_ipv6: Optional[StrictStr] = Field(default=None, description="The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined IP Range for the VRF.") + tags: Optional[List[StrictStr]] = None + type: Optional[StrictStr] = None + updated_at: Optional[datetime] = None + vrf: Vrf + __properties: ClassVar[List[str]] = ["created_at", "customer_ip", "customer_ipv6", "description", "href", "id", "md5", "metal_ip", "metal_ipv6", "name", "nni_vlan", "peer_asn", "port", "project", "speed", "status", "subnet", "subnet_ipv6", "tags", "type", "updated_at", "vrf"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['pending', 'waiting_on_peering_details', 'activating', 'changing_peering_details', 'deactivating', 'deleting', 'active', 'expired', 'activation_failed', 'changing_peering_details_failed', 'deactivation_failed', 'delete_failed']): + raise ValueError("must be one of enum values ('pending', 'waiting_on_peering_details', 'activating', 'changing_peering_details', 'deactivating', 'deleting', 'active', 'expired', 'activation_failed', 'changing_peering_details_failed', 'deactivation_failed', 'delete_failed')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['vrf']): + raise ValueError("must be one of enum values ('vrf')") + return value + + 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 VrfVirtualCircuit 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of port + if self.port: + _dict['port'] = self.port.to_dict() + # override the default output from pydantic by calling `to_dict()` of project + if self.project: + _dict['project'] = self.project.to_dict() + # override the default output from pydantic by calling `to_dict()` of vrf + if self.vrf: + _dict['vrf'] = self.vrf.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfVirtualCircuit from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "customer_ip": obj.get("customer_ip"), + "customer_ipv6": obj.get("customer_ipv6"), + "description": obj.get("description"), + "href": obj.get("href"), + "id": obj.get("id"), + "md5": obj.get("md5"), + "metal_ip": obj.get("metal_ip"), + "metal_ipv6": obj.get("metal_ipv6"), + "name": obj.get("name"), + "nni_vlan": obj.get("nni_vlan"), + "peer_asn": obj.get("peer_asn"), + "port": InterconnectionPort.from_dict(obj["port"]) if obj.get("port") is not None else None, + "project": Project.from_dict(obj["project"]) if obj.get("project") is not None else None, + "speed": obj.get("speed"), + "status": obj.get("status"), + "subnet": obj.get("subnet"), + "subnet_ipv6": obj.get("subnet_ipv6"), + "tags": obj.get("tags"), + "type": obj.get("type"), + "updated_at": obj.get("updated_at"), + "vrf": Vrf.from_dict(obj["vrf"]) if obj.get("vrf") is not None else None + }) + return _obj + +from equinix.services.metalv1.models.interconnection_port import InterconnectionPort +from equinix.services.metalv1.models.vrf import Vrf +# TODO: Rewrite to not use raise_errors +VrfVirtualCircuit.model_rebuild(raise_errors=False) + diff --git a/equinix/services/metalv1/models/vrf_virtual_circuit_create_input.py b/equinix/services/metalv1/models/vrf_virtual_circuit_create_input.py new file mode 100644 index 00000000..849db27e --- /dev/null +++ b/equinix/services/metalv1/models/vrf_virtual_circuit_create_input.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VrfVirtualCircuitCreateInput(BaseModel): + """ + VrfVirtualCircuitCreateInput + """ # noqa: E501 + customer_ip: Optional[StrictStr] = Field(default=None, description="An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used.") + customer_ipv6: Optional[StrictStr] = Field(default=None, description="An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, the last usable IP address in the subnet IPv6 will be used.") + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + md5: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character ") + metal_ip: Optional[StrictStr] = Field(default=None, description="An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used.") + metal_ipv6: Optional[StrictStr] = Field(default=None, description="An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, the first usable IPv6 address in the subnet IPv6 will be used.") + name: Optional[StrictStr] = None + nni_vlan: Annotated[int, Field(le=4094, strict=True, ge=2)] + peer_asn: Annotated[int, Field(le=4294967295, strict=True, ge=0)] = Field(description="The peer ASN that will be used with the VRF on the Virtual Circuit.") + project_id: StrictStr + speed: Optional[StrictStr] = Field(default=None, description="speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps')") + subnet: StrictStr = Field(description="The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. The subnet specified must be contained within an already-defined IP Range for the VRF.") + subnet_ipv6: Optional[StrictStr] = Field(default=None, description="The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined IP Range for the VRF.") + tags: Optional[List[StrictStr]] = None + vrf: StrictStr = Field(description="The UUID of the VRF that will be associated with the Virtual Circuit.") + __properties: ClassVar[List[str]] = ["customer_ip", "customer_ipv6", "description", "href", "md5", "metal_ip", "metal_ipv6", "name", "nni_vlan", "peer_asn", "project_id", "speed", "subnet", "subnet_ipv6", "tags", "vrf"] + + @field_validator('md5') + def md5_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$", value): + raise ValueError(r"must validate the regular expression /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$/") + return value + + 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 VrfVirtualCircuitCreateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if md5 (nullable) is None + # and model_fields_set contains the field + if self.md5 is None and "md5" in self.model_fields_set: + _dict['md5'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfVirtualCircuitCreateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "customer_ip": obj.get("customer_ip"), + "customer_ipv6": obj.get("customer_ipv6"), + "description": obj.get("description"), + "href": obj.get("href"), + "md5": obj.get("md5"), + "metal_ip": obj.get("metal_ip"), + "metal_ipv6": obj.get("metal_ipv6"), + "name": obj.get("name"), + "nni_vlan": obj.get("nni_vlan"), + "peer_asn": obj.get("peer_asn"), + "project_id": obj.get("project_id"), + "speed": obj.get("speed"), + "subnet": obj.get("subnet"), + "subnet_ipv6": obj.get("subnet_ipv6"), + "tags": obj.get("tags"), + "vrf": obj.get("vrf") + }) + return _obj + + diff --git a/equinix/services/metalv1/models/vrf_virtual_circuit_update_input.py b/equinix/services/metalv1/models/vrf_virtual_circuit_update_input.py new file mode 100644 index 00000000..b576d69a --- /dev/null +++ b/equinix/services/metalv1/models/vrf_virtual_circuit_update_input.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Metal API + + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VrfVirtualCircuitUpdateInput(BaseModel): + """ + VrfVirtualCircuitUpdateInput + """ # noqa: E501 + customer_ip: Optional[StrictStr] = Field(default=None, description="An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used.") + customer_ipv6: Optional[StrictStr] = Field(default=None, description="An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, the last usable IP address in the subnet IPv6 will be used.") + description: Optional[StrictStr] = None + href: Optional[StrictStr] = None + md5: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character ") + metal_ip: Optional[StrictStr] = Field(default=None, description="An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used.") + metal_ipv6: Optional[StrictStr] = Field(default=None, description="An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, the first usable IPv6 address in the subnet IPv6 will be used.") + name: Optional[StrictStr] = None + peer_asn: Optional[Annotated[int, Field(le=4294967295, strict=True, ge=0)]] = Field(default=None, description="The peer ASN that will be used with the VRF on the Virtual Circuit.") + speed: Optional[StrictStr] = Field(default=None, description="Speed can be changed only if it is an interconnection on a Dedicated Port") + subnet: Optional[StrictStr] = Field(default=None, description="The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP.") + subnet_ipv6: Optional[StrictStr] = Field(default=None, description="The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined IP Range for the VRF.") + tags: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["customer_ip", "customer_ipv6", "description", "href", "md5", "metal_ip", "metal_ipv6", "name", "peer_asn", "speed", "subnet", "subnet_ipv6", "tags"] + + @field_validator('md5') + def md5_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$", value): + raise ValueError(r"must validate the regular expression /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$/") + return value + + 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 VrfVirtualCircuitUpdateInput 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VrfVirtualCircuitUpdateInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "customer_ip": obj.get("customer_ip"), + "customer_ipv6": obj.get("customer_ipv6"), + "description": obj.get("description"), + "href": obj.get("href"), + "md5": obj.get("md5"), + "metal_ip": obj.get("metal_ip"), + "metal_ipv6": obj.get("metal_ipv6"), + "name": obj.get("name"), + "peer_asn": obj.get("peer_asn"), + "speed": obj.get("speed"), + "subnet": obj.get("subnet"), + "subnet_ipv6": obj.get("subnet_ipv6"), + "tags": obj.get("tags") + }) + return _obj + + diff --git a/equinix/services/metalv1/rest.py b/equinix/services/metalv1/rest.py new file mode 100644 index 00000000..d7dd2906 --- /dev/null +++ b/equinix/services/metalv1/rest.py @@ -0,0 +1,254 @@ +# coding: utf-8 + +""" + Metal API + + 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 io +import json +import re +import ssl + +import urllib3 + +from equinix.services.metalv1.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } + if configuration.assert_hostname is not None: + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False + ) + # Pass a `string` parameter directly in the body to support + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/equinix/services/metalv1/test/__init__.py b/equinix/services/metalv1/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/equinix/services/metalv1/test/test_activate_hardware_reservation_request.py b/equinix/services/metalv1/test/test_activate_hardware_reservation_request.py new file mode 100644 index 00000000..11048125 --- /dev/null +++ b/equinix/services/metalv1/test/test_activate_hardware_reservation_request.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.activate_hardware_reservation_request import ActivateHardwareReservationRequest + +class TestActivateHardwareReservationRequest(unittest.TestCase): + """ActivateHardwareReservationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ActivateHardwareReservationRequest: + """Test ActivateHardwareReservationRequest + 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 `ActivateHardwareReservationRequest` + """ + model = ActivateHardwareReservationRequest() + if include_optional: + return ActivateHardwareReservationRequest( + description = '', + href = '' + ) + else: + return ActivateHardwareReservationRequest( + ) + """ + + def testActivateHardwareReservationRequest(self): + """Test ActivateHardwareReservationRequest""" + # 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_address.py b/equinix/services/metalv1/test/test_address.py new file mode 100644 index 00000000..4a30d6bd --- /dev/null +++ b/equinix/services/metalv1/test/test_address.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Metal API + + 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.address import Address + +class TestAddress(unittest.TestCase): + """Address unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Address: + """Test Address + 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 `Address` + """ + model = Address() + if include_optional: + return Address( + address = '', + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '' + ) + else: + return Address( + ) + """ + + def testAddress(self): + """Test Address""" + # 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_attribute.py b/equinix/services/metalv1/test/test_attribute.py new file mode 100644 index 00000000..17f07d41 --- /dev/null +++ b/equinix/services/metalv1/test/test_attribute.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Metal API + + 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.attribute import Attribute + +class TestAttribute(unittest.TestCase): + """Attribute unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Attribute: + """Test Attribute + 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 `Attribute` + """ + model = Attribute() + if include_optional: + return Attribute( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + data = equinix.services.metalv1.models.attribute_data.AttributeData( + href = '', + latest = True, + model = '', + plan = '', + vendor = '', ), + href = '', + namespace = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return Attribute( + ) + """ + + def testAttribute(self): + """Test Attribute""" + # 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_attribute_data.py b/equinix/services/metalv1/test/test_attribute_data.py new file mode 100644 index 00000000..ba35cc65 --- /dev/null +++ b/equinix/services/metalv1/test/test_attribute_data.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.attribute_data import AttributeData + +class TestAttributeData(unittest.TestCase): + """AttributeData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AttributeData: + """Test AttributeData + 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 `AttributeData` + """ + model = AttributeData() + if include_optional: + return AttributeData( + href = '', + latest = True, + model = '', + plan = '', + vendor = '' + ) + else: + return AttributeData( + ) + """ + + def testAttributeData(self): + """Test AttributeData""" + # 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_auth_token.py b/equinix/services/metalv1/test/test_auth_token.py new file mode 100644 index 00000000..b5e30de6 --- /dev/null +++ b/equinix/services/metalv1/test/test_auth_token.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.auth_token import AuthToken + +class TestAuthToken(unittest.TestCase): + """AuthToken unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AuthToken: + """Test AuthToken + 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 `AuthToken` + """ + model = AuthToken() + if include_optional: + return AuthToken( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + project = None, + read_only = True, + token = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = None + ) + else: + return AuthToken( + ) + """ + + def testAuthToken(self): + """Test AuthToken""" + # 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_auth_token_input.py b/equinix/services/metalv1/test/test_auth_token_input.py new file mode 100644 index 00000000..db275864 --- /dev/null +++ b/equinix/services/metalv1/test/test_auth_token_input.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.auth_token_input import AuthTokenInput + +class TestAuthTokenInput(unittest.TestCase): + """AuthTokenInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AuthTokenInput: + """Test AuthTokenInput + 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 `AuthTokenInput` + """ + model = AuthTokenInput() + if include_optional: + return AuthTokenInput( + description = '', + href = '', + read_only = True + ) + else: + return AuthTokenInput( + ) + """ + + def testAuthTokenInput(self): + """Test AuthTokenInput""" + # 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_auth_token_list.py b/equinix/services/metalv1/test/test_auth_token_list.py new file mode 100644 index 00000000..d6800a3c --- /dev/null +++ b/equinix/services/metalv1/test/test_auth_token_list.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Metal API + + 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.auth_token_list import AuthTokenList + +class TestAuthTokenList(unittest.TestCase): + """AuthTokenList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AuthTokenList: + """Test AuthTokenList + 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 `AuthTokenList` + """ + model = AuthTokenList() + if include_optional: + return AuthTokenList( + api_keys = [ + equinix.services.metalv1.models.auth_token.AuthToken( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + project = null, + read_only = True, + token = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = null, ) + ], + href = '' + ) + else: + return AuthTokenList( + ) + """ + + def testAuthTokenList(self): + """Test AuthTokenList""" + # 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_auth_token_project.py b/equinix/services/metalv1/test/test_auth_token_project.py new file mode 100644 index 00000000..3c874eb9 --- /dev/null +++ b/equinix/services/metalv1/test/test_auth_token_project.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Metal API + + 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.auth_token_project import AuthTokenProject + +class TestAuthTokenProject(unittest.TestCase): + """AuthTokenProject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AuthTokenProject: + """Test AuthTokenProject + 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 `AuthTokenProject` + """ + model = AuthTokenProject() + if include_optional: + return AuthTokenProject( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + memberships = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + payment_method = equinix.services.metalv1.models.href.Href( + href = '', ), + ssh_keys = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ] + ) + else: + return AuthTokenProject( + ) + """ + + def testAuthTokenProject(self): + """Test AuthTokenProject""" + # 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_auth_token_user.py b/equinix/services/metalv1/test/test_auth_token_user.py new file mode 100644 index 00000000..6710a960 --- /dev/null +++ b/equinix/services/metalv1/test/test_auth_token_user.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Metal API + + 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.auth_token_user import AuthTokenUser + +class TestAuthTokenUser(unittest.TestCase): + """AuthTokenUser unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AuthTokenUser: + """Test AuthTokenUser + 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 `AuthTokenUser` + """ + model = AuthTokenUser() + if include_optional: + return AuthTokenUser( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return AuthTokenUser( + ) + """ + + def testAuthTokenUser(self): + """Test AuthTokenUser""" + # 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_authentication_api.py b/equinix/services/metalv1/test/test_authentication_api.py new file mode 100644 index 00000000..fa22ced2 --- /dev/null +++ b/equinix/services/metalv1/test/test_authentication_api.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.authentication_api import AuthenticationApi + + +class TestAuthenticationApi(unittest.TestCase): + """AuthenticationApi unit test stubs""" + + def setUp(self) -> None: + self.api = AuthenticationApi() + + def tearDown(self) -> None: + pass + + def test_create_api_key(self) -> None: + """Test case for create_api_key + + Create an API key + """ + pass + + def test_create_project_api_key(self) -> None: + """Test case for create_project_api_key + + Create an API key for a project. + """ + pass + + def test_delete_api_key(self) -> None: + """Test case for delete_api_key + + Delete the API key + """ + pass + + def test_delete_user_api_key(self) -> None: + """Test case for delete_user_api_key + + Delete the API key + """ + pass + + def test_find_api_keys(self) -> None: + """Test case for find_api_keys + + Retrieve all user API keys + """ + pass + + def test_find_project_api_keys(self) -> None: + """Test case for find_project_api_keys + + Retrieve all API keys for the project. + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_aws_fabric_provider.py b/equinix/services/metalv1/test/test_aws_fabric_provider.py new file mode 100644 index 00000000..6743111b --- /dev/null +++ b/equinix/services/metalv1/test/test_aws_fabric_provider.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.aws_fabric_provider import AWSFabricProvider + +class TestAWSFabricProvider(unittest.TestCase): + """AWSFabricProvider unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AWSFabricProvider: + """Test AWSFabricProvider + 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 `AWSFabricProvider` + """ + model = AWSFabricProvider() + if include_optional: + return AWSFabricProvider( + account_id = '123412341234', + href = '', + location = 'us-west-1', + type = 'CSP_AWS' + ) + else: + return AWSFabricProvider( + account_id = '123412341234', + type = 'CSP_AWS', + ) + """ + + def testAWSFabricProvider(self): + """Test AWSFabricProvider""" + # 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_batch.py b/equinix/services/metalv1/test/test_batch.py new file mode 100644 index 00000000..f6fa13f8 --- /dev/null +++ b/equinix/services/metalv1/test/test_batch.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Metal API + + 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.batch import Batch + +class TestBatch(unittest.TestCase): + """Batch unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Batch: + """Test Batch + 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 `Batch` + """ + model = Batch() + if include_optional: + return Batch( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + error_messages = [ + '' + ], + href = '', + id = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + quantity = 56, + state = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return Batch( + ) + """ + + def testBatch(self): + """Test Batch""" + # 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_batches_api.py b/equinix/services/metalv1/test/test_batches_api.py new file mode 100644 index 00000000..b172e23a --- /dev/null +++ b/equinix/services/metalv1/test/test_batches_api.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.batches_api import BatchesApi + + +class TestBatchesApi(unittest.TestCase): + """BatchesApi unit test stubs""" + + def setUp(self) -> None: + self.api = BatchesApi() + + def tearDown(self) -> None: + pass + + def test_create_device_batch(self) -> None: + """Test case for create_device_batch + + Create a devices batch + """ + pass + + def test_delete_batch(self) -> None: + """Test case for delete_batch + + Delete the Batch + """ + pass + + def test_find_batch_by_id(self) -> None: + """Test case for find_batch_by_id + + Retrieve a Batch + """ + pass + + def test_find_batches_by_project(self) -> None: + """Test case for find_batches_by_project + + Retrieve all batches by project + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_batches_list.py b/equinix/services/metalv1/test/test_batches_list.py new file mode 100644 index 00000000..3bbe2b6b --- /dev/null +++ b/equinix/services/metalv1/test/test_batches_list.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Metal API + + 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.batches_list import BatchesList + +class TestBatchesList(unittest.TestCase): + """BatchesList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BatchesList: + """Test BatchesList + 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 `BatchesList` + """ + model = BatchesList() + if include_optional: + return BatchesList( + batches = [ + equinix.services.metalv1.models.batch.Batch( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + error_messages = [ + '' + ], + href = '', + id = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + quantity = 56, + state = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + href = '' + ) + else: + return BatchesList( + ) + """ + + def testBatchesList(self): + """Test BatchesList""" + # 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_bgp_api.py b/equinix/services/metalv1/test/test_bgp_api.py new file mode 100644 index 00000000..632fc1b5 --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_api.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.bgp_api import BGPApi + + +class TestBGPApi(unittest.TestCase): + """BGPApi unit test stubs""" + + def setUp(self) -> None: + self.api = BGPApi() + + def tearDown(self) -> None: + pass + + def test_delete_bgp_session(self) -> None: + """Test case for delete_bgp_session + + Delete the BGP session + """ + pass + + def test_find_bgp_config_by_project(self) -> None: + """Test case for find_bgp_config_by_project + + Retrieve a bgp config + """ + pass + + def test_find_bgp_session_by_id(self) -> None: + """Test case for find_bgp_session_by_id + + Retrieve a BGP session + """ + pass + + def test_find_global_bgp_ranges(self) -> None: + """Test case for find_global_bgp_ranges + + Retrieve all global bgp ranges + """ + pass + + def test_find_project_bgp_sessions(self) -> None: + """Test case for find_project_bgp_sessions + + Retrieve all BGP sessions for project + """ + pass + + def test_request_bgp_config(self) -> None: + """Test case for request_bgp_config + + Requesting bgp config + """ + pass + + def test_update_bgp_session(self) -> None: + """Test case for update_bgp_session + + Update the BGP session + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_bgp_config.py b/equinix/services/metalv1/test/test_bgp_config.py new file mode 100644 index 00000000..669ef526 --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_config.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_config import BgpConfig + +class TestBgpConfig(unittest.TestCase): + """BgpConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpConfig: + """Test BgpConfig + 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 `BgpConfig` + """ + model = BgpConfig() + if include_optional: + return BgpConfig( + asn = 65000, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + deployment_type = 'local', + href = '', + id = '', + max_prefix = 56, + md5 = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + ranges = [ + equinix.services.metalv1.models.global_bgp_range.GlobalBgpRange( + address_family = 56, + href = '', + id = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + range = '', ) + ], + requested_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + route_object = '', + sessions = [ + equinix.services.metalv1.models.bgp_session.BgpSession( + address_family = 'ipv4', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + default_route = True, + device = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + learned_routes = [ + '10.32.16.0/31' + ], + status = 'up,down', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + status = 'requested' + ) + else: + return BgpConfig( + ) + """ + + def testBgpConfig(self): + """Test BgpConfig""" + # 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_bgp_config_request_input.py b/equinix/services/metalv1/test/test_bgp_config_request_input.py new file mode 100644 index 00000000..9345a00b --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_config_request_input.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_config_request_input import BgpConfigRequestInput + +class TestBgpConfigRequestInput(unittest.TestCase): + """BgpConfigRequestInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpConfigRequestInput: + """Test BgpConfigRequestInput + 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 `BgpConfigRequestInput` + """ + model = BgpConfigRequestInput() + if include_optional: + return BgpConfigRequestInput( + asn = 65000, + deployment_type = 'local', + href = '', + md5 = 'jUR,rZ#UM/?R,Fp^l6$ARjeJk C>i H'qT\\{ BgpDynamicNeighbor: + """Test BgpDynamicNeighbor + 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 `BgpDynamicNeighbor` + """ + model = BgpDynamicNeighbor() + if include_optional: + return BgpDynamicNeighbor( + bgp_neighbor_asn = 12345, + bgp_neighbor_range = '192.168.1.0/25', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user_limited.UserLimited( + avatar_thumb_url = '', + avatar_url = '', + full_name = '', + href = '', + id = '', ), + href = '/bgp-dynamic-neighbors/aea82f16-57ec-412c-9523-b7f2b27635b2', + id = 'aea82f16-57ec-412c-9523-b7f2b27635b2', + metal_gateway = equinix.services.metalv1.models.vrf_metal_gateway.VrfMetalGateway( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + ip_reservation = equinix.services.metalv1.models.vrf_ip_reservation.VrfIpReservation( + address = '', + address_family = 56, + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + gateway = '', + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + public = True, + state = '', + tags = [ + '' + ], + type = 'vrf', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), ), + project = , + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = , + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + + ], + metro_code = '', + vxlan = 56, ), + vrf = , ), + state = 'active', + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return BgpDynamicNeighbor( + ) + """ + + def testBgpDynamicNeighbor(self): + """Test BgpDynamicNeighbor""" + # 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_bgp_dynamic_neighbor_create_input.py b/equinix/services/metalv1/test/test_bgp_dynamic_neighbor_create_input.py new file mode 100644 index 00000000..64577271 --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_dynamic_neighbor_create_input.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_dynamic_neighbor_create_input import BgpDynamicNeighborCreateInput + +class TestBgpDynamicNeighborCreateInput(unittest.TestCase): + """BgpDynamicNeighborCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpDynamicNeighborCreateInput: + """Test BgpDynamicNeighborCreateInput + 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 `BgpDynamicNeighborCreateInput` + """ + model = BgpDynamicNeighborCreateInput() + if include_optional: + return BgpDynamicNeighborCreateInput( + bgp_neighbor_asn = 12345, + bgp_neighbor_range = '192.168.1.0/25', + href = '', + tags = [ + '' + ] + ) + else: + return BgpDynamicNeighborCreateInput( + bgp_neighbor_asn = 12345, + bgp_neighbor_range = '192.168.1.0/25', + ) + """ + + def testBgpDynamicNeighborCreateInput(self): + """Test BgpDynamicNeighborCreateInput""" + # 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_bgp_dynamic_neighbor_list.py b/equinix/services/metalv1/test/test_bgp_dynamic_neighbor_list.py new file mode 100644 index 00000000..7ad253be --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_dynamic_neighbor_list.py @@ -0,0 +1,578 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_dynamic_neighbor_list import BgpDynamicNeighborList + +class TestBgpDynamicNeighborList(unittest.TestCase): + """BgpDynamicNeighborList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpDynamicNeighborList: + """Test BgpDynamicNeighborList + 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 `BgpDynamicNeighborList` + """ + model = BgpDynamicNeighborList() + if include_optional: + return BgpDynamicNeighborList( + bgp_dynamic_neighbors = [ + equinix.services.metalv1.models.bgp_dynamic_neighbor.BgpDynamicNeighbor( + bgp_neighbor_asn = 12345, + bgp_neighbor_range = '192.168.1.0/25', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user_limited.UserLimited( + avatar_thumb_url = '', + avatar_url = '', + full_name = '', + href = '', + id = '', ), + href = '/bgp-dynamic-neighbors/aea82f16-57ec-412c-9523-b7f2b27635b2', + id = 'aea82f16-57ec-412c-9523-b7f2b27635b2', + metal_gateway = equinix.services.metalv1.models.vrf_metal_gateway.VrfMetalGateway( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + ip_reservation = equinix.services.metalv1.models.vrf_ip_reservation.VrfIpReservation( + address = '', + address_family = 56, + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + gateway = '', + href = '', + id = '', + manageable = True, + management = True, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + public = True, + state = '', + tags = [ + '' + ], + type = 'vrf', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), ), + project = , + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = , + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + vrf = , ), + state = 'active', + tags = , + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ) + ) + else: + return BgpDynamicNeighborList( + ) + """ + + def testBgpDynamicNeighborList(self): + """Test BgpDynamicNeighborList""" + # 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_bgp_neighbor_data.py b/equinix/services/metalv1/test/test_bgp_neighbor_data.py new file mode 100644 index 00000000..b6ab499c --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_neighbor_data.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_neighbor_data import BgpNeighborData + +class TestBgpNeighborData(unittest.TestCase): + """BgpNeighborData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpNeighborData: + """Test BgpNeighborData + 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 `BgpNeighborData` + """ + model = BgpNeighborData() + if include_optional: + return BgpNeighborData( + address_family = 4, + customer_as = 65000, + customer_ip = '10.32.16.1 (IPv4) or 2604:1380:4111:2700::1 (IPv6)', + href = '', + md5_enabled = True, + md5_password = '', + multihop = True, + peer_as = 65530, + peer_ips = ["169.254.255.1","169.254.255.2"], + routes_in = [{"exact":true,"route":"10.32.16.0/31"}], + routes_out = [{"exact":true,"route":"0.0.0.0/0"}] + ) + else: + return BgpNeighborData( + ) + """ + + def testBgpNeighborData(self): + """Test BgpNeighborData""" + # 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_bgp_route.py b/equinix/services/metalv1/test/test_bgp_route.py new file mode 100644 index 00000000..a3396824 --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_route.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_route import BgpRoute + +class TestBgpRoute(unittest.TestCase): + """BgpRoute unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpRoute: + """Test BgpRoute + 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 `BgpRoute` + """ + model = BgpRoute() + if include_optional: + return BgpRoute( + exact = True, + href = '', + route = '10.32.16.0/31' + ) + else: + return BgpRoute( + ) + """ + + def testBgpRoute(self): + """Test BgpRoute""" + # 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_bgp_session.py b/equinix/services/metalv1/test/test_bgp_session.py new file mode 100644 index 00000000..2f0506af --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_session.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_session import BgpSession + +class TestBgpSession(unittest.TestCase): + """BgpSession unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpSession: + """Test BgpSession + 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 `BgpSession` + """ + model = BgpSession() + if include_optional: + return BgpSession( + address_family = 'ipv4', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + default_route = True, + device = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + learned_routes = [ + '10.32.16.0/31' + ], + status = 'up,down', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return BgpSession( + address_family = 'ipv4', + ) + """ + + def testBgpSession(self): + """Test BgpSession""" + # 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_bgp_session_input.py b/equinix/services/metalv1/test/test_bgp_session_input.py new file mode 100644 index 00000000..c3a9e7c2 --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_session_input.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_session_input import BGPSessionInput + +class TestBGPSessionInput(unittest.TestCase): + """BGPSessionInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BGPSessionInput: + """Test BGPSessionInput + 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 `BGPSessionInput` + """ + model = BGPSessionInput() + if include_optional: + return BGPSessionInput( + address_family = 'ipv4', + default_route = True, + href = '' + ) + else: + return BGPSessionInput( + ) + """ + + def testBGPSessionInput(self): + """Test BGPSessionInput""" + # 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_bgp_session_list.py b/equinix/services/metalv1/test/test_bgp_session_list.py new file mode 100644 index 00000000..7502d7cb --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_session_list.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_session_list import BgpSessionList + +class TestBgpSessionList(unittest.TestCase): + """BgpSessionList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpSessionList: + """Test BgpSessionList + 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 `BgpSessionList` + """ + model = BgpSessionList() + if include_optional: + return BgpSessionList( + bgp_sessions = [ + equinix.services.metalv1.models.bgp_session.BgpSession( + address_family = 'ipv4', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + default_route = True, + device = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + learned_routes = [ + '10.32.16.0/31' + ], + status = 'up,down', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + href = '' + ) + else: + return BgpSessionList( + ) + """ + + def testBgpSessionList(self): + """Test BgpSessionList""" + # 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_bgp_session_neighbors.py b/equinix/services/metalv1/test/test_bgp_session_neighbors.py new file mode 100644 index 00000000..1c2efa2a --- /dev/null +++ b/equinix/services/metalv1/test/test_bgp_session_neighbors.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Metal API + + 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.bgp_session_neighbors import BgpSessionNeighbors + +class TestBgpSessionNeighbors(unittest.TestCase): + """BgpSessionNeighbors unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BgpSessionNeighbors: + """Test BgpSessionNeighbors + 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 `BgpSessionNeighbors` + """ + model = BgpSessionNeighbors() + if include_optional: + return BgpSessionNeighbors( + bgp_neighbors = [ + equinix.services.metalv1.models.bgp_neighbor_data.BgpNeighborData( + address_family = 4, + customer_as = 65000, + customer_ip = '10.32.16.1 (IPv4) or 2604:1380:4111:2700::1 (IPv6)', + href = '', + md5_enabled = True, + md5_password = '', + multihop = True, + peer_as = 65530, + peer_ips = ["169.254.255.1","169.254.255.2"], + routes_in = [{"exact":true,"route":"10.32.16.0/31"}], + routes_out = [{"exact":true,"route":"0.0.0.0/0"}], ) + ], + href = '' + ) + else: + return BgpSessionNeighbors( + ) + """ + + def testBgpSessionNeighbors(self): + """Test BgpSessionNeighbors""" + # 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_bond_port_data.py b/equinix/services/metalv1/test/test_bond_port_data.py new file mode 100644 index 00000000..465ab4d6 --- /dev/null +++ b/equinix/services/metalv1/test/test_bond_port_data.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.bond_port_data import BondPortData + +class TestBondPortData(unittest.TestCase): + """BondPortData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BondPortData: + """Test BondPortData + 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 `BondPortData` + """ + model = BondPortData() + if include_optional: + return BondPortData( + href = '', + id = '', + name = '' + ) + else: + return BondPortData( + ) + """ + + def testBondPortData(self): + """Test BondPortData""" + # 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_capacity_api.py b/equinix/services/metalv1/test/test_capacity_api.py new file mode 100644 index 00000000..da2c3655 --- /dev/null +++ b/equinix/services/metalv1/test/test_capacity_api.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.capacity_api import CapacityApi + + +class TestCapacityApi(unittest.TestCase): + """CapacityApi unit test stubs""" + + def setUp(self) -> None: + self.api = CapacityApi() + + def tearDown(self) -> None: + pass + + def test_check_capacity_for_facility(self) -> None: + """Test case for check_capacity_for_facility + + Check capacity + """ + pass + + def test_check_capacity_for_metro(self) -> None: + """Test case for check_capacity_for_metro + + Check capacity for a metro + """ + pass + + def test_find_capacity_for_facility(self) -> None: + """Test case for find_capacity_for_facility + + View capacity + """ + pass + + def test_find_capacity_for_metro(self) -> None: + """Test case for find_capacity_for_metro + + View capacity for metros + """ + pass + + def test_find_organization_capacity_per_facility(self) -> None: + """Test case for find_organization_capacity_per_facility + + View available hardware plans per Facility for given organization + """ + pass + + def test_find_organization_capacity_per_metro(self) -> None: + """Test case for find_organization_capacity_per_metro + + View available hardware plans per Metro for given organization + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_capacity_check_per_facility_info.py b/equinix/services/metalv1/test/test_capacity_check_per_facility_info.py new file mode 100644 index 00000000..3652a969 --- /dev/null +++ b/equinix/services/metalv1/test/test_capacity_check_per_facility_info.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.capacity_check_per_facility_info import CapacityCheckPerFacilityInfo + +class TestCapacityCheckPerFacilityInfo(unittest.TestCase): + """CapacityCheckPerFacilityInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CapacityCheckPerFacilityInfo: + """Test CapacityCheckPerFacilityInfo + 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 `CapacityCheckPerFacilityInfo` + """ + model = CapacityCheckPerFacilityInfo() + if include_optional: + return CapacityCheckPerFacilityInfo( + available = True, + facility = '', + href = '', + plan = '', + quantity = '' + ) + else: + return CapacityCheckPerFacilityInfo( + ) + """ + + def testCapacityCheckPerFacilityInfo(self): + """Test CapacityCheckPerFacilityInfo""" + # 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_capacity_check_per_facility_list.py b/equinix/services/metalv1/test/test_capacity_check_per_facility_list.py new file mode 100644 index 00000000..fcd8a4c1 --- /dev/null +++ b/equinix/services/metalv1/test/test_capacity_check_per_facility_list.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.capacity_check_per_facility_list import CapacityCheckPerFacilityList + +class TestCapacityCheckPerFacilityList(unittest.TestCase): + """CapacityCheckPerFacilityList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CapacityCheckPerFacilityList: + """Test CapacityCheckPerFacilityList + 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 `CapacityCheckPerFacilityList` + """ + model = CapacityCheckPerFacilityList() + if include_optional: + return CapacityCheckPerFacilityList( + href = '', + servers = [ + equinix.services.metalv1.models.capacity_check_per_facility_info.CapacityCheckPerFacilityInfo( + available = True, + facility = '', + href = '', + plan = '', + quantity = '', ) + ] + ) + else: + return CapacityCheckPerFacilityList( + ) + """ + + def testCapacityCheckPerFacilityList(self): + """Test CapacityCheckPerFacilityList""" + # 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_capacity_check_per_metro_info.py b/equinix/services/metalv1/test/test_capacity_check_per_metro_info.py new file mode 100644 index 00000000..b5eb2477 --- /dev/null +++ b/equinix/services/metalv1/test/test_capacity_check_per_metro_info.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.capacity_check_per_metro_info import CapacityCheckPerMetroInfo + +class TestCapacityCheckPerMetroInfo(unittest.TestCase): + """CapacityCheckPerMetroInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CapacityCheckPerMetroInfo: + """Test CapacityCheckPerMetroInfo + 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 `CapacityCheckPerMetroInfo` + """ + model = CapacityCheckPerMetroInfo() + if include_optional: + return CapacityCheckPerMetroInfo( + available = True, + href = '', + metro = '', + plan = '', + quantity = '' + ) + else: + return CapacityCheckPerMetroInfo( + ) + """ + + def testCapacityCheckPerMetroInfo(self): + """Test CapacityCheckPerMetroInfo""" + # 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_capacity_check_per_metro_list.py b/equinix/services/metalv1/test/test_capacity_check_per_metro_list.py new file mode 100644 index 00000000..28831553 --- /dev/null +++ b/equinix/services/metalv1/test/test_capacity_check_per_metro_list.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.capacity_check_per_metro_list import CapacityCheckPerMetroList + +class TestCapacityCheckPerMetroList(unittest.TestCase): + """CapacityCheckPerMetroList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CapacityCheckPerMetroList: + """Test CapacityCheckPerMetroList + 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 `CapacityCheckPerMetroList` + """ + model = CapacityCheckPerMetroList() + if include_optional: + return CapacityCheckPerMetroList( + href = '', + servers = [ + equinix.services.metalv1.models.capacity_check_per_metro_info.CapacityCheckPerMetroInfo( + available = True, + href = '', + metro = '', + plan = '', + quantity = '', ) + ] + ) + else: + return CapacityCheckPerMetroList( + ) + """ + + def testCapacityCheckPerMetroList(self): + """Test CapacityCheckPerMetroList""" + # 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_capacity_input.py b/equinix/services/metalv1/test/test_capacity_input.py new file mode 100644 index 00000000..5d6680d1 --- /dev/null +++ b/equinix/services/metalv1/test/test_capacity_input.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.capacity_input import CapacityInput + +class TestCapacityInput(unittest.TestCase): + """CapacityInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CapacityInput: + """Test CapacityInput + 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 `CapacityInput` + """ + model = CapacityInput() + if include_optional: + return CapacityInput( + href = '', + servers = [ + equinix.services.metalv1.models.server_info.ServerInfo( + facility = '', + href = '', + metro = '', + plan = '', + quantity = '', ) + ] + ) + else: + return CapacityInput( + ) + """ + + def testCapacityInput(self): + """Test CapacityInput""" + # 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_capacity_level_per_baremetal.py b/equinix/services/metalv1/test/test_capacity_level_per_baremetal.py new file mode 100644 index 00000000..93651566 --- /dev/null +++ b/equinix/services/metalv1/test/test_capacity_level_per_baremetal.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.capacity_level_per_baremetal import CapacityLevelPerBaremetal + +class TestCapacityLevelPerBaremetal(unittest.TestCase): + """CapacityLevelPerBaremetal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CapacityLevelPerBaremetal: + """Test CapacityLevelPerBaremetal + 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 `CapacityLevelPerBaremetal` + """ + model = CapacityLevelPerBaremetal() + if include_optional: + return CapacityLevelPerBaremetal( + href = '', + level = '' + ) + else: + return CapacityLevelPerBaremetal( + ) + """ + + def testCapacityLevelPerBaremetal(self): + """Test CapacityLevelPerBaremetal""" + # 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_capacity_list.py b/equinix/services/metalv1/test/test_capacity_list.py new file mode 100644 index 00000000..f7671e2d --- /dev/null +++ b/equinix/services/metalv1/test/test_capacity_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.capacity_list import CapacityList + +class TestCapacityList(unittest.TestCase): + """CapacityList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CapacityList: + """Test CapacityList + 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 `CapacityList` + """ + model = CapacityList() + if include_optional: + return CapacityList( + capacity = { + 'key' : { + 'key' : equinix.services.metalv1.models.capacity_level_per_baremetal.CapacityLevelPerBaremetal( + href = '', + level = '', ) + } + }, + href = '' + ) + else: + return CapacityList( + ) + """ + + def testCapacityList(self): + """Test CapacityList""" + # 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_component.py b/equinix/services/metalv1/test/test_component.py new file mode 100644 index 00000000..bc716df0 --- /dev/null +++ b/equinix/services/metalv1/test/test_component.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Metal API + + 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.component import Component + +class TestComponent(unittest.TestCase): + """Component unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Component: + """Test Component + 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 `Component` + """ + model = Component() + if include_optional: + return Component( + checksum = '', + component = 'bmc', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + filename = '', + href = '', + model = [ + 'romed8hm3' + ], + repository_url = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + upstream_url = '', + uuid = '0516463a-47ee-4809-9a66-ece8c740eed9', + vendor = 'equinix', + version = '1.5.0' + ) + else: + return Component( + ) + """ + + def testComponent(self): + """Test Component""" + # 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_console_log_details_api.py b/equinix/services/metalv1/test/test_console_log_details_api.py new file mode 100644 index 00000000..224100e1 --- /dev/null +++ b/equinix/services/metalv1/test/test_console_log_details_api.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.console_log_details_api import ConsoleLogDetailsApi + + +class TestConsoleLogDetailsApi(unittest.TestCase): + """ConsoleLogDetailsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ConsoleLogDetailsApi() + + def tearDown(self) -> None: + pass + + def test_capture_screenshot(self) -> None: + """Test case for capture_screenshot + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_coordinates.py b/equinix/services/metalv1/test/test_coordinates.py new file mode 100644 index 00000000..f6c47b0b --- /dev/null +++ b/equinix/services/metalv1/test/test_coordinates.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.coordinates import Coordinates + +class TestCoordinates(unittest.TestCase): + """Coordinates unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Coordinates: + """Test Coordinates + 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 `Coordinates` + """ + model = Coordinates() + if include_optional: + return Coordinates( + href = '', + latitude = '', + longitude = '' + ) + else: + return Coordinates( + ) + """ + + def testCoordinates(self): + """Test Coordinates""" + # 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_create_device_request.py b/equinix/services/metalv1/test/test_create_device_request.py new file mode 100644 index 00000000..13e34d5d --- /dev/null +++ b/equinix/services/metalv1/test/test_create_device_request.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Metal API + + 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.create_device_request import CreateDeviceRequest + +class TestCreateDeviceRequest(unittest.TestCase): + """CreateDeviceRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateDeviceRequest: + """Test CreateDeviceRequest + 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 `CreateDeviceRequest` + """ + model = CreateDeviceRequest() + if include_optional: + return CreateDeviceRequest( + href = '', + metro = 'sv', + always_pxe = True, + billing_cycle = 'hourly', + customdata = { }, + description = '', + features = [ + '' + ], + hardware_reservation_id = 'next-available', + hostname = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_address.IPAddress( + address_family = 4, + cidr = 28, + href = '', + ip_reservations = [ + '' + ], + public = False, ) + ], + ipxe_script_url = '', + locked = True, + network_frozen = True, + no_ssh_keys = True, + operating_system = '', + plan = 'c3.large.x86', + private_ipv4_subnet_size = 56, + project_ssh_keys = [ + '' + ], + public_ipv4_subnet_size = 56, + spot_instance = True, + spot_price_max = 1.23, + ssh_keys = [ + equinix.services.metalv1.models.ssh_key_input.SSHKeyInput( + href = '', + key = '', + label = '', + tags = [ + '' + ], ) + ], + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + device = '', + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + device = '', + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + devices = [ + '' + ], + href = '', + level = '', + name = '', ) + ], ), + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user_ssh_keys = [ + '' + ], + userdata = '', + facility = None + ) + else: + return CreateDeviceRequest( + metro = 'sv', + operating_system = '', + plan = 'c3.large.x86', + facility = None, + ) + """ + + def testCreateDeviceRequest(self): + """Test CreateDeviceRequest""" + # 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_create_email_input.py b/equinix/services/metalv1/test/test_create_email_input.py new file mode 100644 index 00000000..8cf90184 --- /dev/null +++ b/equinix/services/metalv1/test/test_create_email_input.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.create_email_input import CreateEmailInput + +class TestCreateEmailInput(unittest.TestCase): + """CreateEmailInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateEmailInput: + """Test CreateEmailInput + 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 `CreateEmailInput` + """ + model = CreateEmailInput() + if include_optional: + return CreateEmailInput( + address = '', + href = '' + ) + else: + return CreateEmailInput( + address = '', + ) + """ + + def testCreateEmailInput(self): + """Test CreateEmailInput""" + # 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_create_metal_gateway_request.py b/equinix/services/metalv1/test/test_create_metal_gateway_request.py new file mode 100644 index 00000000..755a1fd8 --- /dev/null +++ b/equinix/services/metalv1/test/test_create_metal_gateway_request.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.create_metal_gateway_request import CreateMetalGatewayRequest + +class TestCreateMetalGatewayRequest(unittest.TestCase): + """CreateMetalGatewayRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateMetalGatewayRequest: + """Test CreateMetalGatewayRequest + 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 `CreateMetalGatewayRequest` + """ + model = CreateMetalGatewayRequest() + if include_optional: + return CreateMetalGatewayRequest( + href = '', + ip_reservation_id = '', + private_ipv4_subnet_size = 56, + virtual_network_id = '' + ) + else: + return CreateMetalGatewayRequest( + ip_reservation_id = '', + virtual_network_id = '', + ) + """ + + def testCreateMetalGatewayRequest(self): + """Test CreateMetalGatewayRequest""" + # 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_create_organization_interconnection_request.py b/equinix/services/metalv1/test/test_create_organization_interconnection_request.py new file mode 100644 index 00000000..01ec2372 --- /dev/null +++ b/equinix/services/metalv1/test/test_create_organization_interconnection_request.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Metal API + + 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.create_organization_interconnection_request import CreateOrganizationInterconnectionRequest + +class TestCreateOrganizationInterconnectionRequest(unittest.TestCase): + """CreateOrganizationInterconnectionRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateOrganizationInterconnectionRequest: + """Test CreateOrganizationInterconnectionRequest + 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 `CreateOrganizationInterconnectionRequest` + """ + model = CreateOrganizationInterconnectionRequest() + if include_optional: + return CreateOrganizationInterconnectionRequest( + billing_account_name = '', + contact_email = '', + description = '', + facility_id = '', + href = '', + metro = '', + mode = 'standard', + name = '', + project = '', + redundancy = '', + speed = '10000000000', + tags = [ + '' + ], + type = 'dedicated', + use_case = '', + service_token_type = 'a_side', + vlans = [1000, 1001], + vrfs = [ + '' + ], + fabric_provider = None + ) + else: + return CreateOrganizationInterconnectionRequest( + metro = '', + name = '', + project = '', + redundancy = '', + type = 'dedicated', + service_token_type = 'a_side', + vlans = [1000, 1001], + vrfs = [ + '' + ], + fabric_provider = None, + ) + """ + + def testCreateOrganizationInterconnectionRequest(self): + """Test CreateOrganizationInterconnectionRequest""" + # 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_create_self_service_reservation_request.py b/equinix/services/metalv1/test/test_create_self_service_reservation_request.py new file mode 100644 index 00000000..fe544dba --- /dev/null +++ b/equinix/services/metalv1/test/test_create_self_service_reservation_request.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Metal API + + 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.create_self_service_reservation_request import CreateSelfServiceReservationRequest + +class TestCreateSelfServiceReservationRequest(unittest.TestCase): + """CreateSelfServiceReservationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateSelfServiceReservationRequest: + """Test CreateSelfServiceReservationRequest + 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 `CreateSelfServiceReservationRequest` + """ + model = CreateSelfServiceReservationRequest() + if include_optional: + return CreateSelfServiceReservationRequest( + href = '', + item = [ + equinix.services.metalv1.models.self_service_reservation_item_request.SelfServiceReservationItemRequest( + href = '', + metro_id = '', + plan_id = '', + quantity = 56, + term = '', ) + ], + notes = '', + period = equinix.services.metalv1.models.create_self_service_reservation_request_period.CreateSelfServiceReservationRequest_period( + count = 12, + href = '', + unit = 'monthly', ), + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return CreateSelfServiceReservationRequest( + ) + """ + + def testCreateSelfServiceReservationRequest(self): + """Test CreateSelfServiceReservationRequest""" + # 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_create_self_service_reservation_request_period.py b/equinix/services/metalv1/test/test_create_self_service_reservation_request_period.py new file mode 100644 index 00000000..05fd86fe --- /dev/null +++ b/equinix/services/metalv1/test/test_create_self_service_reservation_request_period.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.create_self_service_reservation_request_period import CreateSelfServiceReservationRequestPeriod + +class TestCreateSelfServiceReservationRequestPeriod(unittest.TestCase): + """CreateSelfServiceReservationRequestPeriod unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateSelfServiceReservationRequestPeriod: + """Test CreateSelfServiceReservationRequestPeriod + 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 `CreateSelfServiceReservationRequestPeriod` + """ + model = CreateSelfServiceReservationRequestPeriod() + if include_optional: + return CreateSelfServiceReservationRequestPeriod( + count = 12, + href = '', + unit = 'monthly' + ) + else: + return CreateSelfServiceReservationRequestPeriod( + ) + """ + + def testCreateSelfServiceReservationRequestPeriod(self): + """Test CreateSelfServiceReservationRequestPeriod""" + # 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_dedicated_port_create_input.py b/equinix/services/metalv1/test/test_dedicated_port_create_input.py new file mode 100644 index 00000000..e38cfe5b --- /dev/null +++ b/equinix/services/metalv1/test/test_dedicated_port_create_input.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Metal API + + 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.dedicated_port_create_input import DedicatedPortCreateInput + +class TestDedicatedPortCreateInput(unittest.TestCase): + """DedicatedPortCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DedicatedPortCreateInput: + """Test DedicatedPortCreateInput + 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 `DedicatedPortCreateInput` + """ + model = DedicatedPortCreateInput() + if include_optional: + return DedicatedPortCreateInput( + billing_account_name = '', + contact_email = '', + description = '', + facility_id = '', + href = '', + metro = '', + mode = 'standard', + name = '', + project = '', + redundancy = '', + speed = '10000000000', + tags = [ + '' + ], + type = 'dedicated', + use_case = '' + ) + else: + return DedicatedPortCreateInput( + metro = '', + name = '', + redundancy = '', + type = 'dedicated', + ) + """ + + def testDedicatedPortCreateInput(self): + """Test DedicatedPortCreateInput""" + # 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_device.py b/equinix/services/metalv1/test/test_device.py new file mode 100644 index 00000000..06551b61 --- /dev/null +++ b/equinix/services/metalv1/test/test_device.py @@ -0,0 +1,1119 @@ +# coding: utf-8 + +""" + Metal API + + 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.device import Device + +class TestDevice(unittest.TestCase): + """Device unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Device: + """Test Device + 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 `Device` + """ + model = Device() + if include_optional: + return Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = None, + customdata = { }, + description = '', + facility = equinix.services.metalv1.models.facility.Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = null, + name = '', ), + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + facility = equinix.services.metalv1.models.facility.Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = null, + name = '', ), + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address_family = 56, + assigned_to = equinix.services.metalv1.models.href.Href( + href = '', ), + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + ssh_keys = [ + + ], + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', + volumes = [ + + ], ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + tags = , + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metro_code = '', + vxlan = 56, ) + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + ssh_keys = , + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + tags = , + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', + volumes = , ), + facility = equinix.services.metalv1.models.facility.Facility( + code = '', + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + name = '', ), + href = '', + id = '', + need_of_service = True, + plan = , + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = equinix.services.metalv1.models.href.Href( + href = '', ), + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = None, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metro_code = '', + vxlan = 56, ) + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = None, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + ssh_keys = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + device = '', + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + device = '', + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + devices = [ + '' + ], + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', + volumes = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ] + ) + else: + return Device( + ) + """ + + def testDevice(self): + """Test Device""" + # 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_device_action_input.py b/equinix/services/metalv1/test/test_device_action_input.py new file mode 100644 index 00000000..17108d40 --- /dev/null +++ b/equinix/services/metalv1/test/test_device_action_input.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_action_input import DeviceActionInput + +class TestDeviceActionInput(unittest.TestCase): + """DeviceActionInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceActionInput: + """Test DeviceActionInput + 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 `DeviceActionInput` + """ + model = DeviceActionInput() + if include_optional: + return DeviceActionInput( + deprovision_fast = True, + force_delete = True, + href = '', + ipxe_script_url = '', + operating_system = 'ubuntu_22_04', + preserve_data = True, + type = 'power_on' + ) + else: + return DeviceActionInput( + type = 'power_on', + ) + """ + + def testDeviceActionInput(self): + """Test DeviceActionInput""" + # 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_device_actions_inner.py b/equinix/services/metalv1/test/test_device_actions_inner.py new file mode 100644 index 00000000..5c403182 --- /dev/null +++ b/equinix/services/metalv1/test/test_device_actions_inner.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_actions_inner import DeviceActionsInner + +class TestDeviceActionsInner(unittest.TestCase): + """DeviceActionsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceActionsInner: + """Test DeviceActionsInner + 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 `DeviceActionsInner` + """ + model = DeviceActionsInner() + if include_optional: + return DeviceActionsInner( + href = '', + name = '', + type = '' + ) + else: + return DeviceActionsInner( + ) + """ + + def testDeviceActionsInner(self): + """Test DeviceActionsInner""" + # 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_device_create_in_facility_input.py b/equinix/services/metalv1/test/test_device_create_in_facility_input.py new file mode 100644 index 00000000..448184a8 --- /dev/null +++ b/equinix/services/metalv1/test/test_device_create_in_facility_input.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_create_in_facility_input import DeviceCreateInFacilityInput + +class TestDeviceCreateInFacilityInput(unittest.TestCase): + """DeviceCreateInFacilityInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceCreateInFacilityInput: + """Test DeviceCreateInFacilityInput + 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 `DeviceCreateInFacilityInput` + """ + model = DeviceCreateInFacilityInput() + if include_optional: + return DeviceCreateInFacilityInput( + facility = None, + href = '', + always_pxe = True, + billing_cycle = 'hourly', + customdata = { }, + description = '', + features = [ + '' + ], + hardware_reservation_id = 'next-available', + hostname = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_address.IPAddress( + address_family = 4, + cidr = 28, + href = '', + ip_reservations = [ + '' + ], + public = False, ) + ], + ipxe_script_url = '', + locked = True, + network_frozen = True, + no_ssh_keys = True, + operating_system = '', + plan = 'c3.large.x86', + private_ipv4_subnet_size = 56, + project_ssh_keys = [ + '' + ], + public_ipv4_subnet_size = 56, + spot_instance = True, + spot_price_max = 1.23, + ssh_keys = [ + equinix.services.metalv1.models.ssh_key_input.SSHKeyInput( + href = '', + key = '', + label = '', + tags = [ + '' + ], ) + ], + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + device = '', + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + device = '', + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + devices = [ + '' + ], + href = '', + level = '', + name = '', ) + ], ), + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user_ssh_keys = [ + '' + ], + userdata = '' + ) + else: + return DeviceCreateInFacilityInput( + facility = None, + operating_system = '', + plan = 'c3.large.x86', + ) + """ + + def testDeviceCreateInFacilityInput(self): + """Test DeviceCreateInFacilityInput""" + # 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_device_create_in_metro_input.py b/equinix/services/metalv1/test/test_device_create_in_metro_input.py new file mode 100644 index 00000000..bd0129ec --- /dev/null +++ b/equinix/services/metalv1/test/test_device_create_in_metro_input.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_create_in_metro_input import DeviceCreateInMetroInput + +class TestDeviceCreateInMetroInput(unittest.TestCase): + """DeviceCreateInMetroInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceCreateInMetroInput: + """Test DeviceCreateInMetroInput + 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 `DeviceCreateInMetroInput` + """ + model = DeviceCreateInMetroInput() + if include_optional: + return DeviceCreateInMetroInput( + href = '', + metro = 'sv', + always_pxe = True, + billing_cycle = 'hourly', + customdata = { }, + description = '', + features = [ + '' + ], + hardware_reservation_id = 'next-available', + hostname = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_address.IPAddress( + address_family = 4, + cidr = 28, + href = '', + ip_reservations = [ + '' + ], + public = False, ) + ], + ipxe_script_url = '', + locked = True, + network_frozen = True, + no_ssh_keys = True, + operating_system = '', + plan = 'c3.large.x86', + private_ipv4_subnet_size = 56, + project_ssh_keys = [ + '' + ], + public_ipv4_subnet_size = 56, + spot_instance = True, + spot_price_max = 1.23, + ssh_keys = [ + equinix.services.metalv1.models.ssh_key_input.SSHKeyInput( + href = '', + key = '', + label = '', + tags = [ + '' + ], ) + ], + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + device = '', + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + device = '', + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + devices = [ + '' + ], + href = '', + level = '', + name = '', ) + ], ), + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user_ssh_keys = [ + '' + ], + userdata = '' + ) + else: + return DeviceCreateInMetroInput( + metro = 'sv', + operating_system = '', + plan = 'c3.large.x86', + ) + """ + + def testDeviceCreateInMetroInput(self): + """Test DeviceCreateInMetroInput""" + # 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_device_create_input.py b/equinix/services/metalv1/test/test_device_create_input.py new file mode 100644 index 00000000..9d58cc7e --- /dev/null +++ b/equinix/services/metalv1/test/test_device_create_input.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_create_input import DeviceCreateInput + +class TestDeviceCreateInput(unittest.TestCase): + """DeviceCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceCreateInput: + """Test DeviceCreateInput + 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 `DeviceCreateInput` + """ + model = DeviceCreateInput() + if include_optional: + return DeviceCreateInput( + always_pxe = True, + billing_cycle = 'hourly', + customdata = { }, + description = '', + features = [ + '' + ], + hardware_reservation_id = 'next-available', + hostname = '', + href = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_address.IPAddress( + address_family = 4, + cidr = 28, + href = '', + ip_reservations = [ + '' + ], + public = False, ) + ], + ipxe_script_url = '', + locked = True, + network_frozen = True, + no_ssh_keys = True, + operating_system = '', + plan = 'c3.large.x86', + private_ipv4_subnet_size = 56, + project_ssh_keys = [ + '' + ], + public_ipv4_subnet_size = 56, + spot_instance = True, + spot_price_max = 1.23, + ssh_keys = [ + equinix.services.metalv1.models.ssh_key_input.SSHKeyInput( + href = '', + key = '', + label = '', + tags = [ + '' + ], ) + ], + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + device = '', + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + device = '', + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + devices = [ + '' + ], + href = '', + level = '', + name = '', ) + ], ), + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user_ssh_keys = [ + '' + ], + userdata = '' + ) + else: + return DeviceCreateInput( + operating_system = '', + plan = 'c3.large.x86', + ) + """ + + def testDeviceCreateInput(self): + """Test DeviceCreateInput""" + # 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_device_created_by.py b/equinix/services/metalv1/test/test_device_created_by.py new file mode 100644 index 00000000..9c05c24b --- /dev/null +++ b/equinix/services/metalv1/test/test_device_created_by.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_created_by import DeviceCreatedBy + +class TestDeviceCreatedBy(unittest.TestCase): + """DeviceCreatedBy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceCreatedBy: + """Test DeviceCreatedBy + 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 `DeviceCreatedBy` + """ + model = DeviceCreatedBy() + if include_optional: + return DeviceCreatedBy( + avatar_thumb_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + email = '', + first_name = '', + full_name = '', + href = '', + id = '', + last_name = '', + short_id = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return DeviceCreatedBy( + id = '', + short_id = '', + ) + """ + + def testDeviceCreatedBy(self): + """Test DeviceCreatedBy""" + # 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_device_health_rollup.py b/equinix/services/metalv1/test/test_device_health_rollup.py new file mode 100644 index 00000000..1e7487cf --- /dev/null +++ b/equinix/services/metalv1/test/test_device_health_rollup.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_health_rollup import DeviceHealthRollup + +class TestDeviceHealthRollup(unittest.TestCase): + """DeviceHealthRollup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceHealthRollup: + """Test DeviceHealthRollup + 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 `DeviceHealthRollup` + """ + model = DeviceHealthRollup() + if include_optional: + return DeviceHealthRollup( + health_rollup = 'ok', + href = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return DeviceHealthRollup( + ) + """ + + def testDeviceHealthRollup(self): + """Test DeviceHealthRollup""" + # 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_device_list.py b/equinix/services/metalv1/test/test_device_list.py new file mode 100644 index 00000000..71860304 --- /dev/null +++ b/equinix/services/metalv1/test/test_device_list.py @@ -0,0 +1,491 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_list import DeviceList + +class TestDeviceList(unittest.TestCase): + """DeviceList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceList: + """Test DeviceList + 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 `DeviceList` + """ + model = DeviceList() + if include_optional: + return DeviceList( + devices = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + facility = equinix.services.metalv1.models.facility.Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = null, + name = '', ), + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address_family = 56, + assigned_to = equinix.services.metalv1.models.href.Href( + href = '', ), + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + instances = [ + + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metro_code = '', + vxlan = 56, ) + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + ssh_keys = [ + + ], + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', + volumes = [ + + ], ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + ssh_keys = , + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + tags = , + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', + volumes = , ) + ], + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ) + ) + else: + return DeviceList( + ) + """ + + def testDeviceList(self): + """Test DeviceList""" + # 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_device_metro.py b/equinix/services/metalv1/test/test_device_metro.py new file mode 100644 index 00000000..c9d1923d --- /dev/null +++ b/equinix/services/metalv1/test/test_device_metro.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_metro import DeviceMetro + +class TestDeviceMetro(unittest.TestCase): + """DeviceMetro unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceMetro: + """Test DeviceMetro + 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 `DeviceMetro` + """ + model = DeviceMetro() + if include_optional: + return DeviceMetro( + code = '', + country = '', + href = '', + id = '', + name = '' + ) + else: + return DeviceMetro( + ) + """ + + def testDeviceMetro(self): + """Test DeviceMetro""" + # 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_device_project_lite.py b/equinix/services/metalv1/test/test_device_project_lite.py new file mode 100644 index 00000000..42425a49 --- /dev/null +++ b/equinix/services/metalv1/test/test_device_project_lite.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_project_lite import DeviceProjectLite + +class TestDeviceProjectLite(unittest.TestCase): + """DeviceProjectLite unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceProjectLite: + """Test DeviceProjectLite + 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 `DeviceProjectLite` + """ + model = DeviceProjectLite() + if include_optional: + return DeviceProjectLite( + href = '' + ) + else: + return DeviceProjectLite( + href = '', + ) + """ + + def testDeviceProjectLite(self): + """Test DeviceProjectLite""" + # 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_device_update_input.py b/equinix/services/metalv1/test/test_device_update_input.py new file mode 100644 index 00000000..1e12a302 --- /dev/null +++ b/equinix/services/metalv1/test/test_device_update_input.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_update_input import DeviceUpdateInput + +class TestDeviceUpdateInput(unittest.TestCase): + """DeviceUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceUpdateInput: + """Test DeviceUpdateInput + 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 `DeviceUpdateInput` + """ + model = DeviceUpdateInput() + if include_optional: + return DeviceUpdateInput( + always_pxe = True, + billing_cycle = '', + customdata = { }, + description = '', + firmware_set_id = '', + hostname = '', + href = '', + ipxe_script_url = '', + locked = True, + network_frozen = True, + spot_instance = True, + tags = [ + '' + ], + userdata = '' + ) + else: + return DeviceUpdateInput( + ) + """ + + def testDeviceUpdateInput(self): + """Test DeviceUpdateInput""" + # 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_device_usage.py b/equinix/services/metalv1/test/test_device_usage.py new file mode 100644 index 00000000..074f971d --- /dev/null +++ b/equinix/services/metalv1/test/test_device_usage.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_usage import DeviceUsage + +class TestDeviceUsage(unittest.TestCase): + """DeviceUsage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceUsage: + """Test DeviceUsage + 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 `DeviceUsage` + """ + model = DeviceUsage() + if include_optional: + return DeviceUsage( + href = '', + quantity = '', + total = '', + unit = '' + ) + else: + return DeviceUsage( + ) + """ + + def testDeviceUsage(self): + """Test DeviceUsage""" + # 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_device_usage_list.py b/equinix/services/metalv1/test/test_device_usage_list.py new file mode 100644 index 00000000..5d7698fa --- /dev/null +++ b/equinix/services/metalv1/test/test_device_usage_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.device_usage_list import DeviceUsageList + +class TestDeviceUsageList(unittest.TestCase): + """DeviceUsageList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DeviceUsageList: + """Test DeviceUsageList + 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 `DeviceUsageList` + """ + model = DeviceUsageList() + if include_optional: + return DeviceUsageList( + href = '', + usages = [ + equinix.services.metalv1.models.device_usage.DeviceUsage( + href = '', + quantity = '', + total = '', + unit = '', ) + ] + ) + else: + return DeviceUsageList( + ) + """ + + def testDeviceUsageList(self): + """Test DeviceUsageList""" + # 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_devices_api.py b/equinix/services/metalv1/test/test_devices_api.py new file mode 100644 index 00000000..a24b4c4c --- /dev/null +++ b/equinix/services/metalv1/test/test_devices_api.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.devices_api import DevicesApi + + +class TestDevicesApi(unittest.TestCase): + """DevicesApi unit test stubs""" + + def setUp(self) -> None: + self.api = DevicesApi() + + def tearDown(self) -> None: + pass + + def test_create_bgp_session(self) -> None: + """Test case for create_bgp_session + + Create a BGP session + """ + pass + + def test_create_device(self) -> None: + """Test case for create_device + + Create a device + """ + pass + + def test_create_ip_assignment(self) -> None: + """Test case for create_ip_assignment + + Create an ip assignment + """ + pass + + def test_delete_device(self) -> None: + """Test case for delete_device + + Delete the device + """ + pass + + def test_find_bgp_sessions(self) -> None: + """Test case for find_bgp_sessions + + Retrieve all BGP sessions + """ + pass + + def test_find_device_by_id(self) -> None: + """Test case for find_device_by_id + + Retrieve a device + """ + pass + + def test_find_device_customdata(self) -> None: + """Test case for find_device_customdata + + Retrieve the custom metadata of an instance + """ + pass + + def test_find_device_metadata_by_id(self) -> None: + """Test case for find_device_metadata_by_id + + Retrieve metadata + """ + pass + + def test_find_device_userdata_by_id(self) -> None: + """Test case for find_device_userdata_by_id + + Retrieve userdata + """ + pass + + def test_find_instance_bandwidth(self) -> None: + """Test case for find_instance_bandwidth + + Retrieve an instance bandwidth + """ + pass + + def test_find_ip_assignment_customdata(self) -> None: + """Test case for find_ip_assignment_customdata + + Retrieve the custom metadata of an IP Assignment + """ + pass + + def test_find_ip_assignments(self) -> None: + """Test case for find_ip_assignments + + Retrieve all ip assignments + """ + pass + + def test_find_organization_devices(self) -> None: + """Test case for find_organization_devices + + Retrieve all devices of an organization + """ + pass + + def test_find_organization_devices_all_pages(self): + """Test case for find_organization_devices_all_pages + + Retrieve all devices of an organization # noqa: E501 + """ + pass + + def test_find_project_devices(self) -> None: + """Test case for find_project_devices + + Retrieve all devices of a project + """ + pass + + def test_find_project_devices_all_pages(self): + """Test case for find_project_devices_all_pages + + Retrieve all devices of a project # noqa: E501 + """ + pass + + def test_find_traffic(self) -> None: + """Test case for find_traffic + + Retrieve device traffic + """ + pass + + def test_get_bgp_neighbor_data(self) -> None: + """Test case for get_bgp_neighbor_data + + Retrieve BGP neighbor data for this device + """ + pass + + def test_get_device_firmware_sets(self) -> None: + """Test case for get_device_firmware_sets + + Get Device's associated Firmware Set + """ + pass + + def test_get_device_health_rollup(self) -> None: + """Test case for get_device_health_rollup + + Get Device's Health Status + """ + pass + + def test_perform_action(self) -> None: + """Test case for perform_action + + Perform an action + """ + pass + + def test_update_device(self) -> None: + """Test case for update_device + + Update the device + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_disk.py b/equinix/services/metalv1/test/test_disk.py new file mode 100644 index 00000000..904a7d78 --- /dev/null +++ b/equinix/services/metalv1/test/test_disk.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Metal API + + 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.disk import Disk + +class TestDisk(unittest.TestCase): + """Disk unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Disk: + """Test Disk + 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 `Disk` + """ + model = Disk() + if include_optional: + return Disk( + device = '', + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True + ) + else: + return Disk( + ) + """ + + def testDisk(self): + """Test Disk""" + # 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_email.py b/equinix/services/metalv1/test/test_email.py new file mode 100644 index 00000000..654ac3cc --- /dev/null +++ b/equinix/services/metalv1/test/test_email.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.email import Email + +class TestEmail(unittest.TestCase): + """Email unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Email: + """Test Email + 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 `Email` + """ + model = Email() + if include_optional: + return Email( + address = '', + default = True, + href = '', + id = '', + verified = True + ) + else: + return Email( + ) + """ + + def testEmail(self): + """Test Email""" + # 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_email_input.py b/equinix/services/metalv1/test/test_email_input.py new file mode 100644 index 00000000..973894c0 --- /dev/null +++ b/equinix/services/metalv1/test/test_email_input.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.email_input import EmailInput + +class TestEmailInput(unittest.TestCase): + """EmailInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EmailInput: + """Test EmailInput + 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 `EmailInput` + """ + model = EmailInput() + if include_optional: + return EmailInput( + address = '', + default = True, + href = '' + ) + else: + return EmailInput( + address = '', + ) + """ + + def testEmailInput(self): + """Test EmailInput""" + # 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_emails_api.py b/equinix/services/metalv1/test/test_emails_api.py new file mode 100644 index 00000000..474c2202 --- /dev/null +++ b/equinix/services/metalv1/test/test_emails_api.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.emails_api import EmailsApi + + +class TestEmailsApi(unittest.TestCase): + """EmailsApi unit test stubs""" + + def setUp(self) -> None: + self.api = EmailsApi() + + def tearDown(self) -> None: + pass + + def test_create_email(self) -> None: + """Test case for create_email + + Create an email + """ + pass + + def test_delete_email(self) -> None: + """Test case for delete_email + + Delete the email + """ + pass + + def test_find_email_by_id(self) -> None: + """Test case for find_email_by_id + + Retrieve an email + """ + pass + + def test_update_email(self) -> None: + """Test case for update_email + + Update the email + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_entitlement.py b/equinix/services/metalv1/test/test_entitlement.py new file mode 100644 index 00000000..b803ede2 --- /dev/null +++ b/equinix/services/metalv1/test/test_entitlement.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Metal API + + 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.entitlement import Entitlement + +class TestEntitlement(unittest.TestCase): + """Entitlement unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Entitlement: + """Test Entitlement + 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 `Entitlement` + """ + model = Entitlement() + if include_optional: + return Entitlement( + description = '', + feature_access = None, + href = '', + id = '', + instance_quota = None, + ip_quota = None, + name = '', + project_quota = 56, + slug = '', + volume_limits = None, + volume_quota = None, + weight = 56 + ) + else: + return Entitlement( + id = '', + slug = '', + weight = 56, + ) + """ + + def testEntitlement(self): + """Test Entitlement""" + # 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_error.py b/equinix/services/metalv1/test/test_error.py new file mode 100644 index 00000000..8bf9c440 --- /dev/null +++ b/equinix/services/metalv1/test/test_error.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.error import Error + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + 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 `Error` + """ + model = Error() + if include_optional: + return Error( + error = '', + errors = [ + '' + ], + href = '' + ) + else: + return Error( + ) + """ + + def testError(self): + """Test Error""" + # 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_event.py b/equinix/services/metalv1/test/test_event.py new file mode 100644 index 00000000..66f3a796 --- /dev/null +++ b/equinix/services/metalv1/test/test_event.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Metal API + + 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.event import Event + +class TestEvent(unittest.TestCase): + """Event unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Event: + """Test Event + 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 `Event` + """ + model = Event() + if include_optional: + return Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + state = '', + type = '' + ) + else: + return Event( + ) + """ + + def testEvent(self): + """Test Event""" + # 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_event_list.py b/equinix/services/metalv1/test/test_event_list.py new file mode 100644 index 00000000..e2940043 --- /dev/null +++ b/equinix/services/metalv1/test/test_event_list.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Metal API + + 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.event_list import EventList + +class TestEventList(unittest.TestCase): + """EventList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EventList: + """Test EventList + 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 `EventList` + """ + model = EventList() + if include_optional: + return EventList( + events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + state = '', + type = '', ) + ], + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ) + ) + else: + return EventList( + ) + """ + + def testEventList(self): + """Test EventList""" + # 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_events_api.py b/equinix/services/metalv1/test/test_events_api.py new file mode 100644 index 00000000..26fd44b1 --- /dev/null +++ b/equinix/services/metalv1/test/test_events_api.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.events_api import EventsApi + + +class TestEventsApi(unittest.TestCase): + """EventsApi unit test stubs""" + + def setUp(self) -> None: + self.api = EventsApi() + + def tearDown(self) -> None: + pass + + def test_find_device_events(self) -> None: + """Test case for find_device_events + + Retrieve device's events + """ + pass + + def test_find_device_events_all_pages(self): + """Test case for find_device_events_all_pages + + Retrieve device's events # noqa: E501 + """ + pass + + def test_find_event_by_id(self) -> None: + """Test case for find_event_by_id + + Retrieve an event + """ + pass + + def test_find_events(self) -> None: + """Test case for find_events + + Retrieve current user's events + """ + pass + + def test_find_events_all_pages(self): + """Test case for find_events_all_pages + + Retrieve current user's events # noqa: E501 + """ + pass + + def test_find_interconnection_events(self) -> None: + """Test case for find_interconnection_events + + Retrieve interconnection events + """ + pass + + def test_find_interconnection_events_all_pages(self): + """Test case for find_interconnection_events_all_pages + + Retrieve interconnection events # noqa: E501 + """ + pass + + def test_find_interconnection_port_events(self) -> None: + """Test case for find_interconnection_port_events + + Retrieve interconnection port events + """ + pass + + def test_find_organization_events(self) -> None: + """Test case for find_organization_events + + Retrieve organization's events + """ + pass + + def test_find_organization_events_all_pages(self): + """Test case for find_organization_events_all_pages + + Retrieve organization's events # noqa: E501 + """ + pass + + def test_find_project_events(self) -> None: + """Test case for find_project_events + + Retrieve project's events + """ + pass + + def test_find_project_events_all_pages(self): + """Test case for find_project_events_all_pages + + Retrieve project's events # noqa: E501 + """ + pass + + def test_find_virtual_circuit_events(self) -> None: + """Test case for find_virtual_circuit_events + + Retrieve virtual circuit events + """ + pass + + def test_find_vrf_route_events(self) -> None: + """Test case for find_vrf_route_events + + Retrieve VRF route events + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_fabric_service_token.py b/equinix/services/metalv1/test/test_fabric_service_token.py new file mode 100644 index 00000000..393a9069 --- /dev/null +++ b/equinix/services/metalv1/test/test_fabric_service_token.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Metal API + + 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.fabric_service_token import FabricServiceToken + +class TestFabricServiceToken(unittest.TestCase): + """FabricServiceToken unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FabricServiceToken: + """Test FabricServiceToken + 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 `FabricServiceToken` + """ + model = FabricServiceToken() + if include_optional: + return FabricServiceToken( + expires_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_allowed_speed = 10000000000, + role = 'primary', + service_token_type = 'a_side', + state = 'inactive' + ) + else: + return FabricServiceToken( + ) + """ + + def testFabricServiceToken(self): + """Test FabricServiceToken""" + # 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_facilities_api.py b/equinix/services/metalv1/test/test_facilities_api.py new file mode 100644 index 00000000..261ba79e --- /dev/null +++ b/equinix/services/metalv1/test/test_facilities_api.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.facilities_api import FacilitiesApi + + +class TestFacilitiesApi(unittest.TestCase): + """FacilitiesApi unit test stubs""" + + def setUp(self) -> None: + self.api = FacilitiesApi() + + def tearDown(self) -> None: + pass + + def test_find_facilities(self) -> None: + """Test case for find_facilities + + Retrieve all facilities + """ + pass + + def test_find_facilities_by_organization(self) -> None: + """Test case for find_facilities_by_organization + + Retrieve all facilities visible by the organization + """ + pass + + def test_find_facilities_by_project(self) -> None: + """Test case for find_facilities_by_project + + Retrieve all facilities visible by the project + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_facility.py b/equinix/services/metalv1/test/test_facility.py new file mode 100644 index 00000000..2a306118 --- /dev/null +++ b/equinix/services/metalv1/test/test_facility.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Metal API + + 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.facility import Facility + +class TestFacility(unittest.TestCase): + """Facility unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Facility: + """Test Facility + 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 `Facility` + """ + model = Facility() + if include_optional: + return Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = None, + name = '' + ) + else: + return Facility( + ) + """ + + def testFacility(self): + """Test Facility""" + # 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_facility_input.py b/equinix/services/metalv1/test/test_facility_input.py new file mode 100644 index 00000000..e39835df --- /dev/null +++ b/equinix/services/metalv1/test/test_facility_input.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.facility_input import FacilityInput + +class TestFacilityInput(unittest.TestCase): + """FacilityInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FacilityInput: + """Test FacilityInput + 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 `FacilityInput` + """ + model = FacilityInput() + if include_optional: + return FacilityInput( + facility = None, + href = '' + ) + else: + return FacilityInput( + facility = None, + ) + """ + + def testFacilityInput(self): + """Test FacilityInput""" + # 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_facility_input_facility.py b/equinix/services/metalv1/test/test_facility_input_facility.py new file mode 100644 index 00000000..54cbb678 --- /dev/null +++ b/equinix/services/metalv1/test/test_facility_input_facility.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Metal API + + 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.facility_input_facility import FacilityInputFacility + +class TestFacilityInputFacility(unittest.TestCase): + """FacilityInputFacility unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FacilityInputFacility: + """Test FacilityInputFacility + 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 `FacilityInputFacility` + """ + model = FacilityInputFacility() + if include_optional: + return FacilityInputFacility( + ) + else: + return FacilityInputFacility( + ) + """ + + def testFacilityInputFacility(self): + """Test FacilityInputFacility""" + # 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_facility_list.py b/equinix/services/metalv1/test/test_facility_list.py new file mode 100644 index 00000000..44ef4168 --- /dev/null +++ b/equinix/services/metalv1/test/test_facility_list.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Metal API + + 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.facility_list import FacilityList + +class TestFacilityList(unittest.TestCase): + """FacilityList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FacilityList: + """Test FacilityList + 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 `FacilityList` + """ + model = FacilityList() + if include_optional: + return FacilityList( + facilities = [ + equinix.services.metalv1.models.facility.Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = null, + name = '', ) + ], + href = '' + ) + else: + return FacilityList( + ) + """ + + def testFacilityList(self): + """Test FacilityList""" + # 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_filesystem.py b/equinix/services/metalv1/test/test_filesystem.py new file mode 100644 index 00000000..465cc8d5 --- /dev/null +++ b/equinix/services/metalv1/test/test_filesystem.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.filesystem import Filesystem + +class TestFilesystem(unittest.TestCase): + """Filesystem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Filesystem: + """Test Filesystem + 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 `Filesystem` + """ + model = Filesystem() + if include_optional: + return Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + device = '', + format = '', + href = '', + options = [ + '' + ], + point = '', ) + ) + else: + return Filesystem( + ) + """ + + def testFilesystem(self): + """Test Filesystem""" + # 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_find_ip_address_by_id200_response.py b/equinix/services/metalv1/test/test_find_ip_address_by_id200_response.py new file mode 100644 index 00000000..70df032d --- /dev/null +++ b/equinix/services/metalv1/test/test_find_ip_address_by_id200_response.py @@ -0,0 +1,441 @@ +# coding: utf-8 + +""" + Metal API + + 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.find_ip_address_by_id200_response import FindIPAddressById200Response + +class TestFindIPAddressById200Response(unittest.TestCase): + """FindIPAddressById200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FindIPAddressById200Response: + """Test FindIPAddressById200Response + 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 `FindIPAddressById200Response` + """ + model = FindIPAddressById200Response() + if include_optional: + return FindIPAddressById200Response( + address = '', + address_family = 56, + assigned_to = equinix.services.metalv1.models.href.Href( + href = '', ), + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = '', + addon = True, + assignments = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + available = '', + bill = True, + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + facility = None, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + requested_by = equinix.services.metalv1.models.href.Href( + href = '', ), + tags = [ + '' + ], + type = 'global_ipv4', + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ) + else: + return FindIPAddressById200Response( + assigned_to = equinix.services.metalv1.models.href.Href( + href = '', ), + type = 'global_ipv4', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), + ) + """ + + def testFindIPAddressById200Response(self): + """Test FindIPAddressById200Response""" + # 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_find_metal_gateway_by_id200_response.py b/equinix/services/metalv1/test/test_find_metal_gateway_by_id200_response.py new file mode 100644 index 00000000..a2e6635c --- /dev/null +++ b/equinix/services/metalv1/test/test_find_metal_gateway_by_id200_response.py @@ -0,0 +1,788 @@ +# coding: utf-8 + +""" + Metal API + + 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.find_metal_gateway_by_id200_response import FindMetalGatewayById200Response + +class TestFindMetalGatewayById200Response(unittest.TestCase): + """FindMetalGatewayById200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FindMetalGatewayById200Response: + """Test FindMetalGatewayById200Response + 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 `FindMetalGatewayById200Response` + """ + model = FindMetalGatewayById200Response() + if include_optional: + return FindMetalGatewayById200Response( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + ip_reservation = equinix.services.metalv1.models.vrf_ip_reservation.VrfIpReservation( + address = '', + address_family = 56, + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + gateway = '', + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + public = True, + state = '', + tags = [ + '' + ], + type = 'vrf', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ) + else: + return FindMetalGatewayById200Response( + ) + """ + + def testFindMetalGatewayById200Response(self): + """Test FindMetalGatewayById200Response""" + # 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_find_traffic_timeframe_parameter.py b/equinix/services/metalv1/test/test_find_traffic_timeframe_parameter.py new file mode 100644 index 00000000..eb4be692 --- /dev/null +++ b/equinix/services/metalv1/test/test_find_traffic_timeframe_parameter.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.find_traffic_timeframe_parameter import FindTrafficTimeframeParameter + +class TestFindTrafficTimeframeParameter(unittest.TestCase): + """FindTrafficTimeframeParameter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FindTrafficTimeframeParameter: + """Test FindTrafficTimeframeParameter + 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 `FindTrafficTimeframeParameter` + """ + model = FindTrafficTimeframeParameter() + if include_optional: + return FindTrafficTimeframeParameter( + ended_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + started_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return FindTrafficTimeframeParameter( + ended_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + started_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testFindTrafficTimeframeParameter(self): + """Test FindTrafficTimeframeParameter""" + # 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_firmware_set.py b/equinix/services/metalv1/test/test_firmware_set.py new file mode 100644 index 00000000..1f2be5b6 --- /dev/null +++ b/equinix/services/metalv1/test/test_firmware_set.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Metal API + + 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.firmware_set import FirmwareSet + +class TestFirmwareSet(unittest.TestCase): + """FirmwareSet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FirmwareSet: + """Test FirmwareSet + 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 `FirmwareSet` + """ + model = FirmwareSet() + if include_optional: + return FirmwareSet( + attributes = [ + equinix.services.metalv1.models.attribute.Attribute( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + data = equinix.services.metalv1.models.attribute_data.AttributeData( + href = '', + latest = True, + model = '', + plan = '', + vendor = '', ), + href = '', + namespace = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + component_firmware = [ + equinix.services.metalv1.models.component.Component( + checksum = '', + component = 'bmc', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + filename = '', + href = '', + model = [ + 'romed8hm3' + ], + repository_url = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + upstream_url = '', + uuid = '0516463a-47ee-4809-9a66-ece8c740eed9', + vendor = 'equinix', + version = '1.5.0', ) + ], + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + uuid = '0516463a-47ee-4809-9a66-ece8c740eed9' + ) + else: + return FirmwareSet( + name = '', + uuid = '0516463a-47ee-4809-9a66-ece8c740eed9', + ) + """ + + def testFirmwareSet(self): + """Test FirmwareSet""" + # 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_firmware_set_list_response.py b/equinix/services/metalv1/test/test_firmware_set_list_response.py new file mode 100644 index 00000000..fd9cef90 --- /dev/null +++ b/equinix/services/metalv1/test/test_firmware_set_list_response.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Metal API + + 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.firmware_set_list_response import FirmwareSetListResponse + +class TestFirmwareSetListResponse(unittest.TestCase): + """FirmwareSetListResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FirmwareSetListResponse: + """Test FirmwareSetListResponse + 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 `FirmwareSetListResponse` + """ + model = FirmwareSetListResponse() + if include_optional: + return FirmwareSetListResponse( + href = '', + page = 56, + page_count = 56, + page_size = 56, + records = [ + equinix.services.metalv1.models.firmware_set.FirmwareSet( + attributes = [ + equinix.services.metalv1.models.attribute.Attribute( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + data = equinix.services.metalv1.models.attribute_data.AttributeData( + href = '', + latest = True, + model = '', + plan = '', + vendor = '', ), + href = '', + namespace = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + component_firmware = [ + equinix.services.metalv1.models.component.Component( + checksum = '', + component = 'bmc', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + filename = '', + href = '', + model = [ + 'romed8hm3' + ], + repository_url = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + upstream_url = '', + uuid = '0516463a-47ee-4809-9a66-ece8c740eed9', + vendor = 'equinix', + version = '1.5.0', ) + ], + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + uuid = '0516463a-47ee-4809-9a66-ece8c740eed9', ) + ], + total_pages = 56, + total_record_count = 56 + ) + else: + return FirmwareSetListResponse( + ) + """ + + def testFirmwareSetListResponse(self): + """Test FirmwareSetListResponse""" + # 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_firmware_set_response.py b/equinix/services/metalv1/test/test_firmware_set_response.py new file mode 100644 index 00000000..5dcc2411 --- /dev/null +++ b/equinix/services/metalv1/test/test_firmware_set_response.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Metal API + + 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.firmware_set_response import FirmwareSetResponse + +class TestFirmwareSetResponse(unittest.TestCase): + """FirmwareSetResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FirmwareSetResponse: + """Test FirmwareSetResponse + 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 `FirmwareSetResponse` + """ + model = FirmwareSetResponse() + if include_optional: + return FirmwareSetResponse( + href = '', + record = equinix.services.metalv1.models.firmware_set.FirmwareSet( + attributes = [ + equinix.services.metalv1.models.attribute.Attribute( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + data = equinix.services.metalv1.models.attribute_data.AttributeData( + href = '', + latest = True, + model = '', + plan = '', + vendor = '', ), + href = '', + namespace = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + component_firmware = [ + equinix.services.metalv1.models.component.Component( + checksum = '', + component = 'bmc', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + filename = '', + href = '', + model = [ + 'romed8hm3' + ], + repository_url = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + upstream_url = '', + uuid = '0516463a-47ee-4809-9a66-ece8c740eed9', + vendor = 'equinix', + version = '1.5.0', ) + ], + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + uuid = '0516463a-47ee-4809-9a66-ece8c740eed9', ) + ) + else: + return FirmwareSetResponse( + ) + """ + + def testFirmwareSetResponse(self): + """Test FirmwareSetResponse""" + # 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_firmware_sets_api.py b/equinix/services/metalv1/test/test_firmware_sets_api.py new file mode 100644 index 00000000..15d506ac --- /dev/null +++ b/equinix/services/metalv1/test/test_firmware_sets_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.firmware_sets_api import FirmwareSetsApi + + +class TestFirmwareSetsApi(unittest.TestCase): + """FirmwareSetsApi unit test stubs""" + + def setUp(self) -> None: + self.api = FirmwareSetsApi() + + def tearDown(self) -> None: + pass + + def test_get_organization_firmware_sets(self) -> None: + """Test case for get_organization_firmware_sets + + Get Organization's Firmware Sets + """ + pass + + def test_get_project_firmware_sets(self) -> None: + """Test case for get_project_firmware_sets + + Get Project's Firmware Sets + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_global_bgp_range.py b/equinix/services/metalv1/test/test_global_bgp_range.py new file mode 100644 index 00000000..d06cfe7d --- /dev/null +++ b/equinix/services/metalv1/test/test_global_bgp_range.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.global_bgp_range import GlobalBgpRange + +class TestGlobalBgpRange(unittest.TestCase): + """GlobalBgpRange unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GlobalBgpRange: + """Test GlobalBgpRange + 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 `GlobalBgpRange` + """ + model = GlobalBgpRange() + if include_optional: + return GlobalBgpRange( + address_family = 56, + href = '', + id = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + range = '' + ) + else: + return GlobalBgpRange( + ) + """ + + def testGlobalBgpRange(self): + """Test GlobalBgpRange""" + # 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_global_bgp_range_list.py b/equinix/services/metalv1/test/test_global_bgp_range_list.py new file mode 100644 index 00000000..bc3d1038 --- /dev/null +++ b/equinix/services/metalv1/test/test_global_bgp_range_list.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Metal API + + 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.global_bgp_range_list import GlobalBgpRangeList + +class TestGlobalBgpRangeList(unittest.TestCase): + """GlobalBgpRangeList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GlobalBgpRangeList: + """Test GlobalBgpRangeList + 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 `GlobalBgpRangeList` + """ + model = GlobalBgpRangeList() + if include_optional: + return GlobalBgpRangeList( + global_bgp_ranges = [ + equinix.services.metalv1.models.global_bgp_range.GlobalBgpRange( + address_family = 56, + href = '', + id = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + range = '', ) + ], + href = '' + ) + else: + return GlobalBgpRangeList( + ) + """ + + def testGlobalBgpRangeList(self): + """Test GlobalBgpRangeList""" + # 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_hardware_reservation.py b/equinix/services/metalv1/test/test_hardware_reservation.py new file mode 100644 index 00000000..2ef77be2 --- /dev/null +++ b/equinix/services/metalv1/test/test_hardware_reservation.py @@ -0,0 +1,567 @@ +# coding: utf-8 + +""" + Metal API + + 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.hardware_reservation import HardwareReservation + +class TestHardwareReservation(unittest.TestCase): + """HardwareReservation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HardwareReservation: + """Test HardwareReservation + 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 `HardwareReservation` + """ + model = HardwareReservation() + if include_optional: + return HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + facility = equinix.services.metalv1.models.facility.Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = null, + name = '', ), + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metro_code = '', + vxlan = 56, ) + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + ssh_keys = [ + + ], + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', + volumes = [ + + ], ), + facility = equinix.services.metalv1.models.facility.Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = null, + name = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return HardwareReservation( + ) + """ + + def testHardwareReservation(self): + """Test HardwareReservation""" + # 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_hardware_reservation_list.py b/equinix/services/metalv1/test/test_hardware_reservation_list.py new file mode 100644 index 00000000..5b9449b5 --- /dev/null +++ b/equinix/services/metalv1/test/test_hardware_reservation_list.py @@ -0,0 +1,476 @@ +# coding: utf-8 + +""" + Metal API + + 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.hardware_reservation_list import HardwareReservationList + +class TestHardwareReservationList(unittest.TestCase): + """HardwareReservationList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HardwareReservationList: + """Test HardwareReservationList + 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 `HardwareReservationList` + """ + model = HardwareReservationList() + if include_optional: + return HardwareReservationList( + hardware_reservations = [ + equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + facility = equinix.services.metalv1.models.facility.Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = null, + name = '', ), + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metro_code = '', + vxlan = 56, ) + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + ssh_keys = [ + + ], + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', + volumes = [ + + ], ), + facility = equinix.services.metalv1.models.facility.Facility( + code = '', + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + name = '', ), + href = '', + id = '', + need_of_service = True, + plan = , + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ) + ) + else: + return HardwareReservationList( + ) + """ + + def testHardwareReservationList(self): + """Test HardwareReservationList""" + # 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_hardware_reservations_api.py b/equinix/services/metalv1/test/test_hardware_reservations_api.py new file mode 100644 index 00000000..927ebc41 --- /dev/null +++ b/equinix/services/metalv1/test/test_hardware_reservations_api.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.hardware_reservations_api import HardwareReservationsApi + + +class TestHardwareReservationsApi(unittest.TestCase): + """HardwareReservationsApi unit test stubs""" + + def setUp(self) -> None: + self.api = HardwareReservationsApi() + + def tearDown(self) -> None: + pass + + def test_activate_hardware_reservation(self) -> None: + """Test case for activate_hardware_reservation + + Activate a spare hardware reservation + """ + pass + + def test_find_hardware_reservation_by_id(self) -> None: + """Test case for find_hardware_reservation_by_id + + Retrieve a hardware reservation + """ + pass + + def test_find_project_hardware_reservations(self) -> None: + """Test case for find_project_hardware_reservations + + Retrieve all hardware reservations for a given project + """ + pass + + def test_find_project_hardware_reservations_all_pages(self): + """Test case for find_project_hardware_reservations_all_pages + + Retrieve all hardware reservations for a given project # noqa: E501 + """ + pass + + def test_move_hardware_reservation(self) -> None: + """Test case for move_hardware_reservation + + Move a hardware reservation + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_href.py b/equinix/services/metalv1/test/test_href.py new file mode 100644 index 00000000..ec97db4b --- /dev/null +++ b/equinix/services/metalv1/test/test_href.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.href import Href + +class TestHref(unittest.TestCase): + """Href unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Href: + """Test Href + 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 `Href` + """ + model = Href() + if include_optional: + return Href( + href = '' + ) + else: + return Href( + href = '', + ) + """ + + def testHref(self): + """Test Href""" + # 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_incidents_api.py b/equinix/services/metalv1/test/test_incidents_api.py new file mode 100644 index 00000000..03df0dce --- /dev/null +++ b/equinix/services/metalv1/test/test_incidents_api.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.incidents_api import IncidentsApi + + +class TestIncidentsApi(unittest.TestCase): + """IncidentsApi unit test stubs""" + + def setUp(self) -> None: + self.api = IncidentsApi() + + def tearDown(self) -> None: + pass + + def test_find_incidents(self) -> None: + """Test case for find_incidents + + Retrieve the number of incidents + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_instances_batch_create_input.py b/equinix/services/metalv1/test/test_instances_batch_create_input.py new file mode 100644 index 00000000..3f061457 --- /dev/null +++ b/equinix/services/metalv1/test/test_instances_batch_create_input.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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 import InstancesBatchCreateInput + +class TestInstancesBatchCreateInput(unittest.TestCase): + """InstancesBatchCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InstancesBatchCreateInput: + """Test InstancesBatchCreateInput + 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 `InstancesBatchCreateInput` + """ + model = InstancesBatchCreateInput() + if include_optional: + return InstancesBatchCreateInput( + batches = [ + null + ], + href = '' + ) + else: + return InstancesBatchCreateInput( + ) + """ + + def testInstancesBatchCreateInput(self): + """Test InstancesBatchCreateInput""" + # 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_instances_batch_create_input_batches_inner.py b/equinix/services/metalv1/test/test_instances_batch_create_input_batches_inner.py new file mode 100644 index 00000000..91ee6be1 --- /dev/null +++ b/equinix/services/metalv1/test/test_instances_batch_create_input_batches_inner.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Metal API + + 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 import InstancesBatchCreateInputBatchesInner + +class TestInstancesBatchCreateInputBatchesInner(unittest.TestCase): + """InstancesBatchCreateInputBatchesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InstancesBatchCreateInputBatchesInner: + """Test InstancesBatchCreateInputBatchesInner + 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 `InstancesBatchCreateInputBatchesInner` + """ + model = InstancesBatchCreateInputBatchesInner() + if include_optional: + return InstancesBatchCreateInputBatchesInner( + hostnames = [ + '' + ], + quantity = 56, + href = '', + metro = 'sv', + always_pxe = True, + billing_cycle = 'hourly', + customdata = { }, + description = '', + features = [ + '' + ], + hardware_reservation_id = 'next-available', + hostname = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_address.IPAddress( + address_family = 4, + cidr = 28, + href = '', + ip_reservations = [ + '' + ], + public = False, ) + ], + ipxe_script_url = '', + locked = True, + network_frozen = True, + no_ssh_keys = True, + operating_system = '', + plan = 'c3.large.x86', + private_ipv4_subnet_size = 56, + project_ssh_keys = [ + '' + ], + public_ipv4_subnet_size = 56, + spot_instance = True, + spot_price_max = 1.23, + ssh_keys = [ + equinix.services.metalv1.models.ssh_key_input.SSHKeyInput( + href = '', + key = '', + label = '', + tags = [ + '' + ], ) + ], + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + device = '', + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + device = '', + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + devices = [ + '' + ], + href = '', + level = '', + name = '', ) + ], ), + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user_ssh_keys = [ + '' + ], + userdata = '', + facility = None + ) + else: + return InstancesBatchCreateInputBatchesInner( + metro = 'sv', + operating_system = '', + plan = 'c3.large.x86', + facility = None, + ) + """ + + def testInstancesBatchCreateInputBatchesInner(self): + """Test InstancesBatchCreateInputBatchesInner""" + # 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 new file mode 100644 index 00000000..2d689a71 --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Metal API + + 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 import Interconnection + +class TestInterconnection(unittest.TestCase): + """Interconnection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Interconnection: + """Test Interconnection + 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 `Interconnection` + """ + model = Interconnection() + if include_optional: + return Interconnection( + authorization_code = '', + contact_email = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + fabric_provider = None, + facility = equinix.services.metalv1.models.facility.Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = null, + name = '', ), + href = '', + id = '', + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + mode = 'standard', + name = '', + organization = equinix.services.metalv1.models.organization.Organization( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + billing_address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + country = '', + href = '', + state = '', + zip_code = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + credit_amount = 1.337, + customdata = equinix.services.metalv1.models.customdata.customdata(), + description = '', + enforce_2fa_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + logo = '', + members = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + memberships = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + name = '', + projects = [ + + ], + terms = 56, + twitter = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + website = '', ), + ports = [ + equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', + virtual_circuits = [ + null + ], ) + ], + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + redundancy = 'primary', + requested_by = equinix.services.metalv1.models.href.Href( + href = '', ), + service_tokens = [ + equinix.services.metalv1.models.fabric_service_token.FabricServiceToken( + expires_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_allowed_speed = 10000000000, + role = 'primary', + service_token_type = 'a_side', + state = 'inactive', ) + ], + speed = 10000000000, + status = '', + tags = [ + '' + ], + token = '', + type = 'shared', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return Interconnection( + ) + """ + + def testInterconnection(self): + """Test Interconnection""" + # 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_fabric_provider.py b/equinix/services/metalv1/test/test_interconnection_fabric_provider.py new file mode 100644 index 00000000..2acc5459 --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_fabric_provider.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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_fabric_provider import InterconnectionFabricProvider + +class TestInterconnectionFabricProvider(unittest.TestCase): + """InterconnectionFabricProvider unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionFabricProvider: + """Test InterconnectionFabricProvider + 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 `InterconnectionFabricProvider` + """ + model = InterconnectionFabricProvider() + if include_optional: + return InterconnectionFabricProvider( + account_id = '123412341234', + href = '', + location = 'us-west-1', + type = 'CSP_AWS' + ) + else: + return InterconnectionFabricProvider( + account_id = '123412341234', + type = 'CSP_AWS', + ) + """ + + def testInterconnectionFabricProvider(self): + """Test InterconnectionFabricProvider""" + # 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_list.py b/equinix/services/metalv1/test/test_interconnection_list.py new file mode 100644 index 00000000..f6dd697c --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_list.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Metal API + + 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_list import InterconnectionList + +class TestInterconnectionList(unittest.TestCase): + """InterconnectionList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionList: + """Test InterconnectionList + 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 `InterconnectionList` + """ + model = InterconnectionList() + if include_optional: + return InterconnectionList( + href = '', + interconnections = [ + equinix.services.metalv1.models.interconnection.Interconnection( + authorization_code = '', + contact_email = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + fabric_provider = null, + facility = equinix.services.metalv1.models.facility.Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = null, + name = '', ), + href = '', + id = '', + metro = null, + mode = 'standard', + name = '', + organization = equinix.services.metalv1.models.organization.Organization( + billing_address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + country = '', + href = '', + state = '', + zip_code = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + credit_amount = 1.337, + customdata = equinix.services.metalv1.models.customdata.customdata(), + description = '', + enforce_2fa_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + logo = '', + members = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + memberships = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + name = '', + projects = [ + + ], + terms = 56, + twitter = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + website = '', ), + ports = [ + equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', + virtual_circuits = [ + null + ], ) + ], + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = , + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + redundancy = 'primary', + requested_by = , + service_tokens = [ + equinix.services.metalv1.models.fabric_service_token.FabricServiceToken( + expires_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_allowed_speed = 10000000000, + role = 'primary', + service_token_type = 'a_side', + state = 'inactive', ) + ], + speed = 10000000000, + status = '', + tags = [ + '' + ], + token = '', + type = 'shared', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ], + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ) + ) + else: + return InterconnectionList( + ) + """ + + def testInterconnectionList(self): + """Test InterconnectionList""" + # 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.py b/equinix/services/metalv1/test/test_interconnection_metro_list.py new file mode 100644 index 00000000..4b9c92ab --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_metro_list.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Metal API + + 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 import InterconnectionMetroList + +class TestInterconnectionMetroList(unittest.TestCase): + """InterconnectionMetroList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionMetroList: + """Test InterconnectionMetroList + 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 `InterconnectionMetroList` + """ + model = InterconnectionMetroList() + if include_optional: + return InterconnectionMetroList( + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ), + metros = [ + null + ] + ) + else: + return InterconnectionMetroList( + ) + """ + + def testInterconnectionMetroList(self): + """Test InterconnectionMetroList""" + # 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.py b/equinix/services/metalv1/test/test_interconnection_metro_list_metros_inner.py new file mode 100644 index 00000000..9714387b --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_metro_list_metros_inner.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Metal API + + 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 import InterconnectionMetroListMetrosInner + +class TestInterconnectionMetroListMetrosInner(unittest.TestCase): + """InterconnectionMetroListMetrosInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionMetroListMetrosInner: + """Test InterconnectionMetroListMetrosInner + 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 `InterconnectionMetroListMetrosInner` + """ + model = InterconnectionMetroListMetrosInner() + if include_optional: + return InterconnectionMetroListMetrosInner( + code = '', + country = '', + href = '', + id = '', + name = '', + 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 InterconnectionMetroListMetrosInner( + ) + """ + + def testInterconnectionMetroListMetrosInner(self): + """Test InterconnectionMetroListMetrosInner""" + # 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_providers_inner.py b/equinix/services/metalv1/test/test_interconnection_metro_list_metros_inner_all_of_providers_inner.py new file mode 100644 index 00000000..6236047a --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_metro_list_metros_inner_all_of_providers_inner.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Metal API + + 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_providers_inner import InterconnectionMetroListMetrosInnerAllOfProvidersInner + +class TestInterconnectionMetroListMetrosInnerAllOfProvidersInner(unittest.TestCase): + """InterconnectionMetroListMetrosInnerAllOfProvidersInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionMetroListMetrosInnerAllOfProvidersInner: + """Test InterconnectionMetroListMetrosInnerAllOfProvidersInner + 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 `InterconnectionMetroListMetrosInnerAllOfProvidersInner` + """ + model = InterconnectionMetroListMetrosInnerAllOfProvidersInner() + if include_optional: + return InterconnectionMetroListMetrosInnerAllOfProvidersInner( + bandwidths = [ + 50 + ], + features = [ + 'high capacity' + ], + href = '', + locations = [ + 'us-east-1' + ], + name = 'AWS Direct Connect', + type = 'CSP_AWS' + ) + else: + return InterconnectionMetroListMetrosInnerAllOfProvidersInner( + ) + """ + + def testInterconnectionMetroListMetrosInnerAllOfProvidersInner(self): + """Test InterconnectionMetroListMetrosInnerAllOfProvidersInner""" + # 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_port.py b/equinix/services/metalv1/test/test_interconnection_port.py new file mode 100644 index 00000000..6e8c3cc4 --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_port.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Metal API + + 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_port import InterconnectionPort + +class TestInterconnectionPort(unittest.TestCase): + """InterconnectionPort unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionPort: + """Test InterconnectionPort + 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 `InterconnectionPort` + """ + model = InterconnectionPort() + if include_optional: + return InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', + virtual_circuits = [ + null + ] + ) + else: + return InterconnectionPort( + ) + """ + + def testInterconnectionPort(self): + """Test InterconnectionPort""" + # 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_port_list.py b/equinix/services/metalv1/test/test_interconnection_port_list.py new file mode 100644 index 00000000..34acf003 --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_port_list.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Metal API + + 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_port_list import InterconnectionPortList + +class TestInterconnectionPortList(unittest.TestCase): + """InterconnectionPortList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionPortList: + """Test InterconnectionPortList + 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 `InterconnectionPortList` + """ + model = InterconnectionPortList() + if include_optional: + return InterconnectionPortList( + href = '', + ports = [ + equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', + virtual_circuits = [ + null + ], ) + ] + ) + else: + return InterconnectionPortList( + ) + """ + + def testInterconnectionPortList(self): + """Test InterconnectionPortList""" + # 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_pricing_list.py b/equinix/services/metalv1/test/test_interconnection_pricing_list.py new file mode 100644 index 00000000..ecb7cd7b --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_pricing_list.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Metal API + + 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_pricing_list import InterconnectionPricingList + +class TestInterconnectionPricingList(unittest.TestCase): + """InterconnectionPricingList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionPricingList: + """Test InterconnectionPricingList + 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 `InterconnectionPricingList` + """ + model = InterconnectionPricingList() + if include_optional: + return InterconnectionPricingList( + href = '', + provider_pricing = [ + equinix.services.metalv1.models.interconnection_pricing_list_provider_pricing_inner.InterconnectionPricingList_provider_pricing_inner( + href = '', + provider = 'CSP_AWS', + tiers = [ + equinix.services.metalv1.models.interconnection_pricing_list_provider_pricing_inner_tiers_inner.InterconnectionPricingList_provider_pricing_inner_tiers_inner( + bandwidth = 500, + billing_cycle = 'monthly', + href = '', + price = 10.04, ) + ], ) + ] + ) + else: + return InterconnectionPricingList( + ) + """ + + def testInterconnectionPricingList(self): + """Test InterconnectionPricingList""" + # 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_pricing_list_provider_pricing_inner.py b/equinix/services/metalv1/test/test_interconnection_pricing_list_provider_pricing_inner.py new file mode 100644 index 00000000..46f1fabe --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_pricing_list_provider_pricing_inner.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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_pricing_list_provider_pricing_inner import InterconnectionPricingListProviderPricingInner + +class TestInterconnectionPricingListProviderPricingInner(unittest.TestCase): + """InterconnectionPricingListProviderPricingInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionPricingListProviderPricingInner: + """Test InterconnectionPricingListProviderPricingInner + 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 `InterconnectionPricingListProviderPricingInner` + """ + model = InterconnectionPricingListProviderPricingInner() + if include_optional: + return InterconnectionPricingListProviderPricingInner( + href = '', + provider = 'CSP_AWS', + tiers = [ + equinix.services.metalv1.models.interconnection_pricing_list_provider_pricing_inner_tiers_inner.InterconnectionPricingList_provider_pricing_inner_tiers_inner( + bandwidth = 500, + billing_cycle = 'monthly', + href = '', + price = 10.04, ) + ] + ) + else: + return InterconnectionPricingListProviderPricingInner( + ) + """ + + def testInterconnectionPricingListProviderPricingInner(self): + """Test InterconnectionPricingListProviderPricingInner""" + # 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_pricing_list_provider_pricing_inner_tiers_inner.py b/equinix/services/metalv1/test/test_interconnection_pricing_list_provider_pricing_inner_tiers_inner.py new file mode 100644 index 00000000..6994cc0f --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_pricing_list_provider_pricing_inner_tiers_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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_pricing_list_provider_pricing_inner_tiers_inner import InterconnectionPricingListProviderPricingInnerTiersInner + +class TestInterconnectionPricingListProviderPricingInnerTiersInner(unittest.TestCase): + """InterconnectionPricingListProviderPricingInnerTiersInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionPricingListProviderPricingInnerTiersInner: + """Test InterconnectionPricingListProviderPricingInnerTiersInner + 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 `InterconnectionPricingListProviderPricingInnerTiersInner` + """ + model = InterconnectionPricingListProviderPricingInnerTiersInner() + if include_optional: + return InterconnectionPricingListProviderPricingInnerTiersInner( + bandwidth = 500, + billing_cycle = 'monthly', + href = '', + price = 10.04 + ) + else: + return InterconnectionPricingListProviderPricingInnerTiersInner( + ) + """ + + def testInterconnectionPricingListProviderPricingInnerTiersInner(self): + """Test InterconnectionPricingListProviderPricingInnerTiersInner""" + # 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_update_input.py b/equinix/services/metalv1/test/test_interconnection_update_input.py new file mode 100644 index 00000000..a2bce89f --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnection_update_input.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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_update_input import InterconnectionUpdateInput + +class TestInterconnectionUpdateInput(unittest.TestCase): + """InterconnectionUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InterconnectionUpdateInput: + """Test InterconnectionUpdateInput + 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 `InterconnectionUpdateInput` + """ + model = InterconnectionUpdateInput() + if include_optional: + return InterconnectionUpdateInput( + contact_email = '', + description = '', + href = '', + mode = 'standard', + name = '', + tags = [ + '' + ] + ) + else: + return InterconnectionUpdateInput( + ) + """ + + def testInterconnectionUpdateInput(self): + """Test InterconnectionUpdateInput""" + # 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_interconnections_api.py b/equinix/services/metalv1/test/test_interconnections_api.py new file mode 100644 index 00000000..837dc545 --- /dev/null +++ b/equinix/services/metalv1/test/test_interconnections_api.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.interconnections_api import InterconnectionsApi + + +class TestInterconnectionsApi(unittest.TestCase): + """InterconnectionsApi unit test stubs""" + + def setUp(self) -> None: + self.api = InterconnectionsApi() + + def tearDown(self) -> None: + pass + + def test_create_interconnection_port_virtual_circuit(self) -> None: + """Test case for create_interconnection_port_virtual_circuit + + Create a new Virtual Circuit + """ + pass + + def test_create_organization_interconnection(self) -> None: + """Test case for create_organization_interconnection + + Request a new interconnection for the organization + """ + pass + + def test_create_project_interconnection(self) -> None: + """Test case for create_project_interconnection + + Request a new interconnection for the project's organization + """ + pass + + def test_delete_interconnection(self) -> None: + """Test case for delete_interconnection + + Delete interconnection + """ + pass + + def test_delete_virtual_circuit(self) -> None: + """Test case for delete_virtual_circuit + + Delete a virtual circuit + """ + pass + + def test_get_interconnection(self) -> None: + """Test case for get_interconnection + + Get interconnection + """ + pass + + def test_get_interconnection_metros(self) -> None: + """Test case for get_interconnection_metros + + Get connectivity to network provider by metro + """ + pass + + def test_get_interconnection_port(self) -> None: + """Test case for get_interconnection_port + + Get a interconnection port + """ + pass + + def test_get_interconnection_pricing(self) -> None: + """Test case for get_interconnection_pricing + + Get Interconnection Pricing + """ + pass + + def test_get_virtual_circuit(self) -> None: + """Test case for get_virtual_circuit + + Get a virtual circuit + """ + pass + + def test_list_interconnection_port_virtual_circuits(self) -> None: + """Test case for list_interconnection_port_virtual_circuits + + List a interconnection port's virtual circuits + """ + pass + + def test_list_interconnection_ports(self) -> None: + """Test case for list_interconnection_ports + + List a interconnection's ports + """ + pass + + def test_list_interconnection_virtual_circuits(self) -> None: + """Test case for list_interconnection_virtual_circuits + + List a interconnection's virtual circuits + """ + pass + + def test_organization_list_interconnections(self) -> None: + """Test case for organization_list_interconnections + + List organization connections + """ + pass + + def test_project_list_interconnections(self) -> None: + """Test case for project_list_interconnections + + List project connections + """ + pass + + def test_project_list_interconnections_all_pages(self): + """Test case for project_list_interconnections_all_pages + + List project connections # noqa: E501 + """ + pass + + def test_update_interconnection(self) -> None: + """Test case for update_interconnection + + Update interconnection + """ + pass + + def test_update_virtual_circuit(self) -> None: + """Test case for update_virtual_circuit + + Update a virtual circuit + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_invitation.py b/equinix/services/metalv1/test/test_invitation.py new file mode 100644 index 00000000..819a2735 --- /dev/null +++ b/equinix/services/metalv1/test/test_invitation.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Metal API + + 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.invitation import Invitation + +class TestInvitation(unittest.TestCase): + """Invitation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Invitation: + """Test Invitation + 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 `Invitation` + """ + model = Invitation() + if include_optional: + return Invitation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + invitation = equinix.services.metalv1.models.href.Href( + href = '', ), + invited_by = equinix.services.metalv1.models.href.Href( + href = '', ), + invitee = '', + nonce = '', + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + projects = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + roles = [ + 'admin' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return Invitation( + ) + """ + + def testInvitation(self): + """Test Invitation""" + # 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_invitation_input.py b/equinix/services/metalv1/test/test_invitation_input.py new file mode 100644 index 00000000..3990c9f0 --- /dev/null +++ b/equinix/services/metalv1/test/test_invitation_input.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Metal API + + 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.invitation_input import InvitationInput + +class TestInvitationInput(unittest.TestCase): + """InvitationInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InvitationInput: + """Test InvitationInput + 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 `InvitationInput` + """ + model = InvitationInput() + if include_optional: + return InvitationInput( + href = '', + invitee = '', + message = '', + organization_id = '', + projects_ids = [ + '' + ], + roles = [ + 'admin' + ] + ) + else: + return InvitationInput( + invitee = '', + ) + """ + + def testInvitationInput(self): + """Test InvitationInput""" + # 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_invitation_list.py b/equinix/services/metalv1/test/test_invitation_list.py new file mode 100644 index 00000000..7ec2ada9 --- /dev/null +++ b/equinix/services/metalv1/test/test_invitation_list.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Metal API + + 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.invitation_list import InvitationList + +class TestInvitationList(unittest.TestCase): + """InvitationList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InvitationList: + """Test InvitationList + 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 `InvitationList` + """ + model = InvitationList() + if include_optional: + return InvitationList( + href = '', + invitations = [ + equinix.services.metalv1.models.membership.Membership( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + roles = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = equinix.services.metalv1.models.href.Href( + href = '', ), ) + ] + ) + else: + return InvitationList( + ) + """ + + def testInvitationList(self): + """Test InvitationList""" + # 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_invitations_api.py b/equinix/services/metalv1/test/test_invitations_api.py new file mode 100644 index 00000000..568b47d0 --- /dev/null +++ b/equinix/services/metalv1/test/test_invitations_api.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.invitations_api import InvitationsApi + + +class TestInvitationsApi(unittest.TestCase): + """InvitationsApi unit test stubs""" + + def setUp(self) -> None: + self.api = InvitationsApi() + + def tearDown(self) -> None: + pass + + def test_accept_invitation(self) -> None: + """Test case for accept_invitation + + Accept an invitation + """ + pass + + def test_decline_invitation(self) -> None: + """Test case for decline_invitation + + Decline an invitation + """ + pass + + def test_find_invitation_by_id(self) -> None: + """Test case for find_invitation_by_id + + View an invitation + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_invoice.py b/equinix/services/metalv1/test/test_invoice.py new file mode 100644 index 00000000..efe51d40 --- /dev/null +++ b/equinix/services/metalv1/test/test_invoice.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Metal API + + 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.invoice import Invoice + +class TestInvoice(unittest.TestCase): + """Invoice unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Invoice: + """Test Invoice + 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 `Invoice` + """ + model = Invoice() + if include_optional: + return Invoice( + amount = 1.337, + balance = 1.337, + created_on = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + credit_amount = 1.337, + credits_applied = 1.337, + currency = 'USD', + due_on = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + items = [ + equinix.services.metalv1.models.line_item.LineItem( + adjustments = [ + equinix.services.metalv1.models.line_item_adjustment.LineItemAdjustment( + amount = 1.337, + description = '', + href = '', ) + ], + amount = 1.337, + currency = '', + description = '', + details = '', + end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + hostname = '', + href = '', + item_type = '', + location = '', + plan = equinix.services.metalv1.models.plan_id_name.PlanIdName( + href = '', + id = '', + name = '', ), + plan_id = '', + project = equinix.services.metalv1.models.project_id_name.ProjectIdName( + href = '', + id = '', + name = '', ), + project_id = '', + service_id = '', + start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + unit = '', + unit_price = 1.337, ) + ], + number = '', + project = equinix.services.metalv1.models.project_id_name.ProjectIdName( + href = '', + id = '', + name = '', ), + reference_number = '', + status = '', + target_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date() + ) + else: + return Invoice( + ) + """ + + def testInvoice(self): + """Test Invoice""" + # 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_invoice_list.py b/equinix/services/metalv1/test/test_invoice_list.py new file mode 100644 index 00000000..318cabc7 --- /dev/null +++ b/equinix/services/metalv1/test/test_invoice_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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.invoice_list import InvoiceList + +class TestInvoiceList(unittest.TestCase): + """InvoiceList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InvoiceList: + """Test InvoiceList + 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 `InvoiceList` + """ + model = InvoiceList() + if include_optional: + return InvoiceList( + href = '', + invoices = [ + equinix.services.metalv1.models.invoice.Invoice( + amount = 1.337, + balance = 1.337, + created_on = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + credit_amount = 1.337, + credits_applied = 1.337, + currency = 'USD', + due_on = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + items = [ + equinix.services.metalv1.models.line_item.LineItem( + adjustments = [ + equinix.services.metalv1.models.line_item_adjustment.LineItemAdjustment( + amount = 1.337, + description = '', + href = '', ) + ], + amount = 1.337, + currency = '', + description = '', + details = '', + end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + hostname = '', + href = '', + item_type = '', + location = '', + plan = equinix.services.metalv1.models.plan_id_name.PlanIdName( + href = '', + id = '', + name = '', ), + plan_id = '', + project = equinix.services.metalv1.models.project_id_name.ProjectIdName( + href = '', + id = '', + name = '', ), + project_id = '', + service_id = '', + start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + unit = '', + unit_price = 1.337, ) + ], + number = '', + project = equinix.services.metalv1.models.project_id_name.ProjectIdName( + href = '', + id = '', + name = '', ), + reference_number = '', + status = '', + target_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), ) + ] + ) + else: + return InvoiceList( + ) + """ + + def testInvoiceList(self): + """Test InvoiceList""" + # 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_invoices_api.py b/equinix/services/metalv1/test/test_invoices_api.py new file mode 100644 index 00000000..70a22ad7 --- /dev/null +++ b/equinix/services/metalv1/test/test_invoices_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.invoices_api import InvoicesApi + + +class TestInvoicesApi(unittest.TestCase): + """InvoicesApi unit test stubs""" + + def setUp(self) -> None: + self.api = InvoicesApi() + + def tearDown(self) -> None: + pass + + def test_find_organization_invoices(self) -> None: + """Test case for find_organization_invoices + + Retrieve all invoices for an organization + """ + pass + + def test_get_invoice_by_id(self) -> None: + """Test case for get_invoice_by_id + + Retrieve an invoice + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_ip_address.py b/equinix/services/metalv1/test/test_ip_address.py new file mode 100644 index 00000000..7ff0b6dc --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_address.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_address import IPAddress + +class TestIPAddress(unittest.TestCase): + """IPAddress unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPAddress: + """Test IPAddress + 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 `IPAddress` + """ + model = IPAddress() + if include_optional: + return IPAddress( + address_family = 4, + cidr = 28, + href = '', + ip_reservations = [ + '' + ], + public = False + ) + else: + return IPAddress( + ) + """ + + def testIPAddress(self): + """Test IPAddress""" + # 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_ip_addresses_api.py b/equinix/services/metalv1/test/test_ip_addresses_api.py new file mode 100644 index 00000000..a4cb0562 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_addresses_api.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.ip_addresses_api import IPAddressesApi + + +class TestIPAddressesApi(unittest.TestCase): + """IPAddressesApi unit test stubs""" + + def setUp(self) -> None: + self.api = IPAddressesApi() + + def tearDown(self) -> None: + pass + + def test_delete_ip_address(self) -> None: + """Test case for delete_ip_address + + Unassign an ip address + """ + pass + + def test_find_ip_address_by_id(self) -> None: + """Test case for find_ip_address_by_id + + Retrieve an ip address + """ + pass + + def test_find_ip_address_customdata(self) -> None: + """Test case for find_ip_address_customdata + + Retrieve the custom metadata of an IP Reservation or IP Assignment + """ + pass + + def test_find_ip_availabilities(self) -> None: + """Test case for find_ip_availabilities + + Retrieve all available subnets of a particular reservation + """ + pass + + def test_find_ip_reservations(self) -> None: + """Test case for find_ip_reservations + + Retrieve all ip reservations + """ + pass + + def test_request_ip_reservation(self) -> None: + """Test case for request_ip_reservation + + Requesting IP reservations + """ + pass + + def test_update_ip_address(self) -> None: + """Test case for update_ip_address + + Update an ip address + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_ip_assignment.py b/equinix/services/metalv1/test/test_ip_assignment.py new file mode 100644 index 00000000..66af9c67 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_assignment.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_assignment import IPAssignment + +class TestIPAssignment(unittest.TestCase): + """IPAssignment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPAssignment: + """Test IPAssignment + 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 `IPAssignment` + """ + model = IPAssignment() + if include_optional: + return IPAssignment( + address = '', + address_family = 56, + assigned_to = equinix.services.metalv1.models.href.Href( + href = '', ), + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = None, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending' + ) + else: + return IPAssignment( + assigned_to = equinix.services.metalv1.models.href.Href( + href = '', ), + ) + """ + + def testIPAssignment(self): + """Test IPAssignment""" + # 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_ip_assignment_input.py b/equinix/services/metalv1/test/test_ip_assignment_input.py new file mode 100644 index 00000000..46e4cd76 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_assignment_input.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_assignment_input import IPAssignmentInput + +class TestIPAssignmentInput(unittest.TestCase): + """IPAssignmentInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPAssignmentInput: + """Test IPAssignmentInput + 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 `IPAssignmentInput` + """ + model = IPAssignmentInput() + if include_optional: + return IPAssignmentInput( + address = '', + customdata = None, + href = '' + ) + else: + return IPAssignmentInput( + address = '', + ) + """ + + def testIPAssignmentInput(self): + """Test IPAssignmentInput""" + # 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_ip_assignment_list.py b/equinix/services/metalv1/test/test_ip_assignment_list.py new file mode 100644 index 00000000..a34bc7d4 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_assignment_list.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_assignment_list import IPAssignmentList + +class TestIPAssignmentList(unittest.TestCase): + """IPAssignmentList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPAssignmentList: + """Test IPAssignmentList + 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 `IPAssignmentList` + """ + model = IPAssignmentList() + if include_optional: + return IPAssignmentList( + href = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = equinix.services.metalv1.models.href.Href( + href = '', ), + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ] + ) + else: + return IPAssignmentList( + ) + """ + + def testIPAssignmentList(self): + """Test IPAssignmentList""" + # 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_ip_assignment_metro.py b/equinix/services/metalv1/test/test_ip_assignment_metro.py new file mode 100644 index 00000000..a5348f08 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_assignment_metro.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_assignment_metro import IPAssignmentMetro + +class TestIPAssignmentMetro(unittest.TestCase): + """IPAssignmentMetro unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPAssignmentMetro: + """Test IPAssignmentMetro + 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 `IPAssignmentMetro` + """ + model = IPAssignmentMetro() + if include_optional: + return IPAssignmentMetro( + code = '', + country = '', + href = '', + id = '', + name = '' + ) + else: + return IPAssignmentMetro( + ) + """ + + def testIPAssignmentMetro(self): + """Test IPAssignmentMetro""" + # 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_ip_assignment_update_input.py b/equinix/services/metalv1/test/test_ip_assignment_update_input.py new file mode 100644 index 00000000..cfc22416 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_assignment_update_input.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_assignment_update_input import IPAssignmentUpdateInput + +class TestIPAssignmentUpdateInput(unittest.TestCase): + """IPAssignmentUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPAssignmentUpdateInput: + """Test IPAssignmentUpdateInput + 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 `IPAssignmentUpdateInput` + """ + model = IPAssignmentUpdateInput() + if include_optional: + return IPAssignmentUpdateInput( + customdata = None, + details = '', + href = '', + tags = [ + '' + ] + ) + else: + return IPAssignmentUpdateInput( + ) + """ + + def testIPAssignmentUpdateInput(self): + """Test IPAssignmentUpdateInput""" + # 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_ip_availabilities_list.py b/equinix/services/metalv1/test/test_ip_availabilities_list.py new file mode 100644 index 00000000..53815f36 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_availabilities_list.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_availabilities_list import IPAvailabilitiesList + +class TestIPAvailabilitiesList(unittest.TestCase): + """IPAvailabilitiesList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPAvailabilitiesList: + """Test IPAvailabilitiesList + 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 `IPAvailabilitiesList` + """ + model = IPAvailabilitiesList() + if include_optional: + return IPAvailabilitiesList( + available = [ + '' + ], + href = '' + ) + else: + return IPAvailabilitiesList( + ) + """ + + def testIPAvailabilitiesList(self): + """Test IPAvailabilitiesList""" + # 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_ip_reservation.py b/equinix/services/metalv1/test/test_ip_reservation.py new file mode 100644 index 00000000..03748b96 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_reservation.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_reservation import IPReservation + +class TestIPReservation(unittest.TestCase): + """IPReservation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPReservation: + """Test IPReservation + 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 `IPReservation` + """ + model = IPReservation() + if include_optional: + return IPReservation( + addon = True, + address = '', + address_family = 56, + assignments = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + available = '', + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = None, + details = '', + enabled = True, + facility = None, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = None, + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.href.Href( + href = '', ), + public = True, + requested_by = equinix.services.metalv1.models.href.Href( + href = '', ), + state = '', + tags = [ + '' + ], + type = 'global_ipv4' + ) + else: + return IPReservation( + type = 'global_ipv4', + ) + """ + + def testIPReservation(self): + """Test IPReservation""" + # 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_ip_reservation_facility.py b/equinix/services/metalv1/test/test_ip_reservation_facility.py new file mode 100644 index 00000000..092f6a62 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_reservation_facility.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_reservation_facility import IPReservationFacility + +class TestIPReservationFacility(unittest.TestCase): + """IPReservationFacility unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPReservationFacility: + """Test IPReservationFacility + 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 `IPReservationFacility` + """ + model = IPReservationFacility() + if include_optional: + return IPReservationFacility( + address = equinix.services.metalv1.models.address.Address( + address = '', + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = [baremetal, backend_transfer, global_ipv4], + href = '', + id = '', + ip_ranges = [2604:1380::/36, 147.75.192.0/21], + metro = None, + name = '' + ) + else: + return IPReservationFacility( + ) + """ + + def testIPReservationFacility(self): + """Test IPReservationFacility""" + # 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_ip_reservation_list.py b/equinix/services/metalv1/test/test_ip_reservation_list.py new file mode 100644 index 00000000..d1b5fe82 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_reservation_list.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_reservation_list import IPReservationList + +class TestIPReservationList(unittest.TestCase): + """IPReservationList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPReservationList: + """Test IPReservationList + 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 `IPReservationList` + """ + model = IPReservationList() + if include_optional: + return IPReservationList( + href = '', + ip_addresses = [ + null + ], + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ) + ) + else: + return IPReservationList( + ) + """ + + def testIPReservationList(self): + """Test IPReservationList""" + # 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_ip_reservation_list_ip_addresses_inner.py b/equinix/services/metalv1/test/test_ip_reservation_list_ip_addresses_inner.py new file mode 100644 index 00000000..5ffc3588 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_reservation_list_ip_addresses_inner.py @@ -0,0 +1,431 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_reservation_list_ip_addresses_inner import IPReservationListIpAddressesInner + +class TestIPReservationListIpAddressesInner(unittest.TestCase): + """IPReservationListIpAddressesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPReservationListIpAddressesInner: + """Test IPReservationListIpAddressesInner + 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 `IPReservationListIpAddressesInner` + """ + model = IPReservationListIpAddressesInner() + if include_optional: + return IPReservationListIpAddressesInner( + addon = True, + address = '', + address_family = 56, + assignments = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + available = '', + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + enabled = True, + facility = None, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + public = True, + requested_by = equinix.services.metalv1.models.href.Href( + href = '', ), + state = '', + tags = [ + '' + ], + type = 'global_ipv4', + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ) + else: + return IPReservationListIpAddressesInner( + type = 'global_ipv4', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), + ) + """ + + def testIPReservationListIpAddressesInner(self): + """Test IPReservationListIpAddressesInner""" + # 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_ip_reservation_metro.py b/equinix/services/metalv1/test/test_ip_reservation_metro.py new file mode 100644 index 00000000..9340c899 --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_reservation_metro.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_reservation_metro import IPReservationMetro + +class TestIPReservationMetro(unittest.TestCase): + """IPReservationMetro unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPReservationMetro: + """Test IPReservationMetro + 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 `IPReservationMetro` + """ + model = IPReservationMetro() + if include_optional: + return IPReservationMetro( + code = '', + country = '', + href = '', + id = '', + name = '' + ) + else: + return IPReservationMetro( + ) + """ + + def testIPReservationMetro(self): + """Test IPReservationMetro""" + # 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_ip_reservation_request_input.py b/equinix/services/metalv1/test/test_ip_reservation_request_input.py new file mode 100644 index 00000000..13b5898d --- /dev/null +++ b/equinix/services/metalv1/test/test_ip_reservation_request_input.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Metal API + + 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.ip_reservation_request_input import IPReservationRequestInput + +class TestIPReservationRequestInput(unittest.TestCase): + """IPReservationRequestInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IPReservationRequestInput: + """Test IPReservationRequestInput + 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 `IPReservationRequestInput` + """ + model = IPReservationRequestInput() + if include_optional: + return IPReservationRequestInput( + comments = '', + customdata = None, + details = '', + facility = '', + fail_on_approval_required = True, + href = '', + metro = 'SV', + quantity = 56, + tags = [ + '' + ], + type = '' + ) + else: + return IPReservationRequestInput( + quantity = 56, + type = '', + ) + """ + + def testIPReservationRequestInput(self): + """Test IPReservationRequestInput""" + # 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_license.py b/equinix/services/metalv1/test/test_license.py new file mode 100644 index 00000000..a8174ef8 --- /dev/null +++ b/equinix/services/metalv1/test/test_license.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.license import License + +class TestLicense(unittest.TestCase): + """License unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> License: + """Test License + 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 `License` + """ + model = License() + if include_optional: + return License( + description = '', + href = '', + id = '', + license_key = '', + licensee_product = equinix.services.metalv1.models.href.Href( + href = '', ), + project = equinix.services.metalv1.models.href.Href( + href = '', ), + size = 1.337 + ) + else: + return License( + ) + """ + + def testLicense(self): + """Test License""" + # 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_license_create_input.py b/equinix/services/metalv1/test/test_license_create_input.py new file mode 100644 index 00000000..d82399b5 --- /dev/null +++ b/equinix/services/metalv1/test/test_license_create_input.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.license_create_input import LicenseCreateInput + +class TestLicenseCreateInput(unittest.TestCase): + """LicenseCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LicenseCreateInput: + """Test LicenseCreateInput + 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 `LicenseCreateInput` + """ + model = LicenseCreateInput() + if include_optional: + return LicenseCreateInput( + description = '', + href = '', + licensee_product_id = '', + size = 1.337 + ) + else: + return LicenseCreateInput( + ) + """ + + def testLicenseCreateInput(self): + """Test LicenseCreateInput""" + # 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_license_list.py b/equinix/services/metalv1/test/test_license_list.py new file mode 100644 index 00000000..b48791cd --- /dev/null +++ b/equinix/services/metalv1/test/test_license_list.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Metal API + + 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.license_list import LicenseList + +class TestLicenseList(unittest.TestCase): + """LicenseList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LicenseList: + """Test LicenseList + 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 `LicenseList` + """ + model = LicenseList() + if include_optional: + return LicenseList( + href = '', + licenses = [ + equinix.services.metalv1.models.license.License( + description = '', + href = '', + id = '', + license_key = '', + licensee_product = equinix.services.metalv1.models.href.Href( + href = '', ), + project = equinix.services.metalv1.models.href.Href( + href = '', ), + size = 1.337, ) + ] + ) + else: + return LicenseList( + ) + """ + + def testLicenseList(self): + """Test LicenseList""" + # 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_license_update_input.py b/equinix/services/metalv1/test/test_license_update_input.py new file mode 100644 index 00000000..519a4422 --- /dev/null +++ b/equinix/services/metalv1/test/test_license_update_input.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.license_update_input import LicenseUpdateInput + +class TestLicenseUpdateInput(unittest.TestCase): + """LicenseUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LicenseUpdateInput: + """Test LicenseUpdateInput + 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 `LicenseUpdateInput` + """ + model = LicenseUpdateInput() + if include_optional: + return LicenseUpdateInput( + description = '', + href = '', + size = 1.337 + ) + else: + return LicenseUpdateInput( + ) + """ + + def testLicenseUpdateInput(self): + """Test LicenseUpdateInput""" + # 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_licenses_api.py b/equinix/services/metalv1/test/test_licenses_api.py new file mode 100644 index 00000000..5681c9c2 --- /dev/null +++ b/equinix/services/metalv1/test/test_licenses_api.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.licenses_api import LicensesApi + + +class TestLicensesApi(unittest.TestCase): + """LicensesApi unit test stubs""" + + def setUp(self) -> None: + self.api = LicensesApi() + + def tearDown(self) -> None: + pass + + def test_create_license(self) -> None: + """Test case for create_license + + Create a License + """ + pass + + def test_delete_license(self) -> None: + """Test case for delete_license + + Delete the license + """ + pass + + def test_find_license_by_id(self) -> None: + """Test case for find_license_by_id + + Retrieve a license + """ + pass + + def test_find_project_licenses(self) -> None: + """Test case for find_project_licenses + + Retrieve all licenses + """ + pass + + def test_update_license(self) -> None: + """Test case for update_license + + Update the license + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_line_item.py b/equinix/services/metalv1/test/test_line_item.py new file mode 100644 index 00000000..03e84f18 --- /dev/null +++ b/equinix/services/metalv1/test/test_line_item.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Metal API + + 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.line_item import LineItem + +class TestLineItem(unittest.TestCase): + """LineItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LineItem: + """Test LineItem + 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 `LineItem` + """ + model = LineItem() + if include_optional: + return LineItem( + adjustments = [ + equinix.services.metalv1.models.line_item_adjustment.LineItemAdjustment( + amount = 1.337, + description = '', + href = '', ) + ], + amount = 1.337, + currency = '', + description = '', + details = '', + end_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + hostname = '', + href = '', + item_type = '', + location = '', + plan = equinix.services.metalv1.models.plan_id_name.PlanIdName( + href = '', + id = '', + name = '', ), + plan_id = '', + project = equinix.services.metalv1.models.project_id_name.ProjectIdName( + href = '', + id = '', + name = '', ), + project_id = '', + service_id = '', + start_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + unit = '', + unit_price = 1.337 + ) + else: + return LineItem( + ) + """ + + def testLineItem(self): + """Test LineItem""" + # 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_line_item_adjustment.py b/equinix/services/metalv1/test/test_line_item_adjustment.py new file mode 100644 index 00000000..29c09855 --- /dev/null +++ b/equinix/services/metalv1/test/test_line_item_adjustment.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.line_item_adjustment import LineItemAdjustment + +class TestLineItemAdjustment(unittest.TestCase): + """LineItemAdjustment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LineItemAdjustment: + """Test LineItemAdjustment + 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 `LineItemAdjustment` + """ + model = LineItemAdjustment() + if include_optional: + return LineItemAdjustment( + amount = 1.337, + description = '', + href = '' + ) + else: + return LineItemAdjustment( + ) + """ + + def testLineItemAdjustment(self): + """Test LineItemAdjustment""" + # 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_membership.py b/equinix/services/metalv1/test/test_membership.py new file mode 100644 index 00000000..59b99333 --- /dev/null +++ b/equinix/services/metalv1/test/test_membership.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Metal API + + 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.membership import Membership + +class TestMembership(unittest.TestCase): + """Membership unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Membership: + """Test Membership + 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 `Membership` + """ + model = Membership() + if include_optional: + return Membership( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + roles = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = equinix.services.metalv1.models.href.Href( + href = '', ) + ) + else: + return Membership( + ) + """ + + def testMembership(self): + """Test Membership""" + # 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_membership_input.py b/equinix/services/metalv1/test/test_membership_input.py new file mode 100644 index 00000000..fbd076ab --- /dev/null +++ b/equinix/services/metalv1/test/test_membership_input.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.membership_input import MembershipInput + +class TestMembershipInput(unittest.TestCase): + """MembershipInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MembershipInput: + """Test MembershipInput + 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 `MembershipInput` + """ + model = MembershipInput() + if include_optional: + return MembershipInput( + href = '', + role = [ + '' + ] + ) + else: + return MembershipInput( + ) + """ + + def testMembershipInput(self): + """Test MembershipInput""" + # 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_membership_list.py b/equinix/services/metalv1/test/test_membership_list.py new file mode 100644 index 00000000..f1a18986 --- /dev/null +++ b/equinix/services/metalv1/test/test_membership_list.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Metal API + + 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.membership_list import MembershipList + +class TestMembershipList(unittest.TestCase): + """MembershipList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MembershipList: + """Test MembershipList + 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 `MembershipList` + """ + model = MembershipList() + if include_optional: + return MembershipList( + href = '', + memberships = [ + equinix.services.metalv1.models.membership.Membership( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + roles = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = equinix.services.metalv1.models.href.Href( + href = '', ), ) + ] + ) + else: + return MembershipList( + ) + """ + + def testMembershipList(self): + """Test MembershipList""" + # 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_memberships_api.py b/equinix/services/metalv1/test/test_memberships_api.py new file mode 100644 index 00000000..02d82589 --- /dev/null +++ b/equinix/services/metalv1/test/test_memberships_api.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.memberships_api import MembershipsApi + + +class TestMembershipsApi(unittest.TestCase): + """MembershipsApi unit test stubs""" + + def setUp(self) -> None: + self.api = MembershipsApi() + + def tearDown(self) -> None: + pass + + def test_delete_membership(self) -> None: + """Test case for delete_membership + + Delete the membership + """ + pass + + def test_find_membership_by_id(self) -> None: + """Test case for find_membership_by_id + + Retrieve a membership + """ + pass + + def test_update_membership(self) -> None: + """Test case for update_membership + + Update the membership + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_meta.py b/equinix/services/metalv1/test/test_meta.py new file mode 100644 index 00000000..98a3415a --- /dev/null +++ b/equinix/services/metalv1/test/test_meta.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Metal API + + 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.meta import Meta + +class TestMeta(unittest.TestCase): + """Meta unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Meta: + """Test Meta + 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 `Meta` + """ + model = Meta() + if include_optional: + return Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = equinix.services.metalv1.models.href.Href( + href = '', ), + previous = equinix.services.metalv1.models.href.Href( + href = '', ), + var_self = equinix.services.metalv1.models.href.Href( + href = '', ), + total = 56 + ) + else: + return Meta( + ) + """ + + def testMeta(self): + """Test Meta""" + # 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_metadata.py b/equinix/services/metalv1/test/test_metadata.py new file mode 100644 index 00000000..9d53941b --- /dev/null +++ b/equinix/services/metalv1/test/test_metadata.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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.metadata import Metadata + +class TestMetadata(unittest.TestCase): + """Metadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Metadata: + """Test Metadata + 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 `Metadata` + """ + model = Metadata() + if include_optional: + return Metadata( + var_class = '', + customdata = { }, + facility = '', + hostname = '', + href = '', + id = '', + iqn = '', + metro = '', + network = equinix.services.metalv1.models.metadata_network.Metadata_network( + addresses = [ + '' + ], + href = '', + interfaces = [ + None + ], + network = equinix.services.metalv1.models.metadata_network_network.Metadata_network_network( + bonding = equinix.services.metalv1.models.metadata_network_network_bonding.Metadata_network_network_bonding( + href = '', + link_aggregation = '', + mac = '', + mode = 56, ), + href = '', ), ), + operating_system = None, + plan = '', + private_subnets = [ + '' + ], + reserved = True, + specs = None, + ssh_keys = [ + '' + ], + state = 'queued', + switch_short_id = '', + tags = [ + '' + ], + volumes = [ + '' + ] + ) + else: + return Metadata( + ) + """ + + def testMetadata(self): + """Test Metadata""" + # 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_metadata_network.py b/equinix/services/metalv1/test/test_metadata_network.py new file mode 100644 index 00000000..2432373b --- /dev/null +++ b/equinix/services/metalv1/test/test_metadata_network.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Metal API + + 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.metadata_network import MetadataNetwork + +class TestMetadataNetwork(unittest.TestCase): + """MetadataNetwork unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataNetwork: + """Test MetadataNetwork + 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 `MetadataNetwork` + """ + model = MetadataNetwork() + if include_optional: + return MetadataNetwork( + addresses = [ + '' + ], + href = '', + interfaces = [ + None + ], + network = equinix.services.metalv1.models.metadata_network_network.Metadata_network_network( + bonding = equinix.services.metalv1.models.metadata_network_network_bonding.Metadata_network_network_bonding( + href = '', + link_aggregation = '', + mac = '', + mode = 56, ), + href = '', ) + ) + else: + return MetadataNetwork( + ) + """ + + def testMetadataNetwork(self): + """Test MetadataNetwork""" + # 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_metadata_network_network.py b/equinix/services/metalv1/test/test_metadata_network_network.py new file mode 100644 index 00000000..63c67d44 --- /dev/null +++ b/equinix/services/metalv1/test/test_metadata_network_network.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.metadata_network_network import MetadataNetworkNetwork + +class TestMetadataNetworkNetwork(unittest.TestCase): + """MetadataNetworkNetwork unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataNetworkNetwork: + """Test MetadataNetworkNetwork + 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 `MetadataNetworkNetwork` + """ + model = MetadataNetworkNetwork() + if include_optional: + return MetadataNetworkNetwork( + bonding = equinix.services.metalv1.models.metadata_network_network_bonding.Metadata_network_network_bonding( + href = '', + link_aggregation = '', + mac = '', + mode = 56, ), + href = '' + ) + else: + return MetadataNetworkNetwork( + ) + """ + + def testMetadataNetworkNetwork(self): + """Test MetadataNetworkNetwork""" + # 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_metadata_network_network_bonding.py b/equinix/services/metalv1/test/test_metadata_network_network_bonding.py new file mode 100644 index 00000000..30923edb --- /dev/null +++ b/equinix/services/metalv1/test/test_metadata_network_network_bonding.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.metadata_network_network_bonding import MetadataNetworkNetworkBonding + +class TestMetadataNetworkNetworkBonding(unittest.TestCase): + """MetadataNetworkNetworkBonding unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataNetworkNetworkBonding: + """Test MetadataNetworkNetworkBonding + 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 `MetadataNetworkNetworkBonding` + """ + model = MetadataNetworkNetworkBonding() + if include_optional: + return MetadataNetworkNetworkBonding( + href = '', + link_aggregation = '', + mac = '', + mode = 56 + ) + else: + return MetadataNetworkNetworkBonding( + ) + """ + + def testMetadataNetworkNetworkBonding(self): + """Test MetadataNetworkNetworkBonding""" + # 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_metal_gateway.py b/equinix/services/metalv1/test/test_metal_gateway.py new file mode 100644 index 00000000..39efb3d8 --- /dev/null +++ b/equinix/services/metalv1/test/test_metal_gateway.py @@ -0,0 +1,594 @@ +# coding: utf-8 + +""" + Metal API + + 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.metal_gateway import MetalGateway + +class TestMetalGateway(unittest.TestCase): + """MetalGateway unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetalGateway: + """Test MetalGateway + 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 `MetalGateway` + """ + model = MetalGateway() + if include_optional: + return MetalGateway( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + ip_reservation = equinix.services.metalv1.models.ip_reservation.IPReservation( + addon = True, + address = '', + address_family = 56, + assignments = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + available = '', + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + enabled = True, + facility = null, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = null, + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = , + public = True, + requested_by = , + state = '', + tags = [ + '' + ], + type = 'global_ipv4', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ) + ) + else: + return MetalGateway( + ) + """ + + def testMetalGateway(self): + """Test MetalGateway""" + # 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_metal_gateway_create_input.py b/equinix/services/metalv1/test/test_metal_gateway_create_input.py new file mode 100644 index 00000000..5f7ada63 --- /dev/null +++ b/equinix/services/metalv1/test/test_metal_gateway_create_input.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.metal_gateway_create_input import MetalGatewayCreateInput + +class TestMetalGatewayCreateInput(unittest.TestCase): + """MetalGatewayCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetalGatewayCreateInput: + """Test MetalGatewayCreateInput + 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 `MetalGatewayCreateInput` + """ + model = MetalGatewayCreateInput() + if include_optional: + return MetalGatewayCreateInput( + href = '', + ip_reservation_id = '', + private_ipv4_subnet_size = 56, + virtual_network_id = '' + ) + else: + return MetalGatewayCreateInput( + virtual_network_id = '', + ) + """ + + def testMetalGatewayCreateInput(self): + """Test MetalGatewayCreateInput""" + # 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_metal_gateway_elastic_ip_create_input.py b/equinix/services/metalv1/test/test_metal_gateway_elastic_ip_create_input.py new file mode 100644 index 00000000..04e32261 --- /dev/null +++ b/equinix/services/metalv1/test/test_metal_gateway_elastic_ip_create_input.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Metal API + + 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.metal_gateway_elastic_ip_create_input import MetalGatewayElasticIpCreateInput + +class TestMetalGatewayElasticIpCreateInput(unittest.TestCase): + """MetalGatewayElasticIpCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetalGatewayElasticIpCreateInput: + """Test MetalGatewayElasticIpCreateInput + 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 `MetalGatewayElasticIpCreateInput` + """ + model = MetalGatewayElasticIpCreateInput() + if include_optional: + return MetalGatewayElasticIpCreateInput( + address = '147.75.234.8/31', + customdata = { }, + href = '', + next_hop = '192.168.12.13', + tags = ["NY","prod","public"] + ) + else: + return MetalGatewayElasticIpCreateInput( + address = '147.75.234.8/31', + next_hop = '192.168.12.13', + ) + """ + + def testMetalGatewayElasticIpCreateInput(self): + """Test MetalGatewayElasticIpCreateInput""" + # 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_metal_gateway_list.py b/equinix/services/metalv1/test/test_metal_gateway_list.py new file mode 100644 index 00000000..6507ff67 --- /dev/null +++ b/equinix/services/metalv1/test/test_metal_gateway_list.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Metal API + + 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.metal_gateway_list import MetalGatewayList + +class TestMetalGatewayList(unittest.TestCase): + """MetalGatewayList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetalGatewayList: + """Test MetalGatewayList + 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 `MetalGatewayList` + """ + model = MetalGatewayList() + if include_optional: + return MetalGatewayList( + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ), + metal_gateways = [ + null + ] + ) + else: + return MetalGatewayList( + ) + """ + + def testMetalGatewayList(self): + """Test MetalGatewayList""" + # 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_metal_gateway_list_metal_gateways_inner.py b/equinix/services/metalv1/test/test_metal_gateway_list_metal_gateways_inner.py new file mode 100644 index 00000000..df6f808a --- /dev/null +++ b/equinix/services/metalv1/test/test_metal_gateway_list_metal_gateways_inner.py @@ -0,0 +1,788 @@ +# coding: utf-8 + +""" + Metal API + + 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.metal_gateway_list_metal_gateways_inner import MetalGatewayListMetalGatewaysInner + +class TestMetalGatewayListMetalGatewaysInner(unittest.TestCase): + """MetalGatewayListMetalGatewaysInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetalGatewayListMetalGatewaysInner: + """Test MetalGatewayListMetalGatewaysInner + 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 `MetalGatewayListMetalGatewaysInner` + """ + model = MetalGatewayListMetalGatewaysInner() + if include_optional: + return MetalGatewayListMetalGatewaysInner( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + ip_reservation = equinix.services.metalv1.models.vrf_ip_reservation.VrfIpReservation( + address = '', + address_family = 56, + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + gateway = '', + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + public = True, + state = '', + tags = [ + '' + ], + type = 'vrf', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ) + else: + return MetalGatewayListMetalGatewaysInner( + ) + """ + + def testMetalGatewayListMetalGatewaysInner(self): + """Test MetalGatewayListMetalGatewaysInner""" + # 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_metal_gateway_lite.py b/equinix/services/metalv1/test/test_metal_gateway_lite.py new file mode 100644 index 00000000..24d6cd69 --- /dev/null +++ b/equinix/services/metalv1/test/test_metal_gateway_lite.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Metal API + + 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.metal_gateway_lite import MetalGatewayLite + +class TestMetalGatewayLite(unittest.TestCase): + """MetalGatewayLite unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetalGatewayLite: + """Test MetalGatewayLite + 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 `MetalGatewayLite` + """ + model = MetalGatewayLite() + if include_optional: + return MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001 + ) + else: + return MetalGatewayLite( + ) + """ + + def testMetalGatewayLite(self): + """Test MetalGatewayLite""" + # 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_metal_gateways_api.py b/equinix/services/metalv1/test/test_metal_gateways_api.py new file mode 100644 index 00000000..b4c838c0 --- /dev/null +++ b/equinix/services/metalv1/test/test_metal_gateways_api.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.metal_gateways_api import MetalGatewaysApi + + +class TestMetalGatewaysApi(unittest.TestCase): + """MetalGatewaysApi unit test stubs""" + + def setUp(self) -> None: + self.api = MetalGatewaysApi() + + def tearDown(self) -> None: + pass + + def test_create_bgp_dynamic_neighbor(self) -> None: + """Test case for create_bgp_dynamic_neighbor + + Create a VRF BGP Dynamic Neighbor range + """ + pass + + def test_create_metal_gateway(self) -> None: + """Test case for create_metal_gateway + + Create a metal gateway + """ + pass + + def test_create_metal_gateway_elastic_ip(self) -> None: + """Test case for create_metal_gateway_elastic_ip + + Create a Metal Gateway Elastic IP + """ + pass + + def test_delete_metal_gateway(self) -> None: + """Test case for delete_metal_gateway + + Deletes the metal gateway + """ + pass + + def test_find_metal_gateway_by_id(self) -> None: + """Test case for find_metal_gateway_by_id + + Returns the metal gateway + """ + pass + + def test_find_metal_gateways_by_project(self) -> None: + """Test case for find_metal_gateways_by_project + + Returns all metal gateways for a project + """ + pass + + def test_find_metal_gateways_by_project_all_pages(self): + """Test case for find_metal_gateways_by_project_all_pages + + Returns all metal gateways for a project # noqa: E501 + """ + pass + + def test_get_bgp_dynamic_neighbors(self) -> None: + """Test case for get_bgp_dynamic_neighbors + + List BGP Dynamic Neighbors + """ + pass + + def test_get_metal_gateway_elastic_ips(self) -> None: + """Test case for get_metal_gateway_elastic_ips + + List Metal Gateway Elastic IPs + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_metro.py b/equinix/services/metalv1/test/test_metro.py new file mode 100644 index 00000000..37e8f5a6 --- /dev/null +++ b/equinix/services/metalv1/test/test_metro.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.metro import Metro + +class TestMetro(unittest.TestCase): + """Metro unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Metro: + """Test Metro + 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 `Metro` + """ + model = Metro() + if include_optional: + return Metro( + code = '', + country = '', + href = '', + id = '', + name = '' + ) + else: + return Metro( + ) + """ + + def testMetro(self): + """Test Metro""" + # 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_metro_input.py b/equinix/services/metalv1/test/test_metro_input.py new file mode 100644 index 00000000..f9f62106 --- /dev/null +++ b/equinix/services/metalv1/test/test_metro_input.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.metro_input import MetroInput + +class TestMetroInput(unittest.TestCase): + """MetroInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetroInput: + """Test MetroInput + 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 `MetroInput` + """ + model = MetroInput() + if include_optional: + return MetroInput( + href = '', + metro = 'sv' + ) + else: + return MetroInput( + metro = 'sv', + ) + """ + + def testMetroInput(self): + """Test MetroInput""" + # 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_metro_list.py b/equinix/services/metalv1/test/test_metro_list.py new file mode 100644 index 00000000..0db3c94a --- /dev/null +++ b/equinix/services/metalv1/test/test_metro_list.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.metro_list import MetroList + +class TestMetroList(unittest.TestCase): + """MetroList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetroList: + """Test MetroList + 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 `MetroList` + """ + model = MetroList() + if include_optional: + return MetroList( + href = '', + metros = [ + equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ) + ] + ) + else: + return MetroList( + ) + """ + + def testMetroList(self): + """Test MetroList""" + # 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_metros_api.py b/equinix/services/metalv1/test/test_metros_api.py new file mode 100644 index 00000000..73ae124d --- /dev/null +++ b/equinix/services/metalv1/test/test_metros_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.metros_api import MetrosApi + + +class TestMetrosApi(unittest.TestCase): + """MetrosApi unit test stubs""" + + def setUp(self) -> None: + self.api = MetrosApi() + + def tearDown(self) -> None: + pass + + def test_find_metros(self) -> None: + """Test case for find_metros + + Retrieve all metros + """ + pass + + def test_get_metro(self) -> None: + """Test case for get_metro + + Retrieve a specific Metro's details + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_mount.py b/equinix/services/metalv1/test/test_mount.py new file mode 100644 index 00000000..33d8717c --- /dev/null +++ b/equinix/services/metalv1/test/test_mount.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Metal API + + 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.mount import Mount + +class TestMount(unittest.TestCase): + """Mount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Mount: + """Test Mount + 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 `Mount` + """ + model = Mount() + if include_optional: + return Mount( + device = '', + format = '', + href = '', + options = [ + '' + ], + point = '' + ) + else: + return Mount( + ) + """ + + def testMount(self): + """Test Mount""" + # 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_move_hardware_reservation_request.py b/equinix/services/metalv1/test/test_move_hardware_reservation_request.py new file mode 100644 index 00000000..957de91a --- /dev/null +++ b/equinix/services/metalv1/test/test_move_hardware_reservation_request.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.move_hardware_reservation_request import MoveHardwareReservationRequest + +class TestMoveHardwareReservationRequest(unittest.TestCase): + """MoveHardwareReservationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MoveHardwareReservationRequest: + """Test MoveHardwareReservationRequest + 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 `MoveHardwareReservationRequest` + """ + model = MoveHardwareReservationRequest() + if include_optional: + return MoveHardwareReservationRequest( + href = '', + project_id = '' + ) + else: + return MoveHardwareReservationRequest( + ) + """ + + def testMoveHardwareReservationRequest(self): + """Test MoveHardwareReservationRequest""" + # 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_new_password.py b/equinix/services/metalv1/test/test_new_password.py new file mode 100644 index 00000000..3d6120a4 --- /dev/null +++ b/equinix/services/metalv1/test/test_new_password.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.new_password import NewPassword + +class TestNewPassword(unittest.TestCase): + """NewPassword unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NewPassword: + """Test NewPassword + 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 `NewPassword` + """ + model = NewPassword() + if include_optional: + return NewPassword( + href = '', + new_password = '' + ) + else: + return NewPassword( + ) + """ + + def testNewPassword(self): + """Test NewPassword""" + # 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_operating_system.py b/equinix/services/metalv1/test/test_operating_system.py new file mode 100644 index 00000000..5baa8929 --- /dev/null +++ b/equinix/services/metalv1/test/test_operating_system.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Metal API + + 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.operating_system import OperatingSystem + +class TestOperatingSystem(unittest.TestCase): + """OperatingSystem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OperatingSystem: + """Test OperatingSystem + 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 `OperatingSystem` + """ + model = OperatingSystem() + if include_optional: + return OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '' + ) + else: + return OperatingSystem( + ) + """ + + def testOperatingSystem(self): + """Test OperatingSystem""" + # 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_operating_system_list.py b/equinix/services/metalv1/test/test_operating_system_list.py new file mode 100644 index 00000000..c17181a4 --- /dev/null +++ b/equinix/services/metalv1/test/test_operating_system_list.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Metal API + + 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.operating_system_list import OperatingSystemList + +class TestOperatingSystemList(unittest.TestCase): + """OperatingSystemList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OperatingSystemList: + """Test OperatingSystemList + 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 `OperatingSystemList` + """ + model = OperatingSystemList() + if include_optional: + return OperatingSystemList( + href = '', + operating_systems = [ + equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ) + ] + ) + else: + return OperatingSystemList( + ) + """ + + def testOperatingSystemList(self): + """Test OperatingSystemList""" + # 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_operating_systems_api.py b/equinix/services/metalv1/test/test_operating_systems_api.py new file mode 100644 index 00000000..9f5edf5e --- /dev/null +++ b/equinix/services/metalv1/test/test_operating_systems_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.operating_systems_api import OperatingSystemsApi + + +class TestOperatingSystemsApi(unittest.TestCase): + """OperatingSystemsApi unit test stubs""" + + def setUp(self) -> None: + self.api = OperatingSystemsApi() + + def tearDown(self) -> None: + pass + + def test_find_operating_system_version(self) -> None: + """Test case for find_operating_system_version + + Retrieve all operating system versions + """ + pass + + def test_find_operating_systems(self) -> None: + """Test case for find_operating_systems + + Retrieve all operating systems + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_organization.py b/equinix/services/metalv1/test/test_organization.py new file mode 100644 index 00000000..1e49567a --- /dev/null +++ b/equinix/services/metalv1/test/test_organization.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Metal API + + 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.organization import Organization + +class TestOrganization(unittest.TestCase): + """Organization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Organization: + """Test Organization + 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 `Organization` + """ + model = Organization() + if include_optional: + return Organization( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + billing_address = equinix.services.metalv1.models.address.Address( + address = '', + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + credit_amount = 1.337, + customdata = equinix.services.metalv1.models.customdata.customdata(), + description = '', + enforce_2fa_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + logo = '', + members = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + memberships = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + name = '', + projects = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + terms = 56, + twitter = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + website = '' + ) + else: + return Organization( + ) + """ + + def testOrganization(self): + """Test Organization""" + # 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_organization_input.py b/equinix/services/metalv1/test/test_organization_input.py new file mode 100644 index 00000000..a6e37054 --- /dev/null +++ b/equinix/services/metalv1/test/test_organization_input.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Metal API + + 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.organization_input import OrganizationInput + +class TestOrganizationInput(unittest.TestCase): + """OrganizationInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OrganizationInput: + """Test OrganizationInput + 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 `OrganizationInput` + """ + model = OrganizationInput() + if include_optional: + return OrganizationInput( + address = equinix.services.metalv1.models.address.Address( + address = '', + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + billing_address = equinix.services.metalv1.models.address.Address( + address = '', + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + customdata = None, + description = '', + enforce_2fa_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + name = '', + twitter = '', + website = '' + ) + else: + return OrganizationInput( + ) + """ + + def testOrganizationInput(self): + """Test OrganizationInput""" + # 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_organization_list.py b/equinix/services/metalv1/test/test_organization_list.py new file mode 100644 index 00000000..7ceec30e --- /dev/null +++ b/equinix/services/metalv1/test/test_organization_list.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Metal API + + 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.organization_list import OrganizationList + +class TestOrganizationList(unittest.TestCase): + """OrganizationList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OrganizationList: + """Test OrganizationList + 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 `OrganizationList` + """ + model = OrganizationList() + if include_optional: + return OrganizationList( + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ), + organizations = [ + equinix.services.metalv1.models.organization.Organization( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + billing_address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + country = '', + href = '', + state = '', + zip_code = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + credit_amount = 1.337, + customdata = equinix.services.metalv1.models.customdata.customdata(), + description = '', + enforce_2fa_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + logo = '', + members = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + memberships = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + name = '', + projects = [ + + ], + terms = 56, + twitter = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + website = '', ) + ] + ) + else: + return OrganizationList( + ) + """ + + def testOrganizationList(self): + """Test OrganizationList""" + # 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_organizations_api.py b/equinix/services/metalv1/test/test_organizations_api.py new file mode 100644 index 00000000..70088aa8 --- /dev/null +++ b/equinix/services/metalv1/test/test_organizations_api.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.organizations_api import OrganizationsApi + + +class TestOrganizationsApi(unittest.TestCase): + """OrganizationsApi unit test stubs""" + + def setUp(self) -> None: + self.api = OrganizationsApi() + + def tearDown(self) -> None: + pass + + def test_create_organization(self) -> None: + """Test case for create_organization + + Create an organization + """ + pass + + def test_create_organization_invitation(self) -> None: + """Test case for create_organization_invitation + + Create an invitation for an organization + """ + pass + + def test_create_organization_project(self) -> None: + """Test case for create_organization_project + + Create a project for the organization + """ + pass + + def test_create_payment_method(self) -> None: + """Test case for create_payment_method + + Create a payment method for the given organization + """ + pass + + def test_delete_organization(self) -> None: + """Test case for delete_organization + + Delete the organization + """ + pass + + def test_find_operating_systems_by_organization(self) -> None: + """Test case for find_operating_systems_by_organization + + Retrieve all operating systems visible by the organization + """ + pass + + def test_find_organization_by_id(self) -> None: + """Test case for find_organization_by_id + + Retrieve an organization's details + """ + pass + + def test_find_organization_customdata(self) -> None: + """Test case for find_organization_customdata + + Retrieve the custom metadata of an organization + """ + pass + + def test_find_organization_invitations(self) -> None: + """Test case for find_organization_invitations + + Retrieve organization invitations + """ + pass + + def test_find_organization_payment_methods(self) -> None: + """Test case for find_organization_payment_methods + + Retrieve all payment methods of an organization + """ + pass + + def test_find_organization_projects(self) -> None: + """Test case for find_organization_projects + + Retrieve all projects of an organization + """ + pass + + def test_find_organization_projects_all_pages(self): + """Test case for find_organization_projects_all_pages + + Retrieve all projects of an organization # noqa: E501 + """ + pass + + def test_find_organization_transfers(self) -> None: + """Test case for find_organization_transfers + + Retrieve all project transfer requests from or to an organization + """ + pass + + def test_find_organizations(self) -> None: + """Test case for find_organizations + + Retrieve all organizations + """ + pass + + def test_find_organizations_all_pages(self): + """Test case for find_organizations_all_pages + + Retrieve all organizations # noqa: E501 + """ + pass + + def test_find_plans_by_organization(self) -> None: + """Test case for find_plans_by_organization + + Retrieve all plans visible by the organization + """ + pass + + def test_update_organization(self) -> None: + """Test case for update_organization + + Update the organization + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_otps_api.py b/equinix/services/metalv1/test/test_otps_api.py new file mode 100644 index 00000000..6c313be0 --- /dev/null +++ b/equinix/services/metalv1/test/test_otps_api.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.otps_api import OTPsApi + + +class TestOTPsApi(unittest.TestCase): + """OTPsApi unit test stubs""" + + def setUp(self) -> None: + self.api = OTPsApi() + + def tearDown(self) -> None: + pass + + def test_find_ensure_otp(self) -> None: + """Test case for find_ensure_otp + + Verify user by providing an OTP + """ + pass + + def test_find_recovery_codes(self) -> None: + """Test case for find_recovery_codes + + Retrieve my recovery codes + """ + pass + + def test_receive_codes(self) -> None: + """Test case for receive_codes + + Receive an OTP per sms + """ + pass + + def test_regenerate_codes(self) -> None: + """Test case for regenerate_codes + + Generate new recovery codes + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_parent_block.py b/equinix/services/metalv1/test/test_parent_block.py new file mode 100644 index 00000000..6b8d37e0 --- /dev/null +++ b/equinix/services/metalv1/test/test_parent_block.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.parent_block import ParentBlock + +class TestParentBlock(unittest.TestCase): + """ParentBlock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ParentBlock: + """Test ParentBlock + 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 `ParentBlock` + """ + model = ParentBlock() + if include_optional: + return ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '' + ) + else: + return ParentBlock( + ) + """ + + def testParentBlock(self): + """Test ParentBlock""" + # 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_partition.py b/equinix/services/metalv1/test/test_partition.py new file mode 100644 index 00000000..2352d26a --- /dev/null +++ b/equinix/services/metalv1/test/test_partition.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.partition import Partition + +class TestPartition(unittest.TestCase): + """Partition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Partition: + """Test Partition + 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 `Partition` + """ + model = Partition() + if include_optional: + return Partition( + href = '', + label = '', + number = 56, + size = '' + ) + else: + return Partition( + ) + """ + + def testPartition(self): + """Test Partition""" + # 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_password_reset_tokens_api.py b/equinix/services/metalv1/test/test_password_reset_tokens_api.py new file mode 100644 index 00000000..5c3d8ddf --- /dev/null +++ b/equinix/services/metalv1/test/test_password_reset_tokens_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.password_reset_tokens_api import PasswordResetTokensApi + + +class TestPasswordResetTokensApi(unittest.TestCase): + """PasswordResetTokensApi unit test stubs""" + + def setUp(self) -> None: + self.api = PasswordResetTokensApi() + + def tearDown(self) -> None: + pass + + def test_create_password_reset_token(self) -> None: + """Test case for create_password_reset_token + + Create a password reset token + """ + pass + + def test_reset_password(self) -> None: + """Test case for reset_password + + Reset current user password + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_payment_method.py b/equinix/services/metalv1/test/test_payment_method.py new file mode 100644 index 00000000..c1b425e0 --- /dev/null +++ b/equinix/services/metalv1/test/test_payment_method.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Metal API + + 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.payment_method import PaymentMethod + +class TestPaymentMethod(unittest.TestCase): + """PaymentMethod unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaymentMethod: + """Test PaymentMethod + 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 `PaymentMethod` + """ + model = PaymentMethod() + if include_optional: + return PaymentMethod( + billing_address = equinix.services.metalv1.models.payment_method_billing_address.PaymentMethodBillingAddress( + country_code_alpha2 = '', + href = '', + postal_code = '', + street_address = '', ), + card_type = '', + cardholder_name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by_user = equinix.services.metalv1.models.href.Href( + href = '', ), + default = True, + email = '', + expiration_month = '', + expiration_year = '', + href = '', + id = '', + name = '', + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + projects = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + type = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return PaymentMethod( + ) + """ + + def testPaymentMethod(self): + """Test PaymentMethod""" + # 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_payment_method_billing_address.py b/equinix/services/metalv1/test/test_payment_method_billing_address.py new file mode 100644 index 00000000..37ede765 --- /dev/null +++ b/equinix/services/metalv1/test/test_payment_method_billing_address.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.payment_method_billing_address import PaymentMethodBillingAddress + +class TestPaymentMethodBillingAddress(unittest.TestCase): + """PaymentMethodBillingAddress unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaymentMethodBillingAddress: + """Test PaymentMethodBillingAddress + 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 `PaymentMethodBillingAddress` + """ + model = PaymentMethodBillingAddress() + if include_optional: + return PaymentMethodBillingAddress( + country_code_alpha2 = '', + href = '', + postal_code = '', + street_address = '' + ) + else: + return PaymentMethodBillingAddress( + ) + """ + + def testPaymentMethodBillingAddress(self): + """Test PaymentMethodBillingAddress""" + # 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_payment_method_create_input.py b/equinix/services/metalv1/test/test_payment_method_create_input.py new file mode 100644 index 00000000..7d059204 --- /dev/null +++ b/equinix/services/metalv1/test/test_payment_method_create_input.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.payment_method_create_input import PaymentMethodCreateInput + +class TestPaymentMethodCreateInput(unittest.TestCase): + """PaymentMethodCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaymentMethodCreateInput: + """Test PaymentMethodCreateInput + 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 `PaymentMethodCreateInput` + """ + model = PaymentMethodCreateInput() + if include_optional: + return PaymentMethodCreateInput( + default = True, + href = '', + name = '', + nonce = '' + ) + else: + return PaymentMethodCreateInput( + name = '', + nonce = '', + ) + """ + + def testPaymentMethodCreateInput(self): + """Test PaymentMethodCreateInput""" + # 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_payment_method_list.py b/equinix/services/metalv1/test/test_payment_method_list.py new file mode 100644 index 00000000..9ac9a87f --- /dev/null +++ b/equinix/services/metalv1/test/test_payment_method_list.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Metal API + + 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.payment_method_list import PaymentMethodList + +class TestPaymentMethodList(unittest.TestCase): + """PaymentMethodList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaymentMethodList: + """Test PaymentMethodList + 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 `PaymentMethodList` + """ + model = PaymentMethodList() + if include_optional: + return PaymentMethodList( + href = '', + payment_methods = [ + equinix.services.metalv1.models.payment_method.PaymentMethod( + billing_address = equinix.services.metalv1.models.payment_method_billing_address.PaymentMethodBillingAddress( + country_code_alpha2 = '', + href = '', + postal_code = '', + street_address = '', ), + card_type = '', + cardholder_name = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by_user = equinix.services.metalv1.models.href.Href( + href = '', ), + default = True, + email = '', + expiration_month = '', + expiration_year = '', + href = '', + id = '', + name = '', + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + projects = [ + + ], + type = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ] + ) + else: + return PaymentMethodList( + ) + """ + + def testPaymentMethodList(self): + """Test PaymentMethodList""" + # 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_payment_method_update_input.py b/equinix/services/metalv1/test/test_payment_method_update_input.py new file mode 100644 index 00000000..4ac6c118 --- /dev/null +++ b/equinix/services/metalv1/test/test_payment_method_update_input.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Metal API + + 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.payment_method_update_input import PaymentMethodUpdateInput + +class TestPaymentMethodUpdateInput(unittest.TestCase): + """PaymentMethodUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PaymentMethodUpdateInput: + """Test PaymentMethodUpdateInput + 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 `PaymentMethodUpdateInput` + """ + model = PaymentMethodUpdateInput() + if include_optional: + return PaymentMethodUpdateInput( + billing_address = None, + cardholder_name = '', + default = True, + expiration_month = '', + expiration_year = 56, + href = '', + name = '' + ) + else: + return PaymentMethodUpdateInput( + ) + """ + + def testPaymentMethodUpdateInput(self): + """Test PaymentMethodUpdateInput""" + # 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_payment_methods_api.py b/equinix/services/metalv1/test/test_payment_methods_api.py new file mode 100644 index 00000000..74f1e161 --- /dev/null +++ b/equinix/services/metalv1/test/test_payment_methods_api.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.payment_methods_api import PaymentMethodsApi + + +class TestPaymentMethodsApi(unittest.TestCase): + """PaymentMethodsApi unit test stubs""" + + def setUp(self) -> None: + self.api = PaymentMethodsApi() + + def tearDown(self) -> None: + pass + + def test_delete_payment_method(self) -> None: + """Test case for delete_payment_method + + Delete the payment method + """ + pass + + def test_find_payment_method_by_id(self) -> None: + """Test case for find_payment_method_by_id + + Retrieve a payment method + """ + pass + + def test_update_payment_method(self) -> None: + """Test case for update_payment_method + + Update the payment method + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_plan.py b/equinix/services/metalv1/test/test_plan.py new file mode 100644 index 00000000..d6927ffc --- /dev/null +++ b/equinix/services/metalv1/test/test_plan.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan import Plan + +class TestPlan(unittest.TestCase): + """Plan unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Plan: + """Test Plan + 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 `Plan` + """ + model = Plan() + if include_optional: + return Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + categories = [ + '' + ], + var_class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard' + ) + else: + return Plan( + ) + """ + + def testPlan(self): + """Test Plan""" + # 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_plan_available_in_inner.py b/equinix/services/metalv1/test/test_plan_available_in_inner.py new file mode 100644 index 00000000..9331d422 --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_available_in_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_available_in_inner import PlanAvailableInInner + +class TestPlanAvailableInInner(unittest.TestCase): + """PlanAvailableInInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanAvailableInInner: + """Test PlanAvailableInInner + 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 `PlanAvailableInInner` + """ + model = PlanAvailableInInner() + if include_optional: + return PlanAvailableInInner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ) + ) + else: + return PlanAvailableInInner( + ) + """ + + def testPlanAvailableInInner(self): + """Test PlanAvailableInInner""" + # 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_plan_available_in_inner_price.py b/equinix/services/metalv1/test/test_plan_available_in_inner_price.py new file mode 100644 index 00000000..d21ddba9 --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_available_in_inner_price.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_available_in_inner_price import PlanAvailableInInnerPrice + +class TestPlanAvailableInInnerPrice(unittest.TestCase): + """PlanAvailableInInnerPrice unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanAvailableInInnerPrice: + """Test PlanAvailableInInnerPrice + 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 `PlanAvailableInInnerPrice` + """ + model = PlanAvailableInInnerPrice() + if include_optional: + return PlanAvailableInInnerPrice( + hour = 1.23, + href = '' + ) + else: + return PlanAvailableInInnerPrice( + ) + """ + + def testPlanAvailableInInnerPrice(self): + """Test PlanAvailableInInnerPrice""" + # 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_plan_available_in_metros_inner.py b/equinix/services/metalv1/test/test_plan_available_in_metros_inner.py new file mode 100644 index 00000000..ba4614da --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_available_in_metros_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_available_in_metros_inner import PlanAvailableInMetrosInner + +class TestPlanAvailableInMetrosInner(unittest.TestCase): + """PlanAvailableInMetrosInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanAvailableInMetrosInner: + """Test PlanAvailableInMetrosInner + 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 `PlanAvailableInMetrosInner` + """ + model = PlanAvailableInMetrosInner() + if include_optional: + return PlanAvailableInMetrosInner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ) + ) + else: + return PlanAvailableInMetrosInner( + ) + """ + + def testPlanAvailableInMetrosInner(self): + """Test PlanAvailableInMetrosInner""" + # 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_plan_id_name.py b/equinix/services/metalv1/test/test_plan_id_name.py new file mode 100644 index 00000000..89e18805 --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_id_name.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_id_name import PlanIdName + +class TestPlanIdName(unittest.TestCase): + """PlanIdName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanIdName: + """Test PlanIdName + 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 `PlanIdName` + """ + model = PlanIdName() + if include_optional: + return PlanIdName( + href = '', + id = '', + name = '' + ) + else: + return PlanIdName( + ) + """ + + def testPlanIdName(self): + """Test PlanIdName""" + # 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_plan_list.py b/equinix/services/metalv1/test/test_plan_list.py new file mode 100644 index 00000000..d661097a --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_list.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_list import PlanList + +class TestPlanList(unittest.TestCase): + """PlanList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanList: + """Test PlanList + 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 `PlanList` + """ + model = PlanList() + if include_optional: + return PlanList( + href = '', + plans = [ + equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ) + ] + ) + else: + return PlanList( + ) + """ + + def testPlanList(self): + """Test PlanList""" + # 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_plan_specs.py b/equinix/services/metalv1/test/test_plan_specs.py new file mode 100644 index 00000000..15aabdc9 --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_specs.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_specs import PlanSpecs + +class TestPlanSpecs(unittest.TestCase): + """PlanSpecs unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanSpecs: + """Test PlanSpecs + 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 `PlanSpecs` + """ + model = PlanSpecs() + if include_optional: + return PlanSpecs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ] + ) + else: + return PlanSpecs( + ) + """ + + def testPlanSpecs(self): + """Test PlanSpecs""" + # 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_plan_specs_cpus_inner.py b/equinix/services/metalv1/test/test_plan_specs_cpus_inner.py new file mode 100644 index 00000000..e548e916 --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_specs_cpus_inner.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_specs_cpus_inner import PlanSpecsCpusInner + +class TestPlanSpecsCpusInner(unittest.TestCase): + """PlanSpecsCpusInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanSpecsCpusInner: + """Test PlanSpecsCpusInner + 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 `PlanSpecsCpusInner` + """ + model = PlanSpecsCpusInner() + if include_optional: + return PlanSpecsCpusInner( + count = 56, + href = '', + type = '' + ) + else: + return PlanSpecsCpusInner( + ) + """ + + def testPlanSpecsCpusInner(self): + """Test PlanSpecsCpusInner""" + # 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_plan_specs_drives_inner.py b/equinix/services/metalv1/test/test_plan_specs_drives_inner.py new file mode 100644 index 00000000..5973db4a --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_specs_drives_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_specs_drives_inner import PlanSpecsDrivesInner + +class TestPlanSpecsDrivesInner(unittest.TestCase): + """PlanSpecsDrivesInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanSpecsDrivesInner: + """Test PlanSpecsDrivesInner + 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 `PlanSpecsDrivesInner` + """ + model = PlanSpecsDrivesInner() + if include_optional: + return PlanSpecsDrivesInner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '' + ) + else: + return PlanSpecsDrivesInner( + ) + """ + + def testPlanSpecsDrivesInner(self): + """Test PlanSpecsDrivesInner""" + # 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_plan_specs_features.py b/equinix/services/metalv1/test/test_plan_specs_features.py new file mode 100644 index 00000000..758a3a9f --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_specs_features.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_specs_features import PlanSpecsFeatures + +class TestPlanSpecsFeatures(unittest.TestCase): + """PlanSpecsFeatures unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanSpecsFeatures: + """Test PlanSpecsFeatures + 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 `PlanSpecsFeatures` + """ + model = PlanSpecsFeatures() + if include_optional: + return PlanSpecsFeatures( + href = '', + raid = True, + txt = True, + uefi = True + ) + else: + return PlanSpecsFeatures( + ) + """ + + def testPlanSpecsFeatures(self): + """Test PlanSpecsFeatures""" + # 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_plan_specs_memory.py b/equinix/services/metalv1/test/test_plan_specs_memory.py new file mode 100644 index 00000000..1fc8eb23 --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_specs_memory.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_specs_memory import PlanSpecsMemory + +class TestPlanSpecsMemory(unittest.TestCase): + """PlanSpecsMemory unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanSpecsMemory: + """Test PlanSpecsMemory + 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 `PlanSpecsMemory` + """ + model = PlanSpecsMemory() + if include_optional: + return PlanSpecsMemory( + href = '', + total = '' + ) + else: + return PlanSpecsMemory( + ) + """ + + def testPlanSpecsMemory(self): + """Test PlanSpecsMemory""" + # 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_plan_specs_nics_inner.py b/equinix/services/metalv1/test/test_plan_specs_nics_inner.py new file mode 100644 index 00000000..4702ee0b --- /dev/null +++ b/equinix/services/metalv1/test/test_plan_specs_nics_inner.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.plan_specs_nics_inner import PlanSpecsNicsInner + +class TestPlanSpecsNicsInner(unittest.TestCase): + """PlanSpecsNicsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PlanSpecsNicsInner: + """Test PlanSpecsNicsInner + 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 `PlanSpecsNicsInner` + """ + model = PlanSpecsNicsInner() + if include_optional: + return PlanSpecsNicsInner( + count = 2, + href = '', + type = '' + ) + else: + return PlanSpecsNicsInner( + ) + """ + + def testPlanSpecsNicsInner(self): + """Test PlanSpecsNicsInner""" + # 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_plans_api.py b/equinix/services/metalv1/test/test_plans_api.py new file mode 100644 index 00000000..133af818 --- /dev/null +++ b/equinix/services/metalv1/test/test_plans_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.plans_api import PlansApi + + +class TestPlansApi(unittest.TestCase): + """PlansApi unit test stubs""" + + def setUp(self) -> None: + self.api = PlansApi() + + def tearDown(self) -> None: + pass + + def test_find_plans(self) -> None: + """Test case for find_plans + + Retrieve all plans + """ + pass + + def test_find_plans_by_project(self) -> None: + """Test case for find_plans_by_project + + Retrieve all plans visible by the project + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_port.py b/equinix/services/metalv1/test/test_port.py new file mode 100644 index 00000000..8bdd1986 --- /dev/null +++ b/equinix/services/metalv1/test/test_port.py @@ -0,0 +1,905 @@ +# coding: utf-8 + +""" + Metal API + + 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.port import Port + +class TestPort(unittest.TestCase): + """Port unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Port: + """Test Port + 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 `Port` + """ + model = Port() + if include_optional: + return Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ) + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ) + ] + ) + else: + return Port( + ) + """ + + def testPort(self): + """Test Port""" + # 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_port_assign_input.py b/equinix/services/metalv1/test/test_port_assign_input.py new file mode 100644 index 00000000..090691b0 --- /dev/null +++ b/equinix/services/metalv1/test/test_port_assign_input.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_assign_input import PortAssignInput + +class TestPortAssignInput(unittest.TestCase): + """PortAssignInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortAssignInput: + """Test PortAssignInput + 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 `PortAssignInput` + """ + model = PortAssignInput() + if include_optional: + return PortAssignInput( + href = '', + vnid = '1001' + ) + else: + return PortAssignInput( + ) + """ + + def testPortAssignInput(self): + """Test PortAssignInput""" + # 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_port_convert_layer3_input.py b/equinix/services/metalv1/test/test_port_convert_layer3_input.py new file mode 100644 index 00000000..469c5176 --- /dev/null +++ b/equinix/services/metalv1/test/test_port_convert_layer3_input.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_convert_layer3_input import PortConvertLayer3Input + +class TestPortConvertLayer3Input(unittest.TestCase): + """PortConvertLayer3Input unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortConvertLayer3Input: + """Test PortConvertLayer3Input + 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 `PortConvertLayer3Input` + """ + model = PortConvertLayer3Input() + if include_optional: + return PortConvertLayer3Input( + href = '', + request_ips = [ + equinix.services.metalv1.models.port_convert_layer3_input_request_ips_inner.PortConvertLayer3Input_request_ips_inner( + address_family = 56, + href = '', + public = True, ) + ] + ) + else: + return PortConvertLayer3Input( + ) + """ + + def testPortConvertLayer3Input(self): + """Test PortConvertLayer3Input""" + # 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_port_convert_layer3_input_request_ips_inner.py b/equinix/services/metalv1/test/test_port_convert_layer3_input_request_ips_inner.py new file mode 100644 index 00000000..8e00ccc3 --- /dev/null +++ b/equinix/services/metalv1/test/test_port_convert_layer3_input_request_ips_inner.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_convert_layer3_input_request_ips_inner import PortConvertLayer3InputRequestIpsInner + +class TestPortConvertLayer3InputRequestIpsInner(unittest.TestCase): + """PortConvertLayer3InputRequestIpsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortConvertLayer3InputRequestIpsInner: + """Test PortConvertLayer3InputRequestIpsInner + 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 `PortConvertLayer3InputRequestIpsInner` + """ + model = PortConvertLayer3InputRequestIpsInner() + if include_optional: + return PortConvertLayer3InputRequestIpsInner( + address_family = 56, + href = '', + public = True + ) + else: + return PortConvertLayer3InputRequestIpsInner( + ) + """ + + def testPortConvertLayer3InputRequestIpsInner(self): + """Test PortConvertLayer3InputRequestIpsInner""" + # 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_port_data.py b/equinix/services/metalv1/test/test_port_data.py new file mode 100644 index 00000000..dbcf7688 --- /dev/null +++ b/equinix/services/metalv1/test/test_port_data.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_data import PortData + +class TestPortData(unittest.TestCase): + """PortData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortData: + """Test PortData + 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 `PortData` + """ + model = PortData() + if include_optional: + return PortData( + bonded = True, + href = '', + mac = '' + ) + else: + return PortData( + ) + """ + + def testPortData(self): + """Test PortData""" + # 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_port_vlan_assignment.py b/equinix/services/metalv1/test/test_port_vlan_assignment.py new file mode 100644 index 00000000..551f80d6 --- /dev/null +++ b/equinix/services/metalv1/test/test_port_vlan_assignment.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_vlan_assignment import PortVlanAssignment + +class TestPortVlanAssignment(unittest.TestCase): + """PortVlanAssignment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortVlanAssignment: + """Test PortVlanAssignment + 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 `PortVlanAssignment` + """ + model = PortVlanAssignment() + if include_optional: + return PortVlanAssignment( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + native = True, + port = equinix.services.metalv1.models.href.Href( + href = '', ), + state = 'assigned', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.href.Href( + href = '', ), + vlan = 56 + ) + else: + return PortVlanAssignment( + ) + """ + + def testPortVlanAssignment(self): + """Test PortVlanAssignment""" + # 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_port_vlan_assignment_batch.py b/equinix/services/metalv1/test/test_port_vlan_assignment_batch.py new file mode 100644 index 00000000..8f8aa930 --- /dev/null +++ b/equinix/services/metalv1/test/test_port_vlan_assignment_batch.py @@ -0,0 +1,493 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_vlan_assignment_batch import PortVlanAssignmentBatch + +class TestPortVlanAssignmentBatch(unittest.TestCase): + """PortVlanAssignmentBatch unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortVlanAssignmentBatch: + """Test PortVlanAssignmentBatch + 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 `PortVlanAssignmentBatch` + """ + model = PortVlanAssignmentBatch() + if include_optional: + return PortVlanAssignmentBatch( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + error_messages = [ + '' + ], + href = '', + id = '', + port = equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ) + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ), + project = equinix.services.metalv1.models.href.Href( + href = '', ), + quantity = 56, + state = 'queued', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan_assignments = [ + equinix.services.metalv1.models.port_vlan_assignment_batch_vlan_assignments_inner.PortVlanAssignmentBatch_vlan_assignments_inner( + href = '', + id = '', + native = True, + state = 'assigned', + vlan = 56, ) + ] + ) + else: + return PortVlanAssignmentBatch( + ) + """ + + def testPortVlanAssignmentBatch(self): + """Test PortVlanAssignmentBatch""" + # 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_port_vlan_assignment_batch_create_input.py b/equinix/services/metalv1/test/test_port_vlan_assignment_batch_create_input.py new file mode 100644 index 00000000..d5932bb3 --- /dev/null +++ b/equinix/services/metalv1/test/test_port_vlan_assignment_batch_create_input.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_vlan_assignment_batch_create_input import PortVlanAssignmentBatchCreateInput + +class TestPortVlanAssignmentBatchCreateInput(unittest.TestCase): + """PortVlanAssignmentBatchCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortVlanAssignmentBatchCreateInput: + """Test PortVlanAssignmentBatchCreateInput + 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 `PortVlanAssignmentBatchCreateInput` + """ + model = PortVlanAssignmentBatchCreateInput() + if include_optional: + return PortVlanAssignmentBatchCreateInput( + href = '', + vlan_assignments = [ + equinix.services.metalv1.models.port_vlan_assignment_batch_create_input_vlan_assignments_inner.PortVlanAssignmentBatchCreateInput_vlan_assignments_inner( + href = '', + native = True, + state = 'assigned', + vlan = '', ) + ] + ) + else: + return PortVlanAssignmentBatchCreateInput( + ) + """ + + def testPortVlanAssignmentBatchCreateInput(self): + """Test PortVlanAssignmentBatchCreateInput""" + # 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_port_vlan_assignment_batch_create_input_vlan_assignments_inner.py b/equinix/services/metalv1/test/test_port_vlan_assignment_batch_create_input_vlan_assignments_inner.py new file mode 100644 index 00000000..ba86b5cf --- /dev/null +++ b/equinix/services/metalv1/test/test_port_vlan_assignment_batch_create_input_vlan_assignments_inner.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_vlan_assignment_batch_create_input_vlan_assignments_inner import PortVlanAssignmentBatchCreateInputVlanAssignmentsInner + +class TestPortVlanAssignmentBatchCreateInputVlanAssignmentsInner(unittest.TestCase): + """PortVlanAssignmentBatchCreateInputVlanAssignmentsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortVlanAssignmentBatchCreateInputVlanAssignmentsInner: + """Test PortVlanAssignmentBatchCreateInputVlanAssignmentsInner + 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 `PortVlanAssignmentBatchCreateInputVlanAssignmentsInner` + """ + model = PortVlanAssignmentBatchCreateInputVlanAssignmentsInner() + if include_optional: + return PortVlanAssignmentBatchCreateInputVlanAssignmentsInner( + href = '', + native = True, + state = 'assigned', + vlan = '' + ) + else: + return PortVlanAssignmentBatchCreateInputVlanAssignmentsInner( + ) + """ + + def testPortVlanAssignmentBatchCreateInputVlanAssignmentsInner(self): + """Test PortVlanAssignmentBatchCreateInputVlanAssignmentsInner""" + # 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_port_vlan_assignment_batch_list.py b/equinix/services/metalv1/test/test_port_vlan_assignment_batch_list.py new file mode 100644 index 00000000..c566512e --- /dev/null +++ b/equinix/services/metalv1/test/test_port_vlan_assignment_batch_list.py @@ -0,0 +1,496 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_vlan_assignment_batch_list import PortVlanAssignmentBatchList + +class TestPortVlanAssignmentBatchList(unittest.TestCase): + """PortVlanAssignmentBatchList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortVlanAssignmentBatchList: + """Test PortVlanAssignmentBatchList + 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 `PortVlanAssignmentBatchList` + """ + model = PortVlanAssignmentBatchList() + if include_optional: + return PortVlanAssignmentBatchList( + batches = [ + equinix.services.metalv1.models.port_vlan_assignment_batch.PortVlanAssignmentBatch( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + error_messages = [ + '' + ], + href = '', + id = '', + port = equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ) + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ), + project = , + quantity = 56, + state = 'queued', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan_assignments = [ + equinix.services.metalv1.models.port_vlan_assignment_batch_vlan_assignments_inner.PortVlanAssignmentBatch_vlan_assignments_inner( + href = '', + id = '', + native = True, + state = 'assigned', + vlan = 56, ) + ], ) + ], + href = '' + ) + else: + return PortVlanAssignmentBatchList( + ) + """ + + def testPortVlanAssignmentBatchList(self): + """Test PortVlanAssignmentBatchList""" + # 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_port_vlan_assignment_batch_vlan_assignments_inner.py b/equinix/services/metalv1/test/test_port_vlan_assignment_batch_vlan_assignments_inner.py new file mode 100644 index 00000000..b76834f7 --- /dev/null +++ b/equinix/services/metalv1/test/test_port_vlan_assignment_batch_vlan_assignments_inner.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_vlan_assignment_batch_vlan_assignments_inner import PortVlanAssignmentBatchVlanAssignmentsInner + +class TestPortVlanAssignmentBatchVlanAssignmentsInner(unittest.TestCase): + """PortVlanAssignmentBatchVlanAssignmentsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortVlanAssignmentBatchVlanAssignmentsInner: + """Test PortVlanAssignmentBatchVlanAssignmentsInner + 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 `PortVlanAssignmentBatchVlanAssignmentsInner` + """ + model = PortVlanAssignmentBatchVlanAssignmentsInner() + if include_optional: + return PortVlanAssignmentBatchVlanAssignmentsInner( + href = '', + id = '', + native = True, + state = 'assigned', + vlan = 56 + ) + else: + return PortVlanAssignmentBatchVlanAssignmentsInner( + ) + """ + + def testPortVlanAssignmentBatchVlanAssignmentsInner(self): + """Test PortVlanAssignmentBatchVlanAssignmentsInner""" + # 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_port_vlan_assignment_list.py b/equinix/services/metalv1/test/test_port_vlan_assignment_list.py new file mode 100644 index 00000000..b75078ea --- /dev/null +++ b/equinix/services/metalv1/test/test_port_vlan_assignment_list.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Metal API + + 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.port_vlan_assignment_list import PortVlanAssignmentList + +class TestPortVlanAssignmentList(unittest.TestCase): + """PortVlanAssignmentList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PortVlanAssignmentList: + """Test PortVlanAssignmentList + 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 `PortVlanAssignmentList` + """ + model = PortVlanAssignmentList() + if include_optional: + return PortVlanAssignmentList( + href = '', + vlan_assignments = [ + equinix.services.metalv1.models.port_vlan_assignment.PortVlanAssignment( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + native = True, + port = equinix.services.metalv1.models.href.Href( + href = '', ), + state = 'assigned', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.href.Href( + href = '', ), + vlan = 56, ) + ] + ) + else: + return PortVlanAssignmentList( + ) + """ + + def testPortVlanAssignmentList(self): + """Test PortVlanAssignmentList""" + # 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_ports_api.py b/equinix/services/metalv1/test/test_ports_api.py new file mode 100644 index 00000000..7997ac42 --- /dev/null +++ b/equinix/services/metalv1/test/test_ports_api.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.ports_api import PortsApi + + +class TestPortsApi(unittest.TestCase): + """PortsApi unit test stubs""" + + def setUp(self) -> None: + self.api = PortsApi() + + def tearDown(self) -> None: + pass + + def test_assign_native_vlan(self) -> None: + """Test case for assign_native_vlan + + Assign a native VLAN + """ + pass + + def test_assign_port(self) -> None: + """Test case for assign_port + + Assign a port to virtual network + """ + pass + + def test_bond_port(self) -> None: + """Test case for bond_port + + Enabling bonding + """ + pass + + def test_convert_layer2(self) -> None: + """Test case for convert_layer2 + + Convert to Layer 2 + """ + pass + + def test_convert_layer3(self) -> None: + """Test case for convert_layer3 + + Convert to Layer 3 + """ + pass + + def test_create_port_vlan_assignment_batch(self) -> None: + """Test case for create_port_vlan_assignment_batch + + Create a new Port-VLAN Assignment management batch + """ + pass + + def test_delete_native_vlan(self) -> None: + """Test case for delete_native_vlan + + Remove native VLAN + """ + pass + + def test_disbond_port(self) -> None: + """Test case for disbond_port + + Disabling bonding + """ + pass + + def test_find_port_by_id(self) -> None: + """Test case for find_port_by_id + + Retrieve a port + """ + pass + + def test_find_port_vlan_assignment_batch_by_port_id_and_batch_id(self) -> None: + """Test case for find_port_vlan_assignment_batch_by_port_id_and_batch_id + + Retrieve a VLAN Assignment Batch's details + """ + pass + + def test_find_port_vlan_assignment_batches(self) -> None: + """Test case for find_port_vlan_assignment_batches + + List the VLAN Assignment Batches for a port + """ + pass + + def test_find_port_vlan_assignment_by_port_id_and_assignment_id(self) -> None: + """Test case for find_port_vlan_assignment_by_port_id_and_assignment_id + + Show a particular Port VLAN assignment's details + """ + pass + + def test_find_port_vlan_assignments(self) -> None: + """Test case for find_port_vlan_assignments + + List Current VLAN assignments for a port + """ + pass + + def test_unassign_port(self) -> None: + """Test case for unassign_port + + Unassign a port + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_project.py b/equinix/services/metalv1/test/test_project.py new file mode 100644 index 00000000..075b5e01 --- /dev/null +++ b/equinix/services/metalv1/test/test_project.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Metal API + + 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.project import Project + +class TestProject(unittest.TestCase): + """Project unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Project: + """Test Project + 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 `Project` + """ + model = Project() + if include_optional: + return Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + memberships = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + payment_method = equinix.services.metalv1.models.href.Href( + href = '', ), + ssh_keys = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ] + ) + else: + return Project( + ) + """ + + def testProject(self): + """Test Project""" + # 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_project_create_from_root_input.py b/equinix/services/metalv1/test/test_project_create_from_root_input.py new file mode 100644 index 00000000..e1ccba54 --- /dev/null +++ b/equinix/services/metalv1/test/test_project_create_from_root_input.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Metal API + + 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.project_create_from_root_input import ProjectCreateFromRootInput + +class TestProjectCreateFromRootInput(unittest.TestCase): + """ProjectCreateFromRootInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ProjectCreateFromRootInput: + """Test ProjectCreateFromRootInput + 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 `ProjectCreateFromRootInput` + """ + model = ProjectCreateFromRootInput() + if include_optional: + return ProjectCreateFromRootInput( + customdata = None, + href = '', + name = '0', + organization_id = '', + payment_method_id = '', + tags = [ + '' + ], + type = 'default' + ) + else: + return ProjectCreateFromRootInput( + name = '0', + ) + """ + + def testProjectCreateFromRootInput(self): + """Test ProjectCreateFromRootInput""" + # 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_project_create_input.py b/equinix/services/metalv1/test/test_project_create_input.py new file mode 100644 index 00000000..de902641 --- /dev/null +++ b/equinix/services/metalv1/test/test_project_create_input.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.project_create_input import ProjectCreateInput + +class TestProjectCreateInput(unittest.TestCase): + """ProjectCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ProjectCreateInput: + """Test ProjectCreateInput + 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 `ProjectCreateInput` + """ + model = ProjectCreateInput() + if include_optional: + return ProjectCreateInput( + customdata = None, + href = '', + name = '0', + payment_method_id = '', + tags = [ + '' + ], + type = 'default' + ) + else: + return ProjectCreateInput( + name = '0', + ) + """ + + def testProjectCreateInput(self): + """Test ProjectCreateInput""" + # 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_project_id_name.py b/equinix/services/metalv1/test/test_project_id_name.py new file mode 100644 index 00000000..b63563db --- /dev/null +++ b/equinix/services/metalv1/test/test_project_id_name.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.project_id_name import ProjectIdName + +class TestProjectIdName(unittest.TestCase): + """ProjectIdName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ProjectIdName: + """Test ProjectIdName + 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 `ProjectIdName` + """ + model = ProjectIdName() + if include_optional: + return ProjectIdName( + href = '', + id = '', + name = '' + ) + else: + return ProjectIdName( + ) + """ + + def testProjectIdName(self): + """Test ProjectIdName""" + # 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_project_list.py b/equinix/services/metalv1/test/test_project_list.py new file mode 100644 index 00000000..d1b46378 --- /dev/null +++ b/equinix/services/metalv1/test/test_project_list.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Metal API + + 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.project_list import ProjectList + +class TestProjectList(unittest.TestCase): + """ProjectList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ProjectList: + """Test ProjectList + 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 `ProjectList` + """ + model = ProjectList() + if include_optional: + return ProjectList( + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ), + projects = [ + equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ) + ] + ) + else: + return ProjectList( + ) + """ + + def testProjectList(self): + """Test ProjectList""" + # 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_project_update_input.py b/equinix/services/metalv1/test/test_project_update_input.py new file mode 100644 index 00000000..3a357182 --- /dev/null +++ b/equinix/services/metalv1/test/test_project_update_input.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.project_update_input import ProjectUpdateInput + +class TestProjectUpdateInput(unittest.TestCase): + """ProjectUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ProjectUpdateInput: + """Test ProjectUpdateInput + 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 `ProjectUpdateInput` + """ + model = ProjectUpdateInput() + if include_optional: + return ProjectUpdateInput( + backend_transfer_enabled = True, + customdata = None, + href = '', + name = '0', + payment_method_id = '', + tags = [ + '' + ] + ) + else: + return ProjectUpdateInput( + ) + """ + + def testProjectUpdateInput(self): + """Test ProjectUpdateInput""" + # 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_project_usage.py b/equinix/services/metalv1/test/test_project_usage.py new file mode 100644 index 00000000..6d8533a1 --- /dev/null +++ b/equinix/services/metalv1/test/test_project_usage.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Metal API + + 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.project_usage import ProjectUsage + +class TestProjectUsage(unittest.TestCase): + """ProjectUsage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ProjectUsage: + """Test ProjectUsage + 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 `ProjectUsage` + """ + model = ProjectUsage() + if include_optional: + return ProjectUsage( + facility = '', + href = '', + name = '', + plan = '', + plan_version = '', + price = '', + quantity = '', + total = '', + type = '', + unit = '' + ) + else: + return ProjectUsage( + ) + """ + + def testProjectUsage(self): + """Test ProjectUsage""" + # 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_project_usage_list.py b/equinix/services/metalv1/test/test_project_usage_list.py new file mode 100644 index 00000000..fa149f20 --- /dev/null +++ b/equinix/services/metalv1/test/test_project_usage_list.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Metal API + + 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.project_usage_list import ProjectUsageList + +class TestProjectUsageList(unittest.TestCase): + """ProjectUsageList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ProjectUsageList: + """Test ProjectUsageList + 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 `ProjectUsageList` + """ + model = ProjectUsageList() + if include_optional: + return ProjectUsageList( + href = '', + usages = [ + equinix.services.metalv1.models.project_usage.ProjectUsage( + facility = '', + href = '', + name = '', + plan = '', + plan_version = '', + price = '', + quantity = '', + total = '', + type = '', + unit = '', ) + ] + ) + else: + return ProjectUsageList( + ) + """ + + def testProjectUsageList(self): + """Test ProjectUsageList""" + # 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_projects_api.py b/equinix/services/metalv1/test/test_projects_api.py new file mode 100644 index 00000000..97de2555 --- /dev/null +++ b/equinix/services/metalv1/test/test_projects_api.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.projects_api import ProjectsApi + + +class TestProjectsApi(unittest.TestCase): + """ProjectsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ProjectsApi() + + def tearDown(self) -> None: + pass + + def test_create_project(self) -> None: + """Test case for create_project + + Create a project + """ + pass + + def test_create_project_invitation(self) -> None: + """Test case for create_project_invitation + + Create an invitation for a project + """ + pass + + def test_create_transfer_request(self) -> None: + """Test case for create_transfer_request + + Create a transfer request + """ + pass + + def test_delete_project(self) -> None: + """Test case for delete_project + + Delete the project + """ + pass + + def test_find_ip_reservation_customdata(self) -> None: + """Test case for find_ip_reservation_customdata + + Retrieve the custom metadata of an IP Reservation + """ + pass + + def test_find_project_by_id(self) -> None: + """Test case for find_project_by_id + + Retrieve a project + """ + pass + + def test_find_project_customdata(self) -> None: + """Test case for find_project_customdata + + Retrieve the custom metadata of a project + """ + pass + + def test_find_project_invitations(self) -> None: + """Test case for find_project_invitations + + Retrieve project invitations + """ + pass + + def test_find_project_memberships(self) -> None: + """Test case for find_project_memberships + + Retrieve project memberships + """ + pass + + def test_find_projects(self) -> None: + """Test case for find_projects + + Retrieve all projects + """ + pass + + def test_find_projects_all_pages(self): + """Test case for find_projects_all_pages + + Retrieve all projects # noqa: E501 + """ + pass + + def test_update_project(self) -> None: + """Test case for update_project + + Update the project + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_raid.py b/equinix/services/metalv1/test/test_raid.py new file mode 100644 index 00000000..a3ff6bc7 --- /dev/null +++ b/equinix/services/metalv1/test/test_raid.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.raid import Raid + +class TestRaid(unittest.TestCase): + """Raid unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Raid: + """Test Raid + 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 `Raid` + """ + model = Raid() + if include_optional: + return Raid( + devices = [ + '' + ], + href = '', + level = '', + name = '' + ) + else: + return Raid( + ) + """ + + def testRaid(self): + """Test Raid""" + # 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_recovery_code_list.py b/equinix/services/metalv1/test/test_recovery_code_list.py new file mode 100644 index 00000000..ad6010b9 --- /dev/null +++ b/equinix/services/metalv1/test/test_recovery_code_list.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.recovery_code_list import RecoveryCodeList + +class TestRecoveryCodeList(unittest.TestCase): + """RecoveryCodeList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RecoveryCodeList: + """Test RecoveryCodeList + 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 `RecoveryCodeList` + """ + model = RecoveryCodeList() + if include_optional: + return RecoveryCodeList( + href = '', + recovery_codes = [ + '' + ] + ) + else: + return RecoveryCodeList( + ) + """ + + def testRecoveryCodeList(self): + """Test RecoveryCodeList""" + # 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_request_ip_reservation201_response.py b/equinix/services/metalv1/test/test_request_ip_reservation201_response.py new file mode 100644 index 00000000..b703991a --- /dev/null +++ b/equinix/services/metalv1/test/test_request_ip_reservation201_response.py @@ -0,0 +1,431 @@ +# coding: utf-8 + +""" + Metal API + + 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.request_ip_reservation201_response import RequestIPReservation201Response + +class TestRequestIPReservation201Response(unittest.TestCase): + """RequestIPReservation201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RequestIPReservation201Response: + """Test RequestIPReservation201Response + 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 `RequestIPReservation201Response` + """ + model = RequestIPReservation201Response() + if include_optional: + return RequestIPReservation201Response( + addon = True, + address = '', + address_family = 56, + assignments = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + available = '', + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + enabled = True, + facility = None, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + public = True, + requested_by = equinix.services.metalv1.models.href.Href( + href = '', ), + state = '', + tags = [ + '' + ], + type = 'global_ipv4', + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ) + else: + return RequestIPReservation201Response( + type = 'global_ipv4', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), + ) + """ + + def testRequestIPReservation201Response(self): + """Test RequestIPReservation201Response""" + # 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_request_ip_reservation_request.py b/equinix/services/metalv1/test/test_request_ip_reservation_request.py new file mode 100644 index 00000000..58a42a6f --- /dev/null +++ b/equinix/services/metalv1/test/test_request_ip_reservation_request.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Metal API + + 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.request_ip_reservation_request import RequestIPReservationRequest + +class TestRequestIPReservationRequest(unittest.TestCase): + """RequestIPReservationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RequestIPReservationRequest: + """Test RequestIPReservationRequest + 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 `RequestIPReservationRequest` + """ + model = RequestIPReservationRequest() + if include_optional: + return RequestIPReservationRequest( + comments = '', + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + facility = '', + fail_on_approval_required = True, + href = '', + metro = 'SV', + quantity = 56, + tags = [ + '' + ], + type = 'vrf', + cidr = 22, + network = '10.1.2.0', + vrf_id = '' + ) + else: + return RequestIPReservationRequest( + quantity = 56, + type = 'vrf', + cidr = 22, + network = '10.1.2.0', + vrf_id = '', + ) + """ + + def testRequestIPReservationRequest(self): + """Test RequestIPReservationRequest""" + # 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_self_service_reservation_item_request.py b/equinix/services/metalv1/test/test_self_service_reservation_item_request.py new file mode 100644 index 00000000..875976de --- /dev/null +++ b/equinix/services/metalv1/test/test_self_service_reservation_item_request.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.self_service_reservation_item_request import SelfServiceReservationItemRequest + +class TestSelfServiceReservationItemRequest(unittest.TestCase): + """SelfServiceReservationItemRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfServiceReservationItemRequest: + """Test SelfServiceReservationItemRequest + 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 `SelfServiceReservationItemRequest` + """ + model = SelfServiceReservationItemRequest() + if include_optional: + return SelfServiceReservationItemRequest( + href = '', + metro_id = '', + plan_id = '', + quantity = 56, + term = '' + ) + else: + return SelfServiceReservationItemRequest( + ) + """ + + def testSelfServiceReservationItemRequest(self): + """Test SelfServiceReservationItemRequest""" + # 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_self_service_reservation_item_response.py b/equinix/services/metalv1/test/test_self_service_reservation_item_response.py new file mode 100644 index 00000000..b9029da9 --- /dev/null +++ b/equinix/services/metalv1/test/test_self_service_reservation_item_response.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Metal API + + 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.self_service_reservation_item_response import SelfServiceReservationItemResponse + +class TestSelfServiceReservationItemResponse(unittest.TestCase): + """SelfServiceReservationItemResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfServiceReservationItemResponse: + """Test SelfServiceReservationItemResponse + 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 `SelfServiceReservationItemResponse` + """ + model = SelfServiceReservationItemResponse() + if include_optional: + return SelfServiceReservationItemResponse( + amount = 1.337, + href = '', + id = '', + metro_code = '', + metro_id = '', + metro_name = '', + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + plan_categories = [ + '' + ], + plan_id = '', + plan_name = '', + plan_slug = '', + quantity = 56, + term = '' + ) + else: + return SelfServiceReservationItemResponse( + ) + """ + + def testSelfServiceReservationItemResponse(self): + """Test SelfServiceReservationItemResponse""" + # 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_self_service_reservation_list.py b/equinix/services/metalv1/test/test_self_service_reservation_list.py new file mode 100644 index 00000000..e1235983 --- /dev/null +++ b/equinix/services/metalv1/test/test_self_service_reservation_list.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Metal API + + 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.self_service_reservation_list import SelfServiceReservationList + +class TestSelfServiceReservationList(unittest.TestCase): + """SelfServiceReservationList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfServiceReservationList: + """Test SelfServiceReservationList + 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 `SelfServiceReservationList` + """ + model = SelfServiceReservationList() + if include_optional: + return SelfServiceReservationList( + href = '', + reservations = [ + equinix.services.metalv1.models.self_service_reservation_response.SelfServiceReservationResponse( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + item = [ + equinix.services.metalv1.models.self_service_reservation_item_response.SelfServiceReservationItemResponse( + amount = 1.337, + href = '', + id = '', + metro_code = '', + metro_id = '', + metro_name = '', + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + plan_categories = [ + '' + ], + plan_id = '', + plan_name = '', + plan_slug = '', + quantity = 56, + term = '', ) + ], + notes = '', + organization = '', + organization_id = '', + period = equinix.services.metalv1.models.create_self_service_reservation_request_period.CreateSelfServiceReservationRequest_period( + count = 12, + href = '', + unit = 'monthly', ), + project = '', + project_id = '', + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + status = '', + total_cost = 56, ) + ] + ) + else: + return SelfServiceReservationList( + ) + """ + + def testSelfServiceReservationList(self): + """Test SelfServiceReservationList""" + # 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_self_service_reservation_response.py b/equinix/services/metalv1/test/test_self_service_reservation_response.py new file mode 100644 index 00000000..512c13af --- /dev/null +++ b/equinix/services/metalv1/test/test_self_service_reservation_response.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Metal API + + 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.self_service_reservation_response import SelfServiceReservationResponse + +class TestSelfServiceReservationResponse(unittest.TestCase): + """SelfServiceReservationResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SelfServiceReservationResponse: + """Test SelfServiceReservationResponse + 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 `SelfServiceReservationResponse` + """ + model = SelfServiceReservationResponse() + if include_optional: + return SelfServiceReservationResponse( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + item = [ + equinix.services.metalv1.models.self_service_reservation_item_response.SelfServiceReservationItemResponse( + amount = 1.337, + href = '', + id = '', + metro_code = '', + metro_id = '', + metro_name = '', + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + plan_categories = [ + '' + ], + plan_id = '', + plan_name = '', + plan_slug = '', + quantity = 56, + term = '', ) + ], + notes = '', + organization = '', + organization_id = '', + period = equinix.services.metalv1.models.create_self_service_reservation_request_period.CreateSelfServiceReservationRequest_period( + count = 12, + href = '', + unit = 'monthly', ), + project = '', + project_id = '', + start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + status = '', + total_cost = 56 + ) + else: + return SelfServiceReservationResponse( + ) + """ + + def testSelfServiceReservationResponse(self): + """Test SelfServiceReservationResponse""" + # 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_self_service_reservations_api.py b/equinix/services/metalv1/test/test_self_service_reservations_api.py new file mode 100644 index 00000000..90c21116 --- /dev/null +++ b/equinix/services/metalv1/test/test_self_service_reservations_api.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.self_service_reservations_api import SelfServiceReservationsApi + + +class TestSelfServiceReservationsApi(unittest.TestCase): + """SelfServiceReservationsApi unit test stubs""" + + def setUp(self) -> None: + self.api = SelfServiceReservationsApi() + + def tearDown(self) -> None: + pass + + def test_create_self_service_reservation(self) -> None: + """Test case for create_self_service_reservation + + Create a reservation + """ + pass + + def test_find_self_service_reservation(self) -> None: + """Test case for find_self_service_reservation + + Retrieve a reservation + """ + pass + + def test_find_self_service_reservations(self) -> None: + """Test case for find_self_service_reservations + + Retrieve all reservations + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_server_info.py b/equinix/services/metalv1/test/test_server_info.py new file mode 100644 index 00000000..1651bddc --- /dev/null +++ b/equinix/services/metalv1/test/test_server_info.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.server_info import ServerInfo + +class TestServerInfo(unittest.TestCase): + """ServerInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServerInfo: + """Test ServerInfo + 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 `ServerInfo` + """ + model = ServerInfo() + if include_optional: + return ServerInfo( + facility = '', + href = '', + metro = '', + plan = '', + quantity = '' + ) + else: + return ServerInfo( + ) + """ + + def testServerInfo(self): + """Test ServerInfo""" + # 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_shared_port_vc_vlan_create_input.py b/equinix/services/metalv1/test/test_shared_port_vc_vlan_create_input.py new file mode 100644 index 00000000..cc9c8936 --- /dev/null +++ b/equinix/services/metalv1/test/test_shared_port_vc_vlan_create_input.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Metal API + + 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.shared_port_vc_vlan_create_input import SharedPortVCVlanCreateInput + +class TestSharedPortVCVlanCreateInput(unittest.TestCase): + """SharedPortVCVlanCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SharedPortVCVlanCreateInput: + """Test SharedPortVCVlanCreateInput + 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 `SharedPortVCVlanCreateInput` + """ + model = SharedPortVCVlanCreateInput() + if include_optional: + return SharedPortVCVlanCreateInput( + contact_email = '', + description = '', + href = '', + metro = '', + name = '', + project = '', + speed = '10000000000', + tags = [ + '' + ], + type = 'shared_port_vlan', + vlans = [1000,1001] + ) + else: + return SharedPortVCVlanCreateInput( + metro = '', + name = '', + project = '', + type = 'shared_port_vlan', + vlans = [1000,1001], + ) + """ + + def testSharedPortVCVlanCreateInput(self): + """Test SharedPortVCVlanCreateInput""" + # 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_spot_market_api.py b/equinix/services/metalv1/test/test_spot_market_api.py new file mode 100644 index 00000000..1476be71 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_market_api.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.spot_market_api import SpotMarketApi + + +class TestSpotMarketApi(unittest.TestCase): + """SpotMarketApi unit test stubs""" + + def setUp(self) -> None: + self.api = SpotMarketApi() + + def tearDown(self) -> None: + pass + + def test_create_spot_market_request(self) -> None: + """Test case for create_spot_market_request + + Create a spot market request + """ + pass + + def test_delete_spot_market_request(self) -> None: + """Test case for delete_spot_market_request + + Delete the spot market request + """ + pass + + def test_find_metro_spot_market_prices(self) -> None: + """Test case for find_metro_spot_market_prices + + Get current spot market prices for metros + """ + pass + + def test_find_spot_market_prices(self) -> None: + """Test case for find_spot_market_prices + + Get current spot market prices + """ + pass + + def test_find_spot_market_prices_history(self) -> None: + """Test case for find_spot_market_prices_history + + Get spot market prices for a given period of time + """ + pass + + def test_find_spot_market_request_by_id(self) -> None: + """Test case for find_spot_market_request_by_id + + Retrieve a spot market request + """ + pass + + def test_list_spot_market_requests(self) -> None: + """Test case for list_spot_market_requests + + List spot market requests + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_spot_market_prices_list.py b/equinix/services/metalv1/test/test_spot_market_prices_list.py new file mode 100644 index 00000000..5b0e0226 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_market_prices_list.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_market_prices_list import SpotMarketPricesList + +class TestSpotMarketPricesList(unittest.TestCase): + """SpotMarketPricesList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotMarketPricesList: + """Test SpotMarketPricesList + 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 `SpotMarketPricesList` + """ + model = SpotMarketPricesList() + if include_optional: + return SpotMarketPricesList( + href = '', + spot_market_prices = equinix.services.metalv1.models.spot_prices_report.SpotPricesReport( + ams1 = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + atl1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = , + href = '', ), + dfw1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + href = '', ), + ewr1 = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + href = '', ), + fra1 = , + href = '', + iad1 = , + lax1 = , + nrt1 = , + ord1 = , + sea1 = , + sin1 = , + sjc1 = , + syd1 = , + yyz1 = , ) + ) + else: + return SpotMarketPricesList( + ) + """ + + def testSpotMarketPricesList(self): + """Test SpotMarketPricesList""" + # 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_spot_market_prices_per_metro_list.py b/equinix/services/metalv1/test/test_spot_market_prices_per_metro_list.py new file mode 100644 index 00000000..9deb0300 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_market_prices_per_metro_list.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_market_prices_per_metro_list import SpotMarketPricesPerMetroList + +class TestSpotMarketPricesPerMetroList(unittest.TestCase): + """SpotMarketPricesPerMetroList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotMarketPricesPerMetroList: + """Test SpotMarketPricesPerMetroList + 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 `SpotMarketPricesPerMetroList` + """ + model = SpotMarketPricesPerMetroList() + if include_optional: + return SpotMarketPricesPerMetroList( + href = '', + spot_market_prices = equinix.services.metalv1.models.spot_market_prices_per_metro_report.SpotMarketPricesPerMetroReport( + am = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + ch = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + href = '', ), + da = , + href = '', + la = , + ny = , + sg = , + sv = , ) + ) + else: + return SpotMarketPricesPerMetroList( + ) + """ + + def testSpotMarketPricesPerMetroList(self): + """Test SpotMarketPricesPerMetroList""" + # 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_spot_market_prices_per_metro_report.py b/equinix/services/metalv1/test/test_spot_market_prices_per_metro_report.py new file mode 100644 index 00000000..14c85fab --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_market_prices_per_metro_report.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_market_prices_per_metro_report import SpotMarketPricesPerMetroReport + +class TestSpotMarketPricesPerMetroReport(unittest.TestCase): + """SpotMarketPricesPerMetroReport unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotMarketPricesPerMetroReport: + """Test SpotMarketPricesPerMetroReport + 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 `SpotMarketPricesPerMetroReport` + """ + model = SpotMarketPricesPerMetroReport() + if include_optional: + return SpotMarketPricesPerMetroReport( + am = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + ch = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + da = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + href = '', + la = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + ny = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + sg = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + sv = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ) + ) + else: + return SpotMarketPricesPerMetroReport( + ) + """ + + def testSpotMarketPricesPerMetroReport(self): + """Test SpotMarketPricesPerMetroReport""" + # 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_spot_market_request.py b/equinix/services/metalv1/test/test_spot_market_request.py new file mode 100644 index 00000000..d3b65787 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_market_request.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_market_request import SpotMarketRequest + +class TestSpotMarketRequest(unittest.TestCase): + """SpotMarketRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotMarketRequest: + """Test SpotMarketRequest + 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 `SpotMarketRequest` + """ + model = SpotMarketRequest() + if include_optional: + return SpotMarketRequest( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices_max = 56, + devices_min = 56, + end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + facilities = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + instances = equinix.services.metalv1.models.href.Href( + href = '', ), + max_bid_price = 1.337, + metro = None, + project = equinix.services.metalv1.models.href.Href( + href = '', ) + ) + else: + return SpotMarketRequest( + ) + """ + + def testSpotMarketRequest(self): + """Test SpotMarketRequest""" + # 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_spot_market_request_create_input.py b/equinix/services/metalv1/test/test_spot_market_request_create_input.py new file mode 100644 index 00000000..503ddf0f --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_market_request_create_input.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_market_request_create_input import SpotMarketRequestCreateInput + +class TestSpotMarketRequestCreateInput(unittest.TestCase): + """SpotMarketRequestCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotMarketRequestCreateInput: + """Test SpotMarketRequestCreateInput + 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 `SpotMarketRequestCreateInput` + """ + model = SpotMarketRequestCreateInput() + if include_optional: + return SpotMarketRequestCreateInput( + devices_max = 56, + devices_min = 56, + end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + facilities = [ + '' + ], + href = '', + instance_parameters = equinix.services.metalv1.models.spot_market_request_create_input_instance_parameters.SpotMarketRequestCreateInput_instance_parameters( + always_pxe = True, + billing_cycle = '', + customdata = equinix.services.metalv1.models.customdata.customdata(), + description = '', + features = [ + '' + ], + hostname = '', + hostnames = [ + '' + ], + href = '', + locked = True, + no_ssh_keys = True, + operating_system = '', + plan = '', + private_ipv4_subnet_size = 56, + project_ssh_keys = [ + '' + ], + public_ipv4_subnet_size = 56, + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user_ssh_keys = [ + '' + ], + userdata = '', ), + max_bid_price = 1.337, + metro = '' + ) + else: + return SpotMarketRequestCreateInput( + ) + """ + + def testSpotMarketRequestCreateInput(self): + """Test SpotMarketRequestCreateInput""" + # 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_spot_market_request_create_input_instance_parameters.py b/equinix/services/metalv1/test/test_spot_market_request_create_input_instance_parameters.py new file mode 100644 index 00000000..120063b6 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_market_request_create_input_instance_parameters.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_market_request_create_input_instance_parameters import SpotMarketRequestCreateInputInstanceParameters + +class TestSpotMarketRequestCreateInputInstanceParameters(unittest.TestCase): + """SpotMarketRequestCreateInputInstanceParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotMarketRequestCreateInputInstanceParameters: + """Test SpotMarketRequestCreateInputInstanceParameters + 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 `SpotMarketRequestCreateInputInstanceParameters` + """ + model = SpotMarketRequestCreateInputInstanceParameters() + if include_optional: + return SpotMarketRequestCreateInputInstanceParameters( + always_pxe = True, + billing_cycle = '', + customdata = equinix.services.metalv1.models.customdata.customdata(), + description = '', + features = [ + '' + ], + hostname = '', + hostnames = [ + '' + ], + href = '', + locked = True, + no_ssh_keys = True, + operating_system = '', + plan = '', + private_ipv4_subnet_size = 56, + project_ssh_keys = [ + '' + ], + public_ipv4_subnet_size = 56, + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user_ssh_keys = [ + '' + ], + userdata = '' + ) + else: + return SpotMarketRequestCreateInputInstanceParameters( + ) + """ + + def testSpotMarketRequestCreateInputInstanceParameters(self): + """Test SpotMarketRequestCreateInputInstanceParameters""" + # 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_spot_market_request_list.py b/equinix/services/metalv1/test/test_spot_market_request_list.py new file mode 100644 index 00000000..9a2cb3c4 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_market_request_list.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_market_request_list import SpotMarketRequestList + +class TestSpotMarketRequestList(unittest.TestCase): + """SpotMarketRequestList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotMarketRequestList: + """Test SpotMarketRequestList + 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 `SpotMarketRequestList` + """ + model = SpotMarketRequestList() + if include_optional: + return SpotMarketRequestList( + href = '', + spot_market_requests = [ + equinix.services.metalv1.models.spot_market_request.SpotMarketRequest( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices_max = 56, + devices_min = 56, + end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + facilities = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + instances = equinix.services.metalv1.models.href.Href( + href = '', ), + max_bid_price = 1.337, + metro = null, + project = , ) + ] + ) + else: + return SpotMarketRequestList( + ) + """ + + def testSpotMarketRequestList(self): + """Test SpotMarketRequestList""" + # 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_spot_market_request_metro.py b/equinix/services/metalv1/test/test_spot_market_request_metro.py new file mode 100644 index 00000000..e65f51f9 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_market_request_metro.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_market_request_metro import SpotMarketRequestMetro + +class TestSpotMarketRequestMetro(unittest.TestCase): + """SpotMarketRequestMetro unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotMarketRequestMetro: + """Test SpotMarketRequestMetro + 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 `SpotMarketRequestMetro` + """ + model = SpotMarketRequestMetro() + if include_optional: + return SpotMarketRequestMetro( + code = '', + country = '', + href = '', + id = '', + name = '' + ) + else: + return SpotMarketRequestMetro( + ) + """ + + def testSpotMarketRequestMetro(self): + """Test SpotMarketRequestMetro""" + # 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_spot_prices_datapoints.py b/equinix/services/metalv1/test/test_spot_prices_datapoints.py new file mode 100644 index 00000000..0dff0698 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_prices_datapoints.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_prices_datapoints import SpotPricesDatapoints + +class TestSpotPricesDatapoints(unittest.TestCase): + """SpotPricesDatapoints unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotPricesDatapoints: + """Test SpotPricesDatapoints + 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 `SpotPricesDatapoints` + """ + model = SpotPricesDatapoints() + if include_optional: + return SpotPricesDatapoints( + datapoints = [ + [ + 1.337 + ] + ], + href = '' + ) + else: + return SpotPricesDatapoints( + ) + """ + + def testSpotPricesDatapoints(self): + """Test SpotPricesDatapoints""" + # 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_spot_prices_history_report.py b/equinix/services/metalv1/test/test_spot_prices_history_report.py new file mode 100644 index 00000000..a0faa856 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_prices_history_report.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_prices_history_report import SpotPricesHistoryReport + +class TestSpotPricesHistoryReport(unittest.TestCase): + """SpotPricesHistoryReport unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotPricesHistoryReport: + """Test SpotPricesHistoryReport + 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 `SpotPricesHistoryReport` + """ + model = SpotPricesHistoryReport() + if include_optional: + return SpotPricesHistoryReport( + href = '', + prices_history = equinix.services.metalv1.models.spot_prices_datapoints.SpotPricesDatapoints( + datapoints = [ + [ + 1.337 + ] + ], + href = '', ) + ) + else: + return SpotPricesHistoryReport( + ) + """ + + def testSpotPricesHistoryReport(self): + """Test SpotPricesHistoryReport""" + # 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_spot_prices_per_baremetal.py b/equinix/services/metalv1/test/test_spot_prices_per_baremetal.py new file mode 100644 index 00000000..cff5530a --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_prices_per_baremetal.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_prices_per_baremetal import SpotPricesPerBaremetal + +class TestSpotPricesPerBaremetal(unittest.TestCase): + """SpotPricesPerBaremetal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotPricesPerBaremetal: + """Test SpotPricesPerBaremetal + 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 `SpotPricesPerBaremetal` + """ + model = SpotPricesPerBaremetal() + if include_optional: + return SpotPricesPerBaremetal( + href = '', + price = 1.337 + ) + else: + return SpotPricesPerBaremetal( + ) + """ + + def testSpotPricesPerBaremetal(self): + """Test SpotPricesPerBaremetal""" + # 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_spot_prices_per_facility.py b/equinix/services/metalv1/test/test_spot_prices_per_facility.py new file mode 100644 index 00000000..bb597968 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_prices_per_facility.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_prices_per_facility import SpotPricesPerFacility + +class TestSpotPricesPerFacility(unittest.TestCase): + """SpotPricesPerFacility unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotPricesPerFacility: + """Test SpotPricesPerFacility + 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 `SpotPricesPerFacility` + """ + model = SpotPricesPerFacility() + if include_optional: + return SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2a = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2a2 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_3 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_s = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + c2_medium_x86 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', + m2_xlarge_x86 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ) + ) + else: + return SpotPricesPerFacility( + ) + """ + + def testSpotPricesPerFacility(self): + """Test SpotPricesPerFacility""" + # 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_spot_prices_per_new_facility.py b/equinix/services/metalv1/test/test_spot_prices_per_new_facility.py new file mode 100644 index 00000000..c4a79c2e --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_prices_per_new_facility.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_prices_per_new_facility import SpotPricesPerNewFacility + +class TestSpotPricesPerNewFacility(unittest.TestCase): + """SpotPricesPerNewFacility unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotPricesPerNewFacility: + """Test SpotPricesPerNewFacility + 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 `SpotPricesPerNewFacility` + """ + model = SpotPricesPerNewFacility() + if include_optional: + return SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '' + ) + else: + return SpotPricesPerNewFacility( + ) + """ + + def testSpotPricesPerNewFacility(self): + """Test SpotPricesPerNewFacility""" + # 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_spot_prices_report.py b/equinix/services/metalv1/test/test_spot_prices_report.py new file mode 100644 index 00000000..e9c3fce3 --- /dev/null +++ b/equinix/services/metalv1/test/test_spot_prices_report.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + Metal API + + 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.spot_prices_report import SpotPricesReport + +class TestSpotPricesReport(unittest.TestCase): + """SpotPricesReport unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotPricesReport: + """Test SpotPricesReport + 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 `SpotPricesReport` + """ + model = SpotPricesReport() + if include_optional: + return SpotPricesReport( + ams1 = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + atl1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', ), + dfw1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', ), + ewr1 = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + fra1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', ), + href = '', + iad1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', ), + lax1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', ), + nrt1 = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + ord1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', ), + sea1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', ), + sin1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', ), + sjc1 = equinix.services.metalv1.models.spot_prices_per_facility.SpotPricesPerFacility( + baremetal_0 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_1 = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + baremetal_2 = , + baremetal_2a = , + baremetal_2a2 = , + baremetal_3 = , + baremetal_s = , + c2/medium/x86 = , + href = '', + m2/xlarge/x86 = , ), + syd1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', ), + yyz1 = equinix.services.metalv1.models.spot_prices_per_new_facility.SpotPricesPerNewFacility( + baremetal_1e = equinix.services.metalv1.models.spot_prices_per_baremetal.SpotPricesPerBaremetal( + href = '', + price = 1.337, ), + href = '', ) + ) + else: + return SpotPricesReport( + ) + """ + + def testSpotPricesReport(self): + """Test SpotPricesReport""" + # 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_ssh_key.py b/equinix/services/metalv1/test/test_ssh_key.py new file mode 100644 index 00000000..d41d4206 --- /dev/null +++ b/equinix/services/metalv1/test/test_ssh_key.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Metal API + + 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.ssh_key import SSHKey + +class TestSSHKey(unittest.TestCase): + """SSHKey unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SSHKey: + """Test SSHKey + 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 `SSHKey` + """ + model = SSHKey() + if include_optional: + return SSHKey( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + entity = equinix.services.metalv1.models.href.Href( + href = '', ), + fingerprint = '', + href = '', + id = '', + key = '', + label = '', + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return SSHKey( + ) + """ + + def testSSHKey(self): + """Test SSHKey""" + # 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_ssh_key_create_input.py b/equinix/services/metalv1/test/test_ssh_key_create_input.py new file mode 100644 index 00000000..89488f8f --- /dev/null +++ b/equinix/services/metalv1/test/test_ssh_key_create_input.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.ssh_key_create_input import SSHKeyCreateInput + +class TestSSHKeyCreateInput(unittest.TestCase): + """SSHKeyCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SSHKeyCreateInput: + """Test SSHKeyCreateInput + 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 `SSHKeyCreateInput` + """ + model = SSHKeyCreateInput() + if include_optional: + return SSHKeyCreateInput( + href = '', + instances_ids = [ + '' + ], + key = '', + label = '', + tags = [ + '' + ] + ) + else: + return SSHKeyCreateInput( + ) + """ + + def testSSHKeyCreateInput(self): + """Test SSHKeyCreateInput""" + # 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_ssh_key_input.py b/equinix/services/metalv1/test/test_ssh_key_input.py new file mode 100644 index 00000000..2b9abd0d --- /dev/null +++ b/equinix/services/metalv1/test/test_ssh_key_input.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.ssh_key_input import SSHKeyInput + +class TestSSHKeyInput(unittest.TestCase): + """SSHKeyInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SSHKeyInput: + """Test SSHKeyInput + 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 `SSHKeyInput` + """ + model = SSHKeyInput() + if include_optional: + return SSHKeyInput( + href = '', + key = '', + label = '', + tags = [ + '' + ] + ) + else: + return SSHKeyInput( + ) + """ + + def testSSHKeyInput(self): + """Test SSHKeyInput""" + # 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_ssh_key_list.py b/equinix/services/metalv1/test/test_ssh_key_list.py new file mode 100644 index 00000000..a61618ec --- /dev/null +++ b/equinix/services/metalv1/test/test_ssh_key_list.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Metal API + + 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.ssh_key_list import SSHKeyList + +class TestSSHKeyList(unittest.TestCase): + """SSHKeyList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SSHKeyList: + """Test SSHKeyList + 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 `SSHKeyList` + """ + model = SSHKeyList() + if include_optional: + return SSHKeyList( + href = '', + ssh_keys = [ + equinix.services.metalv1.models.ssh_key.SSHKey( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + entity = equinix.services.metalv1.models.href.Href( + href = '', ), + fingerprint = '', + href = '', + id = '', + key = '', + label = '', + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ] + ) + else: + return SSHKeyList( + ) + """ + + def testSSHKeyList(self): + """Test SSHKeyList""" + # 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_ssh_keys_api.py b/equinix/services/metalv1/test/test_ssh_keys_api.py new file mode 100644 index 00000000..a40f3d0e --- /dev/null +++ b/equinix/services/metalv1/test/test_ssh_keys_api.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.ssh_keys_api import SSHKeysApi + + +class TestSSHKeysApi(unittest.TestCase): + """SSHKeysApi unit test stubs""" + + def setUp(self) -> None: + self.api = SSHKeysApi() + + def tearDown(self) -> None: + pass + + def test_create_project_ssh_key(self) -> None: + """Test case for create_project_ssh_key + + Create a ssh key for the given project + """ + pass + + def test_create_ssh_key(self) -> None: + """Test case for create_ssh_key + + Create a ssh key for the current user + """ + pass + + def test_delete_ssh_key(self) -> None: + """Test case for delete_ssh_key + + Delete the ssh key + """ + pass + + def test_find_device_ssh_keys(self) -> None: + """Test case for find_device_ssh_keys + + Retrieve a device's ssh keys + """ + pass + + def test_find_project_ssh_keys(self) -> None: + """Test case for find_project_ssh_keys + + Retrieve a project's ssh keys + """ + pass + + def test_find_ssh_key_by_id(self) -> None: + """Test case for find_ssh_key_by_id + + Retrieve a ssh key + """ + pass + + def test_find_ssh_keys(self) -> None: + """Test case for find_ssh_keys + + Retrieve all ssh keys + """ + pass + + def test_update_ssh_key(self) -> None: + """Test case for update_ssh_key + + Update the ssh key + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_storage.py b/equinix/services/metalv1/test/test_storage.py new file mode 100644 index 00000000..9715da51 --- /dev/null +++ b/equinix/services/metalv1/test/test_storage.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Metal API + + 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.storage import Storage + +class TestStorage(unittest.TestCase): + """Storage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Storage: + """Test Storage + 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 `Storage` + """ + model = Storage() + if include_optional: + return Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + device = '', + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + device = '', + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + devices = [ + '' + ], + href = '', + level = '', + name = '', ) + ] + ) + else: + return Storage( + ) + """ + + def testStorage(self): + """Test Storage""" + # 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_support_request_api.py b/equinix/services/metalv1/test/test_support_request_api.py new file mode 100644 index 00000000..cdf991b9 --- /dev/null +++ b/equinix/services/metalv1/test/test_support_request_api.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.support_request_api import SupportRequestApi + + +class TestSupportRequestApi(unittest.TestCase): + """SupportRequestApi unit test stubs""" + + def setUp(self) -> None: + self.api = SupportRequestApi() + + def tearDown(self) -> None: + pass + + def test_request_support(self) -> None: + """Test case for request_support + + Create a support ticket + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_support_request_input.py b/equinix/services/metalv1/test/test_support_request_input.py new file mode 100644 index 00000000..329db020 --- /dev/null +++ b/equinix/services/metalv1/test/test_support_request_input.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.support_request_input import SupportRequestInput + +class TestSupportRequestInput(unittest.TestCase): + """SupportRequestInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SupportRequestInput: + """Test SupportRequestInput + 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 `SupportRequestInput` + """ + model = SupportRequestInput() + if include_optional: + return SupportRequestInput( + device_id = '', + href = '', + message = '', + priority = 'urgent', + project_id = '', + subject = '' + ) + else: + return SupportRequestInput( + message = '', + subject = '', + ) + """ + + def testSupportRequestInput(self): + """Test SupportRequestInput""" + # 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_transfer_request.py b/equinix/services/metalv1/test/test_transfer_request.py new file mode 100644 index 00000000..e43bbea0 --- /dev/null +++ b/equinix/services/metalv1/test/test_transfer_request.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.transfer_request import TransferRequest + +class TestTransferRequest(unittest.TestCase): + """TransferRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TransferRequest: + """Test TransferRequest + 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 `TransferRequest` + """ + model = TransferRequest() + if include_optional: + return TransferRequest( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + target_organization = equinix.services.metalv1.models.href.Href( + href = '', ), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return TransferRequest( + ) + """ + + def testTransferRequest(self): + """Test TransferRequest""" + # 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_transfer_request_input.py b/equinix/services/metalv1/test/test_transfer_request_input.py new file mode 100644 index 00000000..1818bd62 --- /dev/null +++ b/equinix/services/metalv1/test/test_transfer_request_input.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.transfer_request_input import TransferRequestInput + +class TestTransferRequestInput(unittest.TestCase): + """TransferRequestInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TransferRequestInput: + """Test TransferRequestInput + 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 `TransferRequestInput` + """ + model = TransferRequestInput() + if include_optional: + return TransferRequestInput( + href = '', + target_organization_id = '' + ) + else: + return TransferRequestInput( + ) + """ + + def testTransferRequestInput(self): + """Test TransferRequestInput""" + # 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_transfer_request_list.py b/equinix/services/metalv1/test/test_transfer_request_list.py new file mode 100644 index 00000000..cf3ad73f --- /dev/null +++ b/equinix/services/metalv1/test/test_transfer_request_list.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Metal API + + 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.transfer_request_list import TransferRequestList + +class TestTransferRequestList(unittest.TestCase): + """TransferRequestList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TransferRequestList: + """Test TransferRequestList + 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 `TransferRequestList` + """ + model = TransferRequestList() + if include_optional: + return TransferRequestList( + href = '', + transfers = [ + equinix.services.metalv1.models.transfer_request.TransferRequest( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + project = equinix.services.metalv1.models.href.Href( + href = '', ), + target_organization = equinix.services.metalv1.models.href.Href( + href = '', ), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ] + ) + else: + return TransferRequestList( + ) + """ + + def testTransferRequestList(self): + """Test TransferRequestList""" + # 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_transfer_requests_api.py b/equinix/services/metalv1/test/test_transfer_requests_api.py new file mode 100644 index 00000000..dcda22b8 --- /dev/null +++ b/equinix/services/metalv1/test/test_transfer_requests_api.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.transfer_requests_api import TransferRequestsApi + + +class TestTransferRequestsApi(unittest.TestCase): + """TransferRequestsApi unit test stubs""" + + def setUp(self) -> None: + self.api = TransferRequestsApi() + + def tearDown(self) -> None: + pass + + def test_accept_transfer_request(self) -> None: + """Test case for accept_transfer_request + + Accept a transfer request + """ + pass + + def test_decline_transfer_request(self) -> None: + """Test case for decline_transfer_request + + Decline a transfer request + """ + pass + + def test_find_transfer_request_by_id(self) -> None: + """Test case for find_transfer_request_by_id + + View a transfer request + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_two_factor_auth_api.py b/equinix/services/metalv1/test/test_two_factor_auth_api.py new file mode 100644 index 00000000..801a01aa --- /dev/null +++ b/equinix/services/metalv1/test/test_two_factor_auth_api.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.two_factor_auth_api import TwoFactorAuthApi + + +class TestTwoFactorAuthApi(unittest.TestCase): + """TwoFactorAuthApi unit test stubs""" + + def setUp(self) -> None: + self.api = TwoFactorAuthApi() + + def tearDown(self) -> None: + pass + + def test_disable_tfa_app(self) -> None: + """Test case for disable_tfa_app + + Disable two factor authentication + """ + pass + + def test_disable_tfa_sms(self) -> None: + """Test case for disable_tfa_sms + + Disable two factor authentication + """ + pass + + def test_enable_tfa_app(self) -> None: + """Test case for enable_tfa_app + + Enable two factor auth using app + """ + pass + + def test_enable_tfa_sms(self) -> None: + """Test case for enable_tfa_sms + + Enable two factor auth using sms + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_update_email_input.py b/equinix/services/metalv1/test/test_update_email_input.py new file mode 100644 index 00000000..133e2296 --- /dev/null +++ b/equinix/services/metalv1/test/test_update_email_input.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.update_email_input import UpdateEmailInput + +class TestUpdateEmailInput(unittest.TestCase): + """UpdateEmailInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateEmailInput: + """Test UpdateEmailInput + 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 `UpdateEmailInput` + """ + model = UpdateEmailInput() + if include_optional: + return UpdateEmailInput( + default = True, + href = '' + ) + else: + return UpdateEmailInput( + ) + """ + + def testUpdateEmailInput(self): + """Test UpdateEmailInput""" + # 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_usages_api.py b/equinix/services/metalv1/test/test_usages_api.py new file mode 100644 index 00000000..2ba495f4 --- /dev/null +++ b/equinix/services/metalv1/test/test_usages_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.usages_api import UsagesApi + + +class TestUsagesApi(unittest.TestCase): + """UsagesApi unit test stubs""" + + def setUp(self) -> None: + self.api = UsagesApi() + + def tearDown(self) -> None: + pass + + def test_find_device_usages(self) -> None: + """Test case for find_device_usages + + Retrieve all usages for device + """ + pass + + def test_find_project_usage(self) -> None: + """Test case for find_project_usage + + Retrieve all usages for project + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_user.py b/equinix/services/metalv1/test/test_user.py new file mode 100644 index 00000000..fa2ba8ad --- /dev/null +++ b/equinix/services/metalv1/test/test_user.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Metal API + + 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.user import User + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> User: + """Test User + 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 `User` + """ + model = User() + if include_optional: + return User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return User( + ) + """ + + def testUser(self): + """Test User""" + # 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_user_create_input.py b/equinix/services/metalv1/test/test_user_create_input.py new file mode 100644 index 00000000..eb26179d --- /dev/null +++ b/equinix/services/metalv1/test/test_user_create_input.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Metal API + + 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.user_create_input import UserCreateInput + +class TestUserCreateInput(unittest.TestCase): + """UserCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserCreateInput: + """Test UserCreateInput + 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 `UserCreateInput` + """ + model = UserCreateInput() + if include_optional: + return UserCreateInput( + company_name = '', + company_url = '', + customdata = None, + emails = [ + equinix.services.metalv1.models.email_input.EmailInput( + address = '', + default = True, + href = '', ) + ], + first_name = '', + href = '', + invitation_id = '', + last_name = '', + level = '', + nonce = '', + password = '', + phone_number = '', + social_accounts = None, + timezone = '', + title = '', + two_factor_auth = '', + verified_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return UserCreateInput( + emails = [ + equinix.services.metalv1.models.email_input.EmailInput( + address = '', + default = True, + href = '', ) + ], + first_name = '', + last_name = '', + ) + """ + + def testUserCreateInput(self): + """Test UserCreateInput""" + # 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_user_limited.py b/equinix/services/metalv1/test/test_user_limited.py new file mode 100644 index 00000000..ddfb82f9 --- /dev/null +++ b/equinix/services/metalv1/test/test_user_limited.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.user_limited import UserLimited + +class TestUserLimited(unittest.TestCase): + """UserLimited unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserLimited: + """Test UserLimited + 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 `UserLimited` + """ + model = UserLimited() + if include_optional: + return UserLimited( + avatar_thumb_url = '', + avatar_url = '', + full_name = '', + href = '', + id = '' + ) + else: + return UserLimited( + id = '', + ) + """ + + def testUserLimited(self): + """Test UserLimited""" + # 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_user_list.py b/equinix/services/metalv1/test/test_user_list.py new file mode 100644 index 00000000..8ad128fb --- /dev/null +++ b/equinix/services/metalv1/test/test_user_list.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Metal API + + 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.user_list import UserList + +class TestUserList(unittest.TestCase): + """UserList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserList: + """Test UserList + 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 `UserList` + """ + model = UserList() + if include_optional: + return UserList( + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ), + users = [ + equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ) + ] + ) + else: + return UserList( + ) + """ + + def testUserList(self): + """Test UserList""" + # 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_user_lite.py b/equinix/services/metalv1/test/test_user_lite.py new file mode 100644 index 00000000..5459d64a --- /dev/null +++ b/equinix/services/metalv1/test/test_user_lite.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Metal API + + 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.user_lite import UserLite + +class TestUserLite(unittest.TestCase): + """UserLite unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserLite: + """Test UserLite + 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 `UserLite` + """ + model = UserLite() + if include_optional: + return UserLite( + avatar_thumb_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + email = '', + first_name = '', + full_name = '', + href = '', + id = '', + last_name = '', + short_id = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return UserLite( + id = '', + short_id = '', + ) + """ + + def testUserLite(self): + """Test UserLite""" + # 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_user_update_input.py b/equinix/services/metalv1/test/test_user_update_input.py new file mode 100644 index 00000000..baebbf3b --- /dev/null +++ b/equinix/services/metalv1/test/test_user_update_input.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Metal API + + 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.user_update_input import UserUpdateInput + +class TestUserUpdateInput(unittest.TestCase): + """UserUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserUpdateInput: + """Test UserUpdateInput + 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 `UserUpdateInput` + """ + model = UserUpdateInput() + if include_optional: + return UserUpdateInput( + customdata = None, + first_name = '', + href = '', + last_name = '', + password = '', + phone_number = '', + timezone = '' + ) + else: + return UserUpdateInput( + ) + """ + + def testUserUpdateInput(self): + """Test UserUpdateInput""" + # 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_user_verification_tokens_api.py b/equinix/services/metalv1/test/test_user_verification_tokens_api.py new file mode 100644 index 00000000..c3c5db3c --- /dev/null +++ b/equinix/services/metalv1/test/test_user_verification_tokens_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.user_verification_tokens_api import UserVerificationTokensApi + + +class TestUserVerificationTokensApi(unittest.TestCase): + """UserVerificationTokensApi unit test stubs""" + + def setUp(self) -> None: + self.api = UserVerificationTokensApi() + + def tearDown(self) -> None: + pass + + def test_consume_verification_request(self) -> None: + """Test case for consume_verification_request + + Verify a user using an email verification token + """ + pass + + def test_create_validation_request(self) -> None: + """Test case for create_validation_request + + Create an email verification request + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_userdata.py b/equinix/services/metalv1/test/test_userdata.py new file mode 100644 index 00000000..e326fdc6 --- /dev/null +++ b/equinix/services/metalv1/test/test_userdata.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + Metal API + + 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.userdata import Userdata + +class TestUserdata(unittest.TestCase): + """Userdata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Userdata: + """Test Userdata + 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 `Userdata` + """ + model = Userdata() + if include_optional: + return Userdata( + href = '', + userdata = '' + ) + else: + return Userdata( + ) + """ + + def testUserdata(self): + """Test Userdata""" + # 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_userdata_api.py b/equinix/services/metalv1/test/test_userdata_api.py new file mode 100644 index 00000000..8ffa6ccf --- /dev/null +++ b/equinix/services/metalv1/test/test_userdata_api.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.userdata_api import UserdataApi + + +class TestUserdataApi(unittest.TestCase): + """UserdataApi unit test stubs""" + + def setUp(self) -> None: + self.api = UserdataApi() + + def tearDown(self) -> None: + pass + + def test_validate_userdata(self) -> None: + """Test case for validate_userdata + + Validate user data + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_users_api.py b/equinix/services/metalv1/test/test_users_api.py new file mode 100644 index 00000000..a8ca3446 --- /dev/null +++ b/equinix/services/metalv1/test/test_users_api.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.users_api import UsersApi + + +class TestUsersApi(unittest.TestCase): + """UsersApi unit test stubs""" + + def setUp(self) -> None: + self.api = UsersApi() + + def tearDown(self) -> None: + pass + + def test_create_user(self) -> None: + """Test case for create_user + + Create a user + """ + pass + + def test_find_current_user(self) -> None: + """Test case for find_current_user + + Retrieve the current user + """ + pass + + def test_find_invitations(self) -> None: + """Test case for find_invitations + + Retrieve current user invitations + """ + pass + + def test_find_user_by_id(self) -> None: + """Test case for find_user_by_id + + Retrieve a user + """ + pass + + def test_find_user_customdata(self) -> None: + """Test case for find_user_customdata + + Retrieve the custom metadata of a user + """ + pass + + def test_find_users(self) -> None: + """Test case for find_users + + Retrieve all users + """ + pass + + def test_find_users_all_pages(self): + """Test case for find_users_all_pages + + Retrieve all users # noqa: E501 + """ + pass + + def test_update_current_user(self) -> None: + """Test case for update_current_user + + Update the current user + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_verify_email.py b/equinix/services/metalv1/test/test_verify_email.py new file mode 100644 index 00000000..df81e597 --- /dev/null +++ b/equinix/services/metalv1/test/test_verify_email.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.verify_email import VerifyEmail + +class TestVerifyEmail(unittest.TestCase): + """VerifyEmail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VerifyEmail: + """Test VerifyEmail + 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 `VerifyEmail` + """ + model = VerifyEmail() + if include_optional: + return VerifyEmail( + href = '', + user_token = '' + ) + else: + return VerifyEmail( + user_token = '', + ) + """ + + def testVerifyEmail(self): + """Test VerifyEmail""" + # 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_virtual_circuit.py b/equinix/services/metalv1/test/test_virtual_circuit.py new file mode 100644 index 00000000..a76030b0 --- /dev/null +++ b/equinix/services/metalv1/test/test_virtual_circuit.py @@ -0,0 +1,386 @@ +# coding: utf-8 + +""" + Metal API + + 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.virtual_circuit import VirtualCircuit + +class TestVirtualCircuit(unittest.TestCase): + """VirtualCircuit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VirtualCircuit: + """Test VirtualCircuit + 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 `VirtualCircuit` + """ + model = VirtualCircuit() + if include_optional: + return VirtualCircuit( + bill = True, + bill_type = 'metal_billed', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + name = '', + nni_vlan = 56, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', + virtual_circuits = [ + null + ], ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + provider_connection_id = 'dxcon-fggxx63k', + speed = 56, + status = 'pending', + tags = [ + '' + ], + type = 'vlan', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.href.Href( + href = '', ), + vnid = 56, + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + peer_asn = 65000, + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ) + else: + return VirtualCircuit( + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), + ) + """ + + def testVirtualCircuit(self): + """Test VirtualCircuit""" + # 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_virtual_circuit_create_input.py b/equinix/services/metalv1/test/test_virtual_circuit_create_input.py new file mode 100644 index 00000000..066308ea --- /dev/null +++ b/equinix/services/metalv1/test/test_virtual_circuit_create_input.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Metal API + + 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.virtual_circuit_create_input import VirtualCircuitCreateInput + +class TestVirtualCircuitCreateInput(unittest.TestCase): + """VirtualCircuitCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VirtualCircuitCreateInput: + """Test VirtualCircuitCreateInput + 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 `VirtualCircuitCreateInput` + """ + model = VirtualCircuitCreateInput() + if include_optional: + return VirtualCircuitCreateInput( + description = '', + href = '', + name = '', + nni_vlan = 2, + project_id = '', + speed = '', + tags = [ + '' + ], + vnid = '', + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + md5 = 'jUR,rZ#UM/?R,Fp^l6$ARjeJk C>i H'qT\\{ VirtualCircuitList: + """Test VirtualCircuitList + 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 `VirtualCircuitList` + """ + model = VirtualCircuitList() + if include_optional: + return VirtualCircuitList( + href = '', + virtual_circuits = [ + null + ] + ) + else: + return VirtualCircuitList( + ) + """ + + def testVirtualCircuitList(self): + """Test VirtualCircuitList""" + # 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_virtual_circuit_update_input.py b/equinix/services/metalv1/test/test_virtual_circuit_update_input.py new file mode 100644 index 00000000..b4218341 --- /dev/null +++ b/equinix/services/metalv1/test/test_virtual_circuit_update_input.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Metal API + + 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.virtual_circuit_update_input import VirtualCircuitUpdateInput + +class TestVirtualCircuitUpdateInput(unittest.TestCase): + """VirtualCircuitUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VirtualCircuitUpdateInput: + """Test VirtualCircuitUpdateInput + 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 `VirtualCircuitUpdateInput` + """ + model = VirtualCircuitUpdateInput() + if include_optional: + return VirtualCircuitUpdateInput( + description = '', + href = '', + name = '', + speed = '', + tags = [ + '' + ], + vnid = '', + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + md5 = 'jUR,rZ#UM/?R,Fp^l6$ARjeJk C>i H'qT\\{ VirtualNetwork: + """Test VirtualNetwork + 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 `VirtualNetwork` + """ + model = VirtualNetwork() + if include_optional: + return VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + facility = equinix.services.metalv1.models.facility.Facility( + address = equinix.services.metalv1.models.address.Address( + address2 = '', + city = '', + coordinates = equinix.services.metalv1.models.coordinates.Coordinates( + href = '', + latitude = '', + longitude = '', ), + country = '', + href = '', + state = '', + zip_code = '', ), + code = '', + features = ["baremetal","backend_transfer","global_ipv4"], + href = '', + id = '', + ip_ranges = ["2604:1380::/36","147.75.192.0/21"], + metro = null, + name = '', ), + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address_family = 56, + assigned_to = equinix.services.metalv1.models.href.Href( + href = '', ), + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metro_code = '', + vxlan = 56, ) + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + ssh_keys = [ + + ], + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + tags = [ + '' + ], + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', + volumes = [ + + ], ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + ssh_keys = , + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + tags = , + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', + volumes = , ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56 + ) + else: + return VirtualNetwork( + ) + """ + + def testVirtualNetwork(self): + """Test VirtualNetwork""" + # 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_virtual_network_create_input.py b/equinix/services/metalv1/test/test_virtual_network_create_input.py new file mode 100644 index 00000000..fd02bbc3 --- /dev/null +++ b/equinix/services/metalv1/test/test_virtual_network_create_input.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.virtual_network_create_input import VirtualNetworkCreateInput + +class TestVirtualNetworkCreateInput(unittest.TestCase): + """VirtualNetworkCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VirtualNetworkCreateInput: + """Test VirtualNetworkCreateInput + 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 `VirtualNetworkCreateInput` + """ + model = VirtualNetworkCreateInput() + if include_optional: + return VirtualNetworkCreateInput( + description = '', + facility = '', + href = '', + metro = '', + tags = [ + '' + ], + vxlan = 1099 + ) + else: + return VirtualNetworkCreateInput( + ) + """ + + def testVirtualNetworkCreateInput(self): + """Test VirtualNetworkCreateInput""" + # 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_virtual_network_list.py b/equinix/services/metalv1/test/test_virtual_network_list.py new file mode 100644 index 00000000..5db83525 --- /dev/null +++ b/equinix/services/metalv1/test/test_virtual_network_list.py @@ -0,0 +1,474 @@ +# coding: utf-8 + +""" + Metal API + + 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.virtual_network_list import VirtualNetworkList + +class TestVirtualNetworkList(unittest.TestCase): + """VirtualNetworkList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VirtualNetworkList: + """Test VirtualNetworkList + 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 `VirtualNetworkList` + """ + model = VirtualNetworkList() + if include_optional: + return VirtualNetworkList( + href = '', + virtual_networks = [ + equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ) + ] + ) + else: + return VirtualNetworkList( + ) + """ + + def testVirtualNetworkList(self): + """Test VirtualNetworkList""" + # 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_virtual_network_update_input.py b/equinix/services/metalv1/test/test_virtual_network_update_input.py new file mode 100644 index 00000000..382108ff --- /dev/null +++ b/equinix/services/metalv1/test/test_virtual_network_update_input.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.virtual_network_update_input import VirtualNetworkUpdateInput + +class TestVirtualNetworkUpdateInput(unittest.TestCase): + """VirtualNetworkUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VirtualNetworkUpdateInput: + """Test VirtualNetworkUpdateInput + 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 `VirtualNetworkUpdateInput` + """ + model = VirtualNetworkUpdateInput() + if include_optional: + return VirtualNetworkUpdateInput( + description = '', + href = '', + tags = [ + '' + ] + ) + else: + return VirtualNetworkUpdateInput( + ) + """ + + def testVirtualNetworkUpdateInput(self): + """Test VirtualNetworkUpdateInput""" + # 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_vlan_csp_connection_create_input.py b/equinix/services/metalv1/test/test_vlan_csp_connection_create_input.py new file mode 100644 index 00000000..e317fdb5 --- /dev/null +++ b/equinix/services/metalv1/test/test_vlan_csp_connection_create_input.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Metal API + + 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.vlan_csp_connection_create_input import VlanCSPConnectionCreateInput + +class TestVlanCSPConnectionCreateInput(unittest.TestCase): + """VlanCSPConnectionCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VlanCSPConnectionCreateInput: + """Test VlanCSPConnectionCreateInput + 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 `VlanCSPConnectionCreateInput` + """ + model = VlanCSPConnectionCreateInput() + if include_optional: + return VlanCSPConnectionCreateInput( + contact_email = '', + description = '', + fabric_provider = None, + href = '', + metro = '', + name = '', + project = '', + speed = '10000000000', + tags = [ + '' + ], + type = 'shared_port_vlan_to_csp', + vlans = [1000,1001] + ) + else: + return VlanCSPConnectionCreateInput( + fabric_provider = None, + metro = '', + name = '', + project = '', + type = 'shared_port_vlan_to_csp', + vlans = [1000,1001], + ) + """ + + def testVlanCSPConnectionCreateInput(self): + """Test VlanCSPConnectionCreateInput""" + # 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_vlan_csp_connection_create_input_fabric_provider.py b/equinix/services/metalv1/test/test_vlan_csp_connection_create_input_fabric_provider.py new file mode 100644 index 00000000..4686e252 --- /dev/null +++ b/equinix/services/metalv1/test/test_vlan_csp_connection_create_input_fabric_provider.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.vlan_csp_connection_create_input_fabric_provider import VlanCSPConnectionCreateInputFabricProvider + +class TestVlanCSPConnectionCreateInputFabricProvider(unittest.TestCase): + """VlanCSPConnectionCreateInputFabricProvider unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VlanCSPConnectionCreateInputFabricProvider: + """Test VlanCSPConnectionCreateInputFabricProvider + 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 `VlanCSPConnectionCreateInputFabricProvider` + """ + model = VlanCSPConnectionCreateInputFabricProvider() + if include_optional: + return VlanCSPConnectionCreateInputFabricProvider( + account_id = '123412341234', + href = '', + location = 'us-west-1', + type = 'CSP_AWS' + ) + else: + return VlanCSPConnectionCreateInputFabricProvider( + account_id = '123412341234', + type = 'CSP_AWS', + ) + """ + + def testVlanCSPConnectionCreateInputFabricProvider(self): + """Test VlanCSPConnectionCreateInputFabricProvider""" + # 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_vlan_fabric_vc_create_input.py b/equinix/services/metalv1/test/test_vlan_fabric_vc_create_input.py new file mode 100644 index 00000000..4a554a05 --- /dev/null +++ b/equinix/services/metalv1/test/test_vlan_fabric_vc_create_input.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Metal API + + 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.vlan_fabric_vc_create_input import VlanFabricVcCreateInput + +class TestVlanFabricVcCreateInput(unittest.TestCase): + """VlanFabricVcCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VlanFabricVcCreateInput: + """Test VlanFabricVcCreateInput + 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 `VlanFabricVcCreateInput` + """ + model = VlanFabricVcCreateInput() + if include_optional: + return VlanFabricVcCreateInput( + contact_email = '', + description = '', + facility_id = '', + href = '', + metro = '', + name = '', + project = '', + redundancy = '', + service_token_type = 'a_side', + speed = '10000000000', + tags = [ + '' + ], + type = 'shared', + vlans = [1000,1001] + ) + else: + return VlanFabricVcCreateInput( + metro = '', + name = '', + redundancy = '', + service_token_type = 'a_side', + type = 'shared', + vlans = [1000,1001], + ) + """ + + def testVlanFabricVcCreateInput(self): + """Test VlanFabricVcCreateInput""" + # 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_vlan_virtual_circuit.py b/equinix/services/metalv1/test/test_vlan_virtual_circuit.py new file mode 100644 index 00000000..f4582710 --- /dev/null +++ b/equinix/services/metalv1/test/test_vlan_virtual_circuit.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Metal API + + 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.vlan_virtual_circuit import VlanVirtualCircuit + +class TestVlanVirtualCircuit(unittest.TestCase): + """VlanVirtualCircuit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VlanVirtualCircuit: + """Test VlanVirtualCircuit + 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 `VlanVirtualCircuit` + """ + model = VlanVirtualCircuit() + if include_optional: + return VlanVirtualCircuit( + bill = True, + bill_type = 'metal_billed', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + name = '', + nni_vlan = 56, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', + virtual_circuits = [ + null + ], ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + provider_connection_id = 'dxcon-fggxx63k', + speed = 56, + status = 'pending', + tags = [ + '' + ], + type = 'vlan', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.href.Href( + href = '', ), + vnid = 56 + ) + else: + return VlanVirtualCircuit( + ) + """ + + def testVlanVirtualCircuit(self): + """Test VlanVirtualCircuit""" + # 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_vlan_virtual_circuit_create_input.py b/equinix/services/metalv1/test/test_vlan_virtual_circuit_create_input.py new file mode 100644 index 00000000..eed09f12 --- /dev/null +++ b/equinix/services/metalv1/test/test_vlan_virtual_circuit_create_input.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Metal API + + 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.vlan_virtual_circuit_create_input import VlanVirtualCircuitCreateInput + +class TestVlanVirtualCircuitCreateInput(unittest.TestCase): + """VlanVirtualCircuitCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VlanVirtualCircuitCreateInput: + """Test VlanVirtualCircuitCreateInput + 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 `VlanVirtualCircuitCreateInput` + """ + model = VlanVirtualCircuitCreateInput() + if include_optional: + return VlanVirtualCircuitCreateInput( + description = '', + href = '', + name = '', + nni_vlan = 2, + project_id = '', + speed = '', + tags = [ + '' + ], + vnid = '' + ) + else: + return VlanVirtualCircuitCreateInput( + project_id = '', + ) + """ + + def testVlanVirtualCircuitCreateInput(self): + """Test VlanVirtualCircuitCreateInput""" + # 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_vlan_virtual_circuit_update_input.py b/equinix/services/metalv1/test/test_vlan_virtual_circuit_update_input.py new file mode 100644 index 00000000..4c53fa49 --- /dev/null +++ b/equinix/services/metalv1/test/test_vlan_virtual_circuit_update_input.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.vlan_virtual_circuit_update_input import VlanVirtualCircuitUpdateInput + +class TestVlanVirtualCircuitUpdateInput(unittest.TestCase): + """VlanVirtualCircuitUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VlanVirtualCircuitUpdateInput: + """Test VlanVirtualCircuitUpdateInput + 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 `VlanVirtualCircuitUpdateInput` + """ + model = VlanVirtualCircuitUpdateInput() + if include_optional: + return VlanVirtualCircuitUpdateInput( + description = '', + href = '', + name = '', + speed = '', + tags = [ + '' + ], + vnid = '' + ) + else: + return VlanVirtualCircuitUpdateInput( + ) + """ + + def testVlanVirtualCircuitUpdateInput(self): + """Test VlanVirtualCircuitUpdateInput""" + # 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_vlans_api.py b/equinix/services/metalv1/test/test_vlans_api.py new file mode 100644 index 00000000..122948fe --- /dev/null +++ b/equinix/services/metalv1/test/test_vlans_api.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Metal API + + 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.api.vlans_api import VLANsApi + + +class TestVLANsApi(unittest.TestCase): + """VLANsApi unit test stubs""" + + def setUp(self) -> None: + self.api = VLANsApi() + + def tearDown(self) -> None: + pass + + def test_create_virtual_network(self) -> None: + """Test case for create_virtual_network + + Create a virtual network + """ + pass + + def test_delete_virtual_network(self) -> None: + """Test case for delete_virtual_network + + Delete a virtual network + """ + pass + + def test_find_virtual_networks(self) -> None: + """Test case for find_virtual_networks + + Retrieve all virtual networks + """ + pass + + def test_get_virtual_network(self) -> None: + """Test case for get_virtual_network + + Get a virtual network + """ + pass + + def test_update_virtual_network(self) -> None: + """Test case for update_virtual_network + + Updates the virtual network + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1/test/test_vrf.py b/equinix/services/metalv1/test/test_vrf.py new file mode 100644 index 00000000..836150a9 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf.py @@ -0,0 +1,253 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf import Vrf + +class TestVrf(unittest.TestCase): + """Vrf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Vrf: + """Test Vrf + 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 `Vrf` + """ + model = Vrf() + if include_optional: + return Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + tags = [ + '' + ], + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ] + ) + else: + return Vrf( + ) + """ + + def testVrf(self): + """Test Vrf""" + # 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_vrf_bgp_neighbors.py b/equinix/services/metalv1/test/test_vrf_bgp_neighbors.py new file mode 100644 index 00000000..7dbfcf09 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_bgp_neighbors.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_bgp_neighbors import VrfBGPNeighbors + +class TestVrfBGPNeighbors(unittest.TestCase): + """VrfBGPNeighbors unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfBGPNeighbors: + """Test VrfBGPNeighbors + 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 `VrfBGPNeighbors` + """ + model = VrfBGPNeighbors() + if include_optional: + return VrfBGPNeighbors( + href = '', + peer_as = 65000, + peer_ip = '8.8.8.8', + state = 'up' + ) + else: + return VrfBGPNeighbors( + ) + """ + + def testVrfBGPNeighbors(self): + """Test VrfBGPNeighbors""" + # 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_vrf_bgp_neighbors_list.py b/equinix/services/metalv1/test/test_vrf_bgp_neighbors_list.py new file mode 100644 index 00000000..7adc67a2 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_bgp_neighbors_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_bgp_neighbors_list import VrfBGPNeighborsList + +class TestVrfBGPNeighborsList(unittest.TestCase): + """VrfBGPNeighborsList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfBGPNeighborsList: + """Test VrfBGPNeighborsList + 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 `VrfBGPNeighborsList` + """ + model = VrfBGPNeighborsList() + if include_optional: + return VrfBGPNeighborsList( + bgp_neighbors = [ + equinix.services.metalv1.models.vrf_bgp_neighbors.VrfBGPNeighbors( + href = '', + peer_as = 65000, + peer_ip = '8.8.8.8', + state = 'up', ) + ], + href = '' + ) + else: + return VrfBGPNeighborsList( + ) + """ + + def testVrfBGPNeighborsList(self): + """Test VrfBGPNeighborsList""" + # 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_vrf_create_input.py b/equinix/services/metalv1/test/test_vrf_create_input.py new file mode 100644 index 00000000..c5320d3a --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_create_input.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_create_input import VrfCreateInput + +class TestVrfCreateInput(unittest.TestCase): + """VrfCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfCreateInput: + """Test VrfCreateInput + 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 `VrfCreateInput` + """ + model = VrfCreateInput() + if include_optional: + return VrfCreateInput( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + description = '', + href = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = '', + name = '', + tags = [ + '' + ] + ) + else: + return VrfCreateInput( + metro = '', + name = '', + ) + """ + + def testVrfCreateInput(self): + """Test VrfCreateInput""" + # 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_vrf_fabric_vc_create_input.py b/equinix/services/metalv1/test/test_vrf_fabric_vc_create_input.py new file mode 100644 index 00000000..41aa5472 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_fabric_vc_create_input.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_fabric_vc_create_input import VrfFabricVcCreateInput + +class TestVrfFabricVcCreateInput(unittest.TestCase): + """VrfFabricVcCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfFabricVcCreateInput: + """Test VrfFabricVcCreateInput + 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 `VrfFabricVcCreateInput` + """ + model = VrfFabricVcCreateInput() + if include_optional: + return VrfFabricVcCreateInput( + contact_email = '', + description = '', + facility_id = '', + href = '', + metro = '', + name = '', + project = '', + redundancy = '', + service_token_type = 'a_side', + speed = '10000000000', + tags = [ + '' + ], + type = 'shared', + vrfs = [ + '' + ] + ) + else: + return VrfFabricVcCreateInput( + metro = '', + name = '', + redundancy = '', + service_token_type = 'a_side', + type = 'shared', + vrfs = [ + '' + ], + ) + """ + + def testVrfFabricVcCreateInput(self): + """Test VrfFabricVcCreateInput""" + # 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_vrf_ip_reservation.py b/equinix/services/metalv1/test/test_vrf_ip_reservation.py new file mode 100644 index 00000000..da836d82 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_ip_reservation.py @@ -0,0 +1,420 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_ip_reservation import VrfIpReservation + +class TestVrfIpReservation(unittest.TestCase): + """VrfIpReservation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfIpReservation: + """Test VrfIpReservation + 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 `VrfIpReservation` + """ + model = VrfIpReservation() + if include_optional: + return VrfIpReservation( + address = '', + address_family = 56, + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + gateway = '', + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + public = True, + state = '', + tags = [ + '' + ], + type = 'vrf', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ) + else: + return VrfIpReservation( + type = 'vrf', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), + ) + """ + + def testVrfIpReservation(self): + """Test VrfIpReservation""" + # 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_vrf_ip_reservation_create_input.py b/equinix/services/metalv1/test/test_vrf_ip_reservation_create_input.py new file mode 100644 index 00000000..6243661f --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_ip_reservation_create_input.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_ip_reservation_create_input import VrfIpReservationCreateInput + +class TestVrfIpReservationCreateInput(unittest.TestCase): + """VrfIpReservationCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfIpReservationCreateInput: + """Test VrfIpReservationCreateInput + 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 `VrfIpReservationCreateInput` + """ + model = VrfIpReservationCreateInput() + if include_optional: + return VrfIpReservationCreateInput( + cidr = 22, + customdata = None, + details = '', + href = '', + network = '10.1.2.0', + tags = [ + '' + ], + type = 'vrf', + vrf_id = '' + ) + else: + return VrfIpReservationCreateInput( + cidr = 22, + network = '10.1.2.0', + type = 'vrf', + vrf_id = '', + ) + """ + + def testVrfIpReservationCreateInput(self): + """Test VrfIpReservationCreateInput""" + # 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_vrf_ip_reservation_list.py b/equinix/services/metalv1/test/test_vrf_ip_reservation_list.py new file mode 100644 index 00000000..a44453c0 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_ip_reservation_list.py @@ -0,0 +1,195 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_ip_reservation_list import VrfIpReservationList + +class TestVrfIpReservationList(unittest.TestCase): + """VrfIpReservationList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfIpReservationList: + """Test VrfIpReservationList + 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 `VrfIpReservationList` + """ + model = VrfIpReservationList() + if include_optional: + return VrfIpReservationList( + href = '', + ip_addresses = [ + equinix.services.metalv1.models.vrf_ip_reservation.VrfIpReservation( + address = '', + address_family = 56, + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + gateway = '', + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + public = True, + state = '', + tags = [ + '' + ], + type = 'vrf', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), ) + ] + ) + else: + return VrfIpReservationList( + ) + """ + + def testVrfIpReservationList(self): + """Test VrfIpReservationList""" + # 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_vrf_learned_routes.py b/equinix/services/metalv1/test/test_vrf_learned_routes.py new file mode 100644 index 00000000..5802b696 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_learned_routes.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_learned_routes import VrfLearnedRoutes + +class TestVrfLearnedRoutes(unittest.TestCase): + """VrfLearnedRoutes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfLearnedRoutes: + """Test VrfLearnedRoutes + 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 `VrfLearnedRoutes` + """ + model = VrfLearnedRoutes() + if include_optional: + return VrfLearnedRoutes( + href = '', + origin_as = 65000, + prefix = '8.8.8.0/24' + ) + else: + return VrfLearnedRoutes( + ) + """ + + def testVrfLearnedRoutes(self): + """Test VrfLearnedRoutes""" + # 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_vrf_learned_routes_list.py b/equinix/services/metalv1/test/test_vrf_learned_routes_list.py new file mode 100644 index 00000000..14e6a3a7 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_learned_routes_list.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_learned_routes_list import VrfLearnedRoutesList + +class TestVrfLearnedRoutesList(unittest.TestCase): + """VrfLearnedRoutesList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfLearnedRoutesList: + """Test VrfLearnedRoutesList + 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 `VrfLearnedRoutesList` + """ + model = VrfLearnedRoutesList() + if include_optional: + return VrfLearnedRoutesList( + href = '', + learned_routes = [ + equinix.services.metalv1.models.vrf_learned_routes.VrfLearnedRoutes( + href = '', + origin_as = 65000, + prefix = '8.8.8.0/24', ) + ] + ) + else: + return VrfLearnedRoutesList( + ) + """ + + def testVrfLearnedRoutesList(self): + """Test VrfLearnedRoutesList""" + # 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_vrf_list.py b/equinix/services/metalv1/test/test_vrf_list.py new file mode 100644 index 00000000..f0a21aed --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_list.py @@ -0,0 +1,193 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_list import VrfList + +class TestVrfList(unittest.TestCase): + """VrfList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfList: + """Test VrfList + 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 `VrfList` + """ + model = VrfList() + if include_optional: + return VrfList( + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ), + vrfs = [ + equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ] + ) + else: + return VrfList( + ) + """ + + def testVrfList(self): + """Test VrfList""" + # 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_vrf_metal_gateway.py b/equinix/services/metalv1/test/test_vrf_metal_gateway.py new file mode 100644 index 00000000..1ccdbc68 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_metal_gateway.py @@ -0,0 +1,788 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_metal_gateway import VrfMetalGateway + +class TestVrfMetalGateway(unittest.TestCase): + """VrfMetalGateway unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfMetalGateway: + """Test VrfMetalGateway + 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 `VrfMetalGateway` + """ + model = VrfMetalGateway() + if include_optional: + return VrfMetalGateway( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + ip_reservation = equinix.services.metalv1.models.vrf_ip_reservation.VrfIpReservation( + address = '', + address_family = 56, + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + gateway = '', + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + public = True, + state = '', + tags = [ + '' + ], + type = 'vrf', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ) + else: + return VrfMetalGateway( + ) + """ + + def testVrfMetalGateway(self): + """Test VrfMetalGateway""" + # 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_vrf_metal_gateway_create_input.py b/equinix/services/metalv1/test/test_vrf_metal_gateway_create_input.py new file mode 100644 index 00000000..57898669 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_metal_gateway_create_input.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_metal_gateway_create_input import VrfMetalGatewayCreateInput + +class TestVrfMetalGatewayCreateInput(unittest.TestCase): + """VrfMetalGatewayCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfMetalGatewayCreateInput: + """Test VrfMetalGatewayCreateInput + 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 `VrfMetalGatewayCreateInput` + """ + model = VrfMetalGatewayCreateInput() + if include_optional: + return VrfMetalGatewayCreateInput( + href = '', + ip_reservation_id = '', + virtual_network_id = '' + ) + else: + return VrfMetalGatewayCreateInput( + ip_reservation_id = '', + virtual_network_id = '', + ) + """ + + def testVrfMetalGatewayCreateInput(self): + """Test VrfMetalGatewayCreateInput""" + # 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_vrf_route.py b/equinix/services/metalv1/test/test_vrf_route.py new file mode 100644 index 00000000..23e37904 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_route.py @@ -0,0 +1,1112 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_route import VrfRoute + +class TestVrfRoute(unittest.TestCase): + """VrfRoute unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfRoute: + """Test VrfRoute + 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 `VrfRoute` + """ + model = VrfRoute() + if include_optional: + return VrfRoute( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '/routes/e1ff9c2b-051a-4688-965f-153e274f77e0', + id = 'e1ff9c2b-051a-4688-965f-153e274f77e0', + metal_gateway = equinix.services.metalv1.models.vrf_metal_gateway.VrfMetalGateway( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + ip_reservation = equinix.services.metalv1.models.vrf_ip_reservation.VrfIpReservation( + address = '', + address_family = 56, + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + gateway = '', + href = '', + id = '', + manageable = True, + management = True, + metal_gateway = equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ), + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + public = True, + state = '', + tags = [ + '' + ], + type = 'vrf', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), ), + project = , + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = , + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + + ], + metro_code = '', + vxlan = 56, ), + vrf = , ), + next_hop = '192.168.1.254', + prefix = '0.0.0.0/0', + status = 'active', + tags = [ + '' + ], + type = 'static', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = null, + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + metro = null, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + project = , + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + metro = null, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + project = , + project_lite = null, + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + metro_code = '', + tags = [ + '' + ], + vxlan = 56, ), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ) + else: + return VrfRoute( + ) + """ + + def testVrfRoute(self): + """Test VrfRoute""" + # 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_vrf_route_create_input.py b/equinix/services/metalv1/test/test_vrf_route_create_input.py new file mode 100644 index 00000000..1c198e8f --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_route_create_input.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_route_create_input import VrfRouteCreateInput + +class TestVrfRouteCreateInput(unittest.TestCase): + """VrfRouteCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfRouteCreateInput: + """Test VrfRouteCreateInput + 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 `VrfRouteCreateInput` + """ + model = VrfRouteCreateInput() + if include_optional: + return VrfRouteCreateInput( + href = '', + next_hop = '192.168.1.254', + prefix = '0.0.0.0/0', + tags = [ + '' + ] + ) + else: + return VrfRouteCreateInput( + next_hop = '192.168.1.254', + prefix = '0.0.0.0/0', + ) + """ + + def testVrfRouteCreateInput(self): + """Test VrfRouteCreateInput""" + # 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_vrf_route_list.py b/equinix/services/metalv1/test/test_vrf_route_list.py new file mode 100644 index 00000000..60882e11 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_route_list.py @@ -0,0 +1,576 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_route_list import VrfRouteList + +class TestVrfRouteList(unittest.TestCase): + """VrfRouteList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfRouteList: + """Test VrfRouteList + 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 `VrfRouteList` + """ + model = VrfRouteList() + if include_optional: + return VrfRouteList( + href = '', + meta = equinix.services.metalv1.models.meta.Meta( + current_page = 56, + first = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + last = equinix.services.metalv1.models.href.Href( + href = '', ), + last_page = 56, + next = , + previous = , + self = , + total = 56, ), + routes = [ + equinix.services.metalv1.models.vrf_route.VrfRoute( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '/routes/e1ff9c2b-051a-4688-965f-153e274f77e0', + id = 'e1ff9c2b-051a-4688-965f-153e274f77e0', + metal_gateway = equinix.services.metalv1.models.vrf_metal_gateway.VrfMetalGateway( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.href.Href( + href = '', ), + href = '', + id = '', + ip_reservation = equinix.services.metalv1.models.vrf_ip_reservation.VrfIpReservation( + address = '', + address_family = 56, + bill = True, + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + details = '', + gateway = '', + href = '', + id = '', + manageable = True, + management = True, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + netmask = '', + network = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + project_lite = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + href = '', + id = '', + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', ), + public = True, + state = '', + tags = [ + '' + ], + type = 'vrf', + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), ), + project = , + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to = , + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + facility = , + href = '', + id = '', + instances = [ + equinix.services.metalv1.models.device.Device( + actions = [ + equinix.services.metalv1.models.device_actions_inner.Device_actions_inner( + href = '', + name = '', + type = '', ) + ], + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = { }, + description = '', + firmware_set_id = '', + hardware_reservation = equinix.services.metalv1.models.hardware_reservation.HardwareReservation( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + custom_rate = 1050.5, + device = equinix.services.metalv1.models.device.Device( + always_pxe = True, + billing_cycle = '', + bonding_mode = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + firmware_set_id = '', + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + parent_block = equinix.services.metalv1.models.parent_block.ParentBlock( + cidr = 56, + href = '', + netmask = '', + network = '', ), + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + bond = equinix.services.metalv1.models.bond_port_data.BondPortData( + href = '', + id = '', + name = '', ), + data = equinix.services.metalv1.models.port_data.PortData( + bonded = True, + href = '', + mac = '', ), + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + native_virtual_network = equinix.services.metalv1.models.virtual_network.VirtualNetwork( + assigned_to_virtual_circuit = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + network_type = 'layer2-bonded', + type = 'NetworkPort', + virtual_networks = [ + + ], ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + provisionable_on = [ + '' + ], + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = equinix.services.metalv1.models.plan.Plan( + available_in = [ + equinix.services.metalv1.models.plan_available_in_inner.Plan_available_in_inner( + href = '', + price = equinix.services.metalv1.models.plan_available_in_inner_price.Plan_available_in_inner_price( + hour = 1.23, + href = '', ), ) + ], + available_in_metros = [ + equinix.services.metalv1.models.plan_available_in_metros_inner.Plan_available_in_metros_inner( + href = '', ) + ], + categories = [ + '' + ], + class = 'm3.large.x86', + deployment_types = [ + 'on_demand' + ], + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + specs = equinix.services.metalv1.models.plan_specs.Plan_specs( + cpus = [ + equinix.services.metalv1.models.plan_specs_cpus_inner.Plan_specs_cpus_inner( + count = 56, + href = '', + type = '', ) + ], + drives = [ + equinix.services.metalv1.models.plan_specs_drives_inner.Plan_specs_drives_inner( + category = '', + count = 56, + href = '', + size = '3.84TB', + type = '', ) + ], + features = equinix.services.metalv1.models.plan_specs_features.Plan_specs_features( + href = '', + raid = True, + txt = True, + uefi = True, ), + href = '', + memory = equinix.services.metalv1.models.plan_specs_memory.Plan_specs_memory( + href = '', + total = '', ), + nics = [ + equinix.services.metalv1.models.plan_specs_nics_inner.Plan_specs_nics_inner( + count = 2, + href = '', + type = '', ) + ], ), + type = 'standard', ), + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + relationships = [ + + ], + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + disks = [ + equinix.services.metalv1.models.disk.Disk( + href = '', + partitions = [ + equinix.services.metalv1.models.partition.Partition( + href = '', + label = '', + number = 56, + size = '', ) + ], + wipe_table = True, ) + ], + filesystems = [ + equinix.services.metalv1.models.filesystem.Filesystem( + href = '', + mount = equinix.services.metalv1.models.mount.Mount( + format = '', + href = '', + options = [ + '' + ], + point = '', ), ) + ], + href = '', + raid = [ + equinix.services.metalv1.models.raid.Raid( + href = '', + level = '', + name = '', ) + ], ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ), + href = '', + id = '', + need_of_service = True, + plan = equinix.services.metalv1.models.plan.Plan( + class = 'm3.large.x86', + description = '', + href = '', + id = '', + legacy = True, + line = '', + name = '', + pricing = equinix.services.metalv1.models.pricing.pricing(), + slug = 'm3.large.x86', + type = 'standard', ), + provisionable = True, + short_id = '', + spare = True, + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + hostname = '', + href = '', + id = '', + image_url = '', + ip_addresses = [ + equinix.services.metalv1.models.ip_assignment.IPAssignment( + address = '', + address_family = 56, + assigned_to = , + cidr = 56, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + enabled = True, + gateway = '', + global_ip = True, + href = '', + id = '', + manageable = True, + management = True, + netmask = '', + network = '', + next_hop = '', + public = True, + state = 'pending', ) + ], + ipxe_script_url = '', + iqn = '', + locked = True, + network_frozen = True, + network_ports = [ + equinix.services.metalv1.models.port.Port( + disbond_operation_supported = True, + href = '', + id = '', + name = 'bond0', + network_type = 'layer2-bonded', + type = 'NetworkPort', ) + ], + operating_system = equinix.services.metalv1.models.operating_system.OperatingSystem( + build_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + default_operating_system = True, + deprecation_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + distro = '', + distro_label = '', + end_of_life_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + end_of_service_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + href = '', + id = '', + licensed = True, + lifecycle_state = '', + name = '', + preinstallable = True, + pricing = equinix.services.metalv1.models.pricing.pricing(), + release_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + release_notes = '', + slug = '', + version = '', ), + plan = , + provisioning_events = [ + equinix.services.metalv1.models.event.Event( + body = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + href = '', + id = '', + interpolated = '', + ip = '', + modified_by = equinix.services.metalv1.models.modified_by.modified_by(), + state = '', + type = '', ) + ], + provisioning_percentage = 1.337, + root_password = '', + short_id = '', + sos = '', + spot_instance = True, + spot_price_max = 1.337, + state = 'queued', + storage = equinix.services.metalv1.models.storage.Storage( + href = '', ), + switch_uuid = '', + termination_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + user = '', + userdata = '', ) + ], + metal_gateways = [ + equinix.services.metalv1.models.metal_gateway_lite.MetalGatewayLite( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + gateway_address = '10.1.2.1/27', + href = '', + id = '', + state = 'ready', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vlan = 1001, ) + ], + metro_code = '', + vxlan = 56, ), + vrf = , ), + next_hop = '192.168.1.254', + prefix = '0.0.0.0/0', + status = 'active', + tags = , + type = 'static', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_network = , + vrf = , ) + ] + ) + else: + return VrfRouteList( + ) + """ + + def testVrfRouteList(self): + """Test VrfRouteList""" + # 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_vrf_route_update_input.py b/equinix/services/metalv1/test/test_vrf_route_update_input.py new file mode 100644 index 00000000..b593f953 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_route_update_input.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_route_update_input import VrfRouteUpdateInput + +class TestVrfRouteUpdateInput(unittest.TestCase): + """VrfRouteUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfRouteUpdateInput: + """Test VrfRouteUpdateInput + 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 `VrfRouteUpdateInput` + """ + model = VrfRouteUpdateInput() + if include_optional: + return VrfRouteUpdateInput( + href = '', + next_hop = '192.168.1.254', + prefix = '0.0.0.0/0', + tags = [ + '' + ] + ) + else: + return VrfRouteUpdateInput( + ) + """ + + def testVrfRouteUpdateInput(self): + """Test VrfRouteUpdateInput""" + # 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_vrf_update_input.py b/equinix/services/metalv1/test/test_vrf_update_input.py new file mode 100644 index 00000000..8f265590 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_update_input.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_update_input import VrfUpdateInput + +class TestVrfUpdateInput(unittest.TestCase): + """VrfUpdateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfUpdateInput: + """Test VrfUpdateInput + 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 `VrfUpdateInput` + """ + model = VrfUpdateInput() + if include_optional: + return VrfUpdateInput( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + description = '', + href = '', + ip_ranges = [ + '' + ], + local_asn = 56, + name = '', + tags = [ + '' + ] + ) + else: + return VrfUpdateInput( + ) + """ + + def testVrfUpdateInput(self): + """Test VrfUpdateInput""" + # 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_vrf_virtual_circuit.py b/equinix/services/metalv1/test/test_vrf_virtual_circuit.py new file mode 100644 index 00000000..1a3523a2 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_virtual_circuit.py @@ -0,0 +1,380 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_virtual_circuit import VrfVirtualCircuit + +class TestVrfVirtualCircuit(unittest.TestCase): + """VrfVirtualCircuit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfVirtualCircuit: + """Test VrfVirtualCircuit + 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 `VrfVirtualCircuit` + """ + model = VrfVirtualCircuit() + if include_optional: + return VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + organization = equinix.services.metalv1.models.href.Href( + href = '', ), + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', + virtual_circuits = [ + null + ], ), + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + tags = [ + '' + ], + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ) + ) + else: + return VrfVirtualCircuit( + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = equinix.services.metalv1.models.user.User( + avatar_thumb_url = '', + avatar_url = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + default_organization_id = '', + default_project_id = '', + email = '', + emails = [ + equinix.services.metalv1.models.href.Href( + href = '', ) + ], + first_name = '', + fraud_score = '', + full_name = '', + href = '', + id = '', + last_login_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + last_name = '', + max_organizations = 56, + max_projects = 56, + phone_number = '', + short_id = '', + timezone = '', + two_factor_auth = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), + description = '', + href = '', + id = '', + ip_ranges = [ + '' + ], + local_asn = 65000, + metro = equinix.services.metalv1.models.metro.Metro( + code = '', + country = '', + href = '', + id = '', + name = '', ), + name = '', + project = equinix.services.metalv1.models.project.Project( + backend_transfer_enabled = True, + bgp_config = equinix.services.metalv1.models.href.Href( + href = '', ), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customdata = equinix.services.metalv1.models.customdata.customdata(), + devices = [ + + ], + href = '', + id = '', + invitations = [ + + ], + max_devices = equinix.services.metalv1.models.max_devices.max_devices(), + members = [ + + ], + memberships = [ + + ], + name = '0', + network_status = equinix.services.metalv1.models.network_status.network_status(), + organization = , + payment_method = , + ssh_keys = [ + + ], + tags = [ + '' + ], + type = 'default', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + url = '', + volumes = [ + + ], ), + tags = [ + '' + ], + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + virtual_circuits = [ + equinix.services.metalv1.models.vrf_virtual_circuit.VrfVirtualCircuit( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + id = '', + md5 = '', + metal_ip = '12.0.0.1', + metal_ipv6 = '2604:1380:4641:a00::6', + name = '', + nni_vlan = 56, + peer_asn = 65000, + port = equinix.services.metalv1.models.interconnection_port.InterconnectionPort( + href = '', + id = '', + link_status = '', + name = '', + role = 'primary', + speed = 56, + status = 'requested', + switch_id = '', ), + speed = 56, + status = 'pending', + subnet = '12.0.0.0/30', + subnet_ipv6 = '2604:1380:4641:a00::4/126', + type = 'vrf', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + vrf = equinix.services.metalv1.models.vrf.Vrf( + bgp_dynamic_neighbors_bfd_enabled = True, + bgp_dynamic_neighbors_enabled = True, + bgp_dynamic_neighbors_export_route_map = True, + bill = True, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = '', + href = '', + id = '', + local_asn = 65000, + name = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), ) + ], ), + ) + """ + + def testVrfVirtualCircuit(self): + """Test VrfVirtualCircuit""" + # 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_vrf_virtual_circuit_create_input.py b/equinix/services/metalv1/test/test_vrf_virtual_circuit_create_input.py new file mode 100644 index 00000000..a93d8470 --- /dev/null +++ b/equinix/services/metalv1/test/test_vrf_virtual_circuit_create_input.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Metal API + + 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.vrf_virtual_circuit_create_input import VrfVirtualCircuitCreateInput + +class TestVrfVirtualCircuitCreateInput(unittest.TestCase): + """VrfVirtualCircuitCreateInput unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VrfVirtualCircuitCreateInput: + """Test VrfVirtualCircuitCreateInput + 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 `VrfVirtualCircuitCreateInput` + """ + model = VrfVirtualCircuitCreateInput() + if include_optional: + return VrfVirtualCircuitCreateInput( + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + md5 = 'jUR,rZ#UM/?R,Fp^l6$ARjeJk C>i H'qT\\{ VrfVirtualCircuitUpdateInput: + """Test VrfVirtualCircuitUpdateInput + 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 `VrfVirtualCircuitUpdateInput` + """ + model = VrfVirtualCircuitUpdateInput() + if include_optional: + return VrfVirtualCircuitUpdateInput( + customer_ip = '12.0.0.2', + customer_ipv6 = '2604:1380:4641:a00::6', + description = '', + href = '', + md5 = 'jUR,rZ#UM/?R,Fp^l6$ARjeJk C>i H'qT\\{ None: + self.api = VRFsApi() + + def tearDown(self) -> None: + pass + + def test_bgp_dynamic_neighbors_id_get(self) -> None: + """Test case for bgp_dynamic_neighbors_id_get + + Retrieve a BGP Dynamic Neighbor + """ + pass + + def test_create_vrf(self) -> None: + """Test case for create_vrf + + Create a new VRF in the specified project + """ + pass + + def test_create_vrf_route(self) -> None: + """Test case for create_vrf_route + + Create a VRF route + """ + pass + + def test_delete_bgp_dynamic_neighbor_by_id(self) -> None: + """Test case for delete_bgp_dynamic_neighbor_by_id + + Delete a VRF BGP Dynamic Neighbor + """ + pass + + def test_delete_vrf(self) -> None: + """Test case for delete_vrf + + Delete the VRF + """ + pass + + def test_delete_vrf_route_by_id(self) -> None: + """Test case for delete_vrf_route_by_id + + Delete a VRF Route + """ + pass + + def test_find_vrf_by_id(self) -> None: + """Test case for find_vrf_by_id + + Retrieve a VRF + """ + pass + + def test_find_vrf_ip_reservation(self) -> None: + """Test case for find_vrf_ip_reservation + + Retrieve the Specified VRF IP Reservation + """ + pass + + def test_find_vrf_ip_reservations(self) -> None: + """Test case for find_vrf_ip_reservations + + Retrieve all VRF IP Reservations in the VRF + """ + pass + + def test_find_vrf_route_by_id(self) -> None: + """Test case for find_vrf_route_by_id + + Retrieve a VRF Route + """ + pass + + def test_find_vrfs(self) -> None: + """Test case for find_vrfs + + Retrieve all VRFs in the project + """ + pass + + def test_get_vrf_bgp_neighbors(self) -> None: + """Test case for get_vrf_bgp_neighbors + + Retrieve BGP neighbor states for the VRF + """ + pass + + def test_get_vrf_learned_routes(self) -> None: + """Test case for get_vrf_learned_routes + + Retrieve learned L3 routes within the VRF + """ + pass + + def test_get_vrf_routes(self) -> None: + """Test case for get_vrf_routes + + Retrieve all routes in the VRF + """ + pass + + def test_update_vrf(self) -> None: + """Test case for update_vrf + + Update the VRF + """ + pass + + def test_update_vrf_route_by_id(self) -> None: + """Test case for update_vrf_route_by_id + + Update a VRF Route + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/equinix/services/metalv1_README.md b/equinix/services/metalv1_README.md new file mode 100644 index 00000000..03c2f3eb --- /dev/null +++ b/equinix/services/metalv1_README.md @@ -0,0 +1,583 @@ +# equinix.services.metalv1 +# 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 `equinix.services.metalv1` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 0.3.0 +- Generator version: 7.4.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.7+ + +## Installation & Usage + +This python library package is generated without supporting files like setup.py or requirements files + +To be able to use it, you will need these dependencies in your own package that uses this library: + +* urllib3 >= 1.25.3 +* python-dateutil +* pydantic + +## Getting Started + +In your own code, to use this library to connect and interact with equinix.services.metalv1, +you can run the following: + +```python + +import equinix.services.metalv1 +from equinix.services.metalv1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.equinix.com/metal/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = equinix.services.metalv1.Configuration( + host = "https://api.equinix.com/metal/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: x_auth_token +configuration.api_key['x_auth_token'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['x_auth_token'] = 'Bearer' + + +# Enter a context with an instance of the API client +with equinix.services.metalv1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = equinix.services.metalv1.AuthenticationApi(api_client) + auth_token_input = equinix.services.metalv1.AuthTokenInput() # AuthTokenInput | API key to create + include = ['include_example'] # List[str] | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + try: + # Create an API key + api_response = api_instance.create_api_key(auth_token_input, include=include) + print("The response of AuthenticationApi->create_api_key:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AuthenticationApi->create_api_key: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AuthenticationApi* | [**create_api_key**](equinix/services/metalv1/docs/AuthenticationApi.md#create_api_key) | **POST** /user/api-keys | Create an API key +*AuthenticationApi* | [**create_project_api_key**](equinix/services/metalv1/docs/AuthenticationApi.md#create_project_api_key) | **POST** /projects/{id}/api-keys | Create an API key for a project. +*AuthenticationApi* | [**delete_api_key**](equinix/services/metalv1/docs/AuthenticationApi.md#delete_api_key) | **DELETE** /api-keys/{id} | Delete the API key +*AuthenticationApi* | [**delete_user_api_key**](equinix/services/metalv1/docs/AuthenticationApi.md#delete_user_api_key) | **DELETE** /user/api-keys/{id} | Delete the API key +*AuthenticationApi* | [**find_api_keys**](equinix/services/metalv1/docs/AuthenticationApi.md#find_api_keys) | **GET** /user/api-keys | Retrieve all user API keys +*AuthenticationApi* | [**find_project_api_keys**](equinix/services/metalv1/docs/AuthenticationApi.md#find_project_api_keys) | **GET** /projects/{id}/api-keys | Retrieve all API keys for the project. +*BGPApi* | [**delete_bgp_session**](equinix/services/metalv1/docs/BGPApi.md#delete_bgp_session) | **DELETE** /bgp/sessions/{id} | Delete the BGP session +*BGPApi* | [**find_bgp_config_by_project**](equinix/services/metalv1/docs/BGPApi.md#find_bgp_config_by_project) | **GET** /projects/{id}/bgp-config | Retrieve a bgp config +*BGPApi* | [**find_bgp_session_by_id**](equinix/services/metalv1/docs/BGPApi.md#find_bgp_session_by_id) | **GET** /bgp/sessions/{id} | Retrieve a BGP session +*BGPApi* | [**find_global_bgp_ranges**](equinix/services/metalv1/docs/BGPApi.md#find_global_bgp_ranges) | **GET** /projects/{id}/global-bgp-ranges | Retrieve all global bgp ranges +*BGPApi* | [**find_project_bgp_sessions**](equinix/services/metalv1/docs/BGPApi.md#find_project_bgp_sessions) | **GET** /projects/{id}/bgp/sessions | Retrieve all BGP sessions for project +*BGPApi* | [**request_bgp_config**](equinix/services/metalv1/docs/BGPApi.md#request_bgp_config) | **POST** /projects/{id}/bgp-configs | Requesting bgp config +*BGPApi* | [**update_bgp_session**](equinix/services/metalv1/docs/BGPApi.md#update_bgp_session) | **PUT** /bgp/sessions/{id} | Update the BGP session +*BatchesApi* | [**create_device_batch**](equinix/services/metalv1/docs/BatchesApi.md#create_device_batch) | **POST** /projects/{id}/devices/batch | Create a devices batch +*BatchesApi* | [**delete_batch**](equinix/services/metalv1/docs/BatchesApi.md#delete_batch) | **DELETE** /batches/{id} | Delete the Batch +*BatchesApi* | [**find_batch_by_id**](equinix/services/metalv1/docs/BatchesApi.md#find_batch_by_id) | **GET** /batches/{id} | Retrieve a Batch +*BatchesApi* | [**find_batches_by_project**](equinix/services/metalv1/docs/BatchesApi.md#find_batches_by_project) | **GET** /projects/{id}/batches | Retrieve all batches by project +*CapacityApi* | [**check_capacity_for_facility**](equinix/services/metalv1/docs/CapacityApi.md#check_capacity_for_facility) | **POST** /capacity | Check capacity +*CapacityApi* | [**check_capacity_for_metro**](equinix/services/metalv1/docs/CapacityApi.md#check_capacity_for_metro) | **POST** /capacity/metros | Check capacity for a metro +*CapacityApi* | [**find_capacity_for_facility**](equinix/services/metalv1/docs/CapacityApi.md#find_capacity_for_facility) | **GET** /capacity | View capacity +*CapacityApi* | [**find_capacity_for_metro**](equinix/services/metalv1/docs/CapacityApi.md#find_capacity_for_metro) | **GET** /capacity/metros | View capacity for metros +*CapacityApi* | [**find_organization_capacity_per_facility**](equinix/services/metalv1/docs/CapacityApi.md#find_organization_capacity_per_facility) | **GET** /organizations/{id}/capacity | View available hardware plans per Facility for given organization +*CapacityApi* | [**find_organization_capacity_per_metro**](equinix/services/metalv1/docs/CapacityApi.md#find_organization_capacity_per_metro) | **GET** /organizations/{id}/capacity/metros | View available hardware plans per Metro for given organization +*ConsoleLogDetailsApi* | [**capture_screenshot**](equinix/services/metalv1/docs/ConsoleLogDetailsApi.md#capture_screenshot) | **GET** /devices/{id}/diagnostics/screenshot | +*DevicesApi* | [**create_bgp_session**](equinix/services/metalv1/docs/DevicesApi.md#create_bgp_session) | **POST** /devices/{id}/bgp/sessions | Create a BGP session +*DevicesApi* | [**create_device**](equinix/services/metalv1/docs/DevicesApi.md#create_device) | **POST** /projects/{id}/devices | Create a device +*DevicesApi* | [**create_ip_assignment**](equinix/services/metalv1/docs/DevicesApi.md#create_ip_assignment) | **POST** /devices/{id}/ips | Create an ip assignment +*DevicesApi* | [**delete_device**](equinix/services/metalv1/docs/DevicesApi.md#delete_device) | **DELETE** /devices/{id} | Delete the device +*DevicesApi* | [**find_bgp_sessions**](equinix/services/metalv1/docs/DevicesApi.md#find_bgp_sessions) | **GET** /devices/{id}/bgp/sessions | Retrieve all BGP sessions +*DevicesApi* | [**find_device_by_id**](equinix/services/metalv1/docs/DevicesApi.md#find_device_by_id) | **GET** /devices/{id} | Retrieve a device +*DevicesApi* | [**find_device_customdata**](equinix/services/metalv1/docs/DevicesApi.md#find_device_customdata) | **GET** /devices/{id}/customdata | Retrieve the custom metadata of an instance +*DevicesApi* | [**find_device_metadata_by_id**](equinix/services/metalv1/docs/DevicesApi.md#find_device_metadata_by_id) | **GET** /devices/{id}/metadata | Retrieve metadata +*DevicesApi* | [**find_device_userdata_by_id**](equinix/services/metalv1/docs/DevicesApi.md#find_device_userdata_by_id) | **GET** /devices/{id}/userdata | Retrieve userdata +*DevicesApi* | [**find_instance_bandwidth**](equinix/services/metalv1/docs/DevicesApi.md#find_instance_bandwidth) | **GET** /devices/{id}/bandwidth | Retrieve an instance bandwidth +*DevicesApi* | [**find_ip_assignment_customdata**](equinix/services/metalv1/docs/DevicesApi.md#find_ip_assignment_customdata) | **GET** /devices/{instance_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Assignment +*DevicesApi* | [**find_ip_assignments**](equinix/services/metalv1/docs/DevicesApi.md#find_ip_assignments) | **GET** /devices/{id}/ips | Retrieve all ip assignments +*DevicesApi* | [**find_organization_devices**](equinix/services/metalv1/docs/DevicesApi.md#find_organization_devices) | **GET** /organizations/{id}/devices | Retrieve all devices of an organization +*DevicesApi* | [**find_project_devices**](equinix/services/metalv1/docs/DevicesApi.md#find_project_devices) | **GET** /projects/{id}/devices | Retrieve all devices of a project +*DevicesApi* | [**find_traffic**](equinix/services/metalv1/docs/DevicesApi.md#find_traffic) | **GET** /devices/{id}/traffic | Retrieve device traffic +*DevicesApi* | [**get_bgp_neighbor_data**](equinix/services/metalv1/docs/DevicesApi.md#get_bgp_neighbor_data) | **GET** /devices/{id}/bgp/neighbors | Retrieve BGP neighbor data for this device +*DevicesApi* | [**get_device_firmware_sets**](equinix/services/metalv1/docs/DevicesApi.md#get_device_firmware_sets) | **GET** /devices/{id}/firmware-sets | Get Device's associated Firmware Set +*DevicesApi* | [**get_device_health_rollup**](equinix/services/metalv1/docs/DevicesApi.md#get_device_health_rollup) | **GET** /devices/{id}/diagnostics/health/rollup | Get Device's Health Status +*DevicesApi* | [**perform_action**](equinix/services/metalv1/docs/DevicesApi.md#perform_action) | **POST** /devices/{id}/actions | Perform an action +*DevicesApi* | [**update_device**](equinix/services/metalv1/docs/DevicesApi.md#update_device) | **PUT** /devices/{id} | Update the device +*EmailsApi* | [**create_email**](equinix/services/metalv1/docs/EmailsApi.md#create_email) | **POST** /emails | Create an email +*EmailsApi* | [**delete_email**](equinix/services/metalv1/docs/EmailsApi.md#delete_email) | **DELETE** /emails/{id} | Delete the email +*EmailsApi* | [**find_email_by_id**](equinix/services/metalv1/docs/EmailsApi.md#find_email_by_id) | **GET** /emails/{id} | Retrieve an email +*EmailsApi* | [**update_email**](equinix/services/metalv1/docs/EmailsApi.md#update_email) | **PUT** /emails/{id} | Update the email +*EventsApi* | [**find_device_events**](equinix/services/metalv1/docs/EventsApi.md#find_device_events) | **GET** /devices/{id}/events | Retrieve device's events +*EventsApi* | [**find_event_by_id**](equinix/services/metalv1/docs/EventsApi.md#find_event_by_id) | **GET** /events/{id} | Retrieve an event +*EventsApi* | [**find_events**](equinix/services/metalv1/docs/EventsApi.md#find_events) | **GET** /events | Retrieve current user's events +*EventsApi* | [**find_interconnection_events**](equinix/services/metalv1/docs/EventsApi.md#find_interconnection_events) | **GET** /connections/{connection_id}/events | Retrieve interconnection events +*EventsApi* | [**find_interconnection_port_events**](equinix/services/metalv1/docs/EventsApi.md#find_interconnection_port_events) | **GET** /connections/{connection_id}/ports/{id}/events | Retrieve interconnection port events +*EventsApi* | [**find_organization_events**](equinix/services/metalv1/docs/EventsApi.md#find_organization_events) | **GET** /organizations/{id}/events | Retrieve organization's events +*EventsApi* | [**find_project_events**](equinix/services/metalv1/docs/EventsApi.md#find_project_events) | **GET** /projects/{id}/events | Retrieve project's events +*EventsApi* | [**find_virtual_circuit_events**](equinix/services/metalv1/docs/EventsApi.md#find_virtual_circuit_events) | **GET** /virtual-circuits/{id}/events | Retrieve virtual circuit events +*EventsApi* | [**find_vrf_route_events**](equinix/services/metalv1/docs/EventsApi.md#find_vrf_route_events) | **GET** /routes/{id}/events | Retrieve VRF route events +*FacilitiesApi* | [**find_facilities**](equinix/services/metalv1/docs/FacilitiesApi.md#find_facilities) | **GET** /facilities | Retrieve all facilities +*FacilitiesApi* | [**find_facilities_by_organization**](equinix/services/metalv1/docs/FacilitiesApi.md#find_facilities_by_organization) | **GET** /organizations/{id}/facilities | Retrieve all facilities visible by the organization +*FacilitiesApi* | [**find_facilities_by_project**](equinix/services/metalv1/docs/FacilitiesApi.md#find_facilities_by_project) | **GET** /projects/{id}/facilities | Retrieve all facilities visible by the project +*FirmwareSetsApi* | [**get_organization_firmware_sets**](equinix/services/metalv1/docs/FirmwareSetsApi.md#get_organization_firmware_sets) | **GET** /organizations/{id}/firmware-sets | Get Organization's Firmware Sets +*FirmwareSetsApi* | [**get_project_firmware_sets**](equinix/services/metalv1/docs/FirmwareSetsApi.md#get_project_firmware_sets) | **GET** /projects/{id}/firmware-sets | Get Project's Firmware Sets +*HardwareReservationsApi* | [**activate_hardware_reservation**](equinix/services/metalv1/docs/HardwareReservationsApi.md#activate_hardware_reservation) | **POST** /hardware-reservations/{id}/activate | Activate a spare hardware reservation +*HardwareReservationsApi* | [**find_hardware_reservation_by_id**](equinix/services/metalv1/docs/HardwareReservationsApi.md#find_hardware_reservation_by_id) | **GET** /hardware-reservations/{id} | Retrieve a hardware reservation +*HardwareReservationsApi* | [**find_project_hardware_reservations**](equinix/services/metalv1/docs/HardwareReservationsApi.md#find_project_hardware_reservations) | **GET** /projects/{id}/hardware-reservations | Retrieve all hardware reservations for a given project +*HardwareReservationsApi* | [**move_hardware_reservation**](equinix/services/metalv1/docs/HardwareReservationsApi.md#move_hardware_reservation) | **POST** /hardware-reservations/{id}/move | Move a hardware reservation +*IPAddressesApi* | [**delete_ip_address**](equinix/services/metalv1/docs/IPAddressesApi.md#delete_ip_address) | **DELETE** /ips/{id} | Unassign an ip address +*IPAddressesApi* | [**find_ip_address_by_id**](equinix/services/metalv1/docs/IPAddressesApi.md#find_ip_address_by_id) | **GET** /ips/{id} | Retrieve an ip address +*IPAddressesApi* | [**find_ip_address_customdata**](equinix/services/metalv1/docs/IPAddressesApi.md#find_ip_address_customdata) | **GET** /ips/{id}/customdata | Retrieve the custom metadata of an IP Reservation or IP Assignment +*IPAddressesApi* | [**find_ip_availabilities**](equinix/services/metalv1/docs/IPAddressesApi.md#find_ip_availabilities) | **GET** /ips/{id}/available | Retrieve all available subnets of a particular reservation +*IPAddressesApi* | [**find_ip_reservations**](equinix/services/metalv1/docs/IPAddressesApi.md#find_ip_reservations) | **GET** /projects/{id}/ips | Retrieve all ip reservations +*IPAddressesApi* | [**request_ip_reservation**](equinix/services/metalv1/docs/IPAddressesApi.md#request_ip_reservation) | **POST** /projects/{id}/ips | Requesting IP reservations +*IPAddressesApi* | [**update_ip_address**](equinix/services/metalv1/docs/IPAddressesApi.md#update_ip_address) | **PATCH** /ips/{id} | Update an ip address +*IncidentsApi* | [**find_incidents**](equinix/services/metalv1/docs/IncidentsApi.md#find_incidents) | **GET** /incidents | Retrieve the number of incidents +*InterconnectionsApi* | [**create_interconnection_port_virtual_circuit**](equinix/services/metalv1/docs/InterconnectionsApi.md#create_interconnection_port_virtual_circuit) | **POST** /connections/{connection_id}/ports/{port_id}/virtual-circuits | Create a new Virtual Circuit +*InterconnectionsApi* | [**create_organization_interconnection**](equinix/services/metalv1/docs/InterconnectionsApi.md#create_organization_interconnection) | **POST** /organizations/{organization_id}/connections | Request a new interconnection for the organization +*InterconnectionsApi* | [**create_project_interconnection**](equinix/services/metalv1/docs/InterconnectionsApi.md#create_project_interconnection) | **POST** /projects/{project_id}/connections | Request a new interconnection for the project's organization +*InterconnectionsApi* | [**delete_interconnection**](equinix/services/metalv1/docs/InterconnectionsApi.md#delete_interconnection) | **DELETE** /connections/{connection_id} | Delete interconnection +*InterconnectionsApi* | [**delete_virtual_circuit**](equinix/services/metalv1/docs/InterconnectionsApi.md#delete_virtual_circuit) | **DELETE** /virtual-circuits/{id} | Delete a virtual circuit +*InterconnectionsApi* | [**get_interconnection**](equinix/services/metalv1/docs/InterconnectionsApi.md#get_interconnection) | **GET** /connections/{connection_id} | Get interconnection +*InterconnectionsApi* | [**get_interconnection_metros**](equinix/services/metalv1/docs/InterconnectionsApi.md#get_interconnection_metros) | **GET** /connections/metros | Get connectivity to network provider by metro +*InterconnectionsApi* | [**get_interconnection_port**](equinix/services/metalv1/docs/InterconnectionsApi.md#get_interconnection_port) | **GET** /connections/{connection_id}/ports/{id} | Get a interconnection port +*InterconnectionsApi* | [**get_interconnection_pricing**](equinix/services/metalv1/docs/InterconnectionsApi.md#get_interconnection_pricing) | **GET** /connections/prices | Get Interconnection Pricing +*InterconnectionsApi* | [**get_virtual_circuit**](equinix/services/metalv1/docs/InterconnectionsApi.md#get_virtual_circuit) | **GET** /virtual-circuits/{id} | Get a virtual circuit +*InterconnectionsApi* | [**list_interconnection_port_virtual_circuits**](equinix/services/metalv1/docs/InterconnectionsApi.md#list_interconnection_port_virtual_circuits) | **GET** /connections/{connection_id}/ports/{port_id}/virtual-circuits | List a interconnection port's virtual circuits +*InterconnectionsApi* | [**list_interconnection_ports**](equinix/services/metalv1/docs/InterconnectionsApi.md#list_interconnection_ports) | **GET** /connections/{connection_id}/ports | List a interconnection's ports +*InterconnectionsApi* | [**list_interconnection_virtual_circuits**](equinix/services/metalv1/docs/InterconnectionsApi.md#list_interconnection_virtual_circuits) | **GET** /connections/{connection_id}/virtual-circuits | List a interconnection's virtual circuits +*InterconnectionsApi* | [**organization_list_interconnections**](equinix/services/metalv1/docs/InterconnectionsApi.md#organization_list_interconnections) | **GET** /organizations/{organization_id}/connections | List organization connections +*InterconnectionsApi* | [**project_list_interconnections**](equinix/services/metalv1/docs/InterconnectionsApi.md#project_list_interconnections) | **GET** /projects/{project_id}/connections | List project connections +*InterconnectionsApi* | [**update_interconnection**](equinix/services/metalv1/docs/InterconnectionsApi.md#update_interconnection) | **PUT** /connections/{connection_id} | Update interconnection +*InterconnectionsApi* | [**update_virtual_circuit**](equinix/services/metalv1/docs/InterconnectionsApi.md#update_virtual_circuit) | **PUT** /virtual-circuits/{id} | Update a virtual circuit +*InvitationsApi* | [**accept_invitation**](equinix/services/metalv1/docs/InvitationsApi.md#accept_invitation) | **PUT** /invitations/{id} | Accept an invitation +*InvitationsApi* | [**decline_invitation**](equinix/services/metalv1/docs/InvitationsApi.md#decline_invitation) | **DELETE** /invitations/{id} | Decline an invitation +*InvitationsApi* | [**find_invitation_by_id**](equinix/services/metalv1/docs/InvitationsApi.md#find_invitation_by_id) | **GET** /invitations/{id} | View an invitation +*InvoicesApi* | [**find_organization_invoices**](equinix/services/metalv1/docs/InvoicesApi.md#find_organization_invoices) | **GET** /organizations/{id}/invoices | Retrieve all invoices for an organization +*InvoicesApi* | [**get_invoice_by_id**](equinix/services/metalv1/docs/InvoicesApi.md#get_invoice_by_id) | **GET** /invoices/{id} | Retrieve an invoice +*LicensesApi* | [**create_license**](equinix/services/metalv1/docs/LicensesApi.md#create_license) | **POST** /projects/{id}/licenses | Create a License +*LicensesApi* | [**delete_license**](equinix/services/metalv1/docs/LicensesApi.md#delete_license) | **DELETE** /licenses/{id} | Delete the license +*LicensesApi* | [**find_license_by_id**](equinix/services/metalv1/docs/LicensesApi.md#find_license_by_id) | **GET** /licenses/{id} | Retrieve a license +*LicensesApi* | [**find_project_licenses**](equinix/services/metalv1/docs/LicensesApi.md#find_project_licenses) | **GET** /projects/{id}/licenses | Retrieve all licenses +*LicensesApi* | [**update_license**](equinix/services/metalv1/docs/LicensesApi.md#update_license) | **PUT** /licenses/{id} | Update the license +*MembershipsApi* | [**delete_membership**](equinix/services/metalv1/docs/MembershipsApi.md#delete_membership) | **DELETE** /memberships/{id} | Delete the membership +*MembershipsApi* | [**find_membership_by_id**](equinix/services/metalv1/docs/MembershipsApi.md#find_membership_by_id) | **GET** /memberships/{id} | Retrieve a membership +*MembershipsApi* | [**update_membership**](equinix/services/metalv1/docs/MembershipsApi.md#update_membership) | **PUT** /memberships/{id} | Update the membership +*MetalGatewaysApi* | [**create_bgp_dynamic_neighbor**](equinix/services/metalv1/docs/MetalGatewaysApi.md#create_bgp_dynamic_neighbor) | **POST** /metal-gateways/{id}/bgp-dynamic-neighbors | Create a VRF BGP Dynamic Neighbor range +*MetalGatewaysApi* | [**create_metal_gateway**](equinix/services/metalv1/docs/MetalGatewaysApi.md#create_metal_gateway) | **POST** /projects/{project_id}/metal-gateways | Create a metal gateway +*MetalGatewaysApi* | [**create_metal_gateway_elastic_ip**](equinix/services/metalv1/docs/MetalGatewaysApi.md#create_metal_gateway_elastic_ip) | **POST** /metal-gateways/{id}/ips | Create a Metal Gateway Elastic IP +*MetalGatewaysApi* | [**delete_metal_gateway**](equinix/services/metalv1/docs/MetalGatewaysApi.md#delete_metal_gateway) | **DELETE** /metal-gateways/{id} | Deletes the metal gateway +*MetalGatewaysApi* | [**find_metal_gateway_by_id**](equinix/services/metalv1/docs/MetalGatewaysApi.md#find_metal_gateway_by_id) | **GET** /metal-gateways/{id} | Returns the metal gateway +*MetalGatewaysApi* | [**find_metal_gateways_by_project**](equinix/services/metalv1/docs/MetalGatewaysApi.md#find_metal_gateways_by_project) | **GET** /projects/{project_id}/metal-gateways | Returns all metal gateways for a project +*MetalGatewaysApi* | [**get_bgp_dynamic_neighbors**](equinix/services/metalv1/docs/MetalGatewaysApi.md#get_bgp_dynamic_neighbors) | **GET** /metal-gateways/{id}/bgp-dynamic-neighbors | List BGP Dynamic Neighbors +*MetalGatewaysApi* | [**get_metal_gateway_elastic_ips**](equinix/services/metalv1/docs/MetalGatewaysApi.md#get_metal_gateway_elastic_ips) | **GET** /metal-gateways/{id}/ips | List Metal Gateway Elastic IPs +*MetrosApi* | [**find_metros**](equinix/services/metalv1/docs/MetrosApi.md#find_metros) | **GET** /locations/metros | Retrieve all metros +*MetrosApi* | [**get_metro**](equinix/services/metalv1/docs/MetrosApi.md#get_metro) | **GET** /locations/metros/{id} | Retrieve a specific Metro's details +*OTPsApi* | [**find_ensure_otp**](equinix/services/metalv1/docs/OTPsApi.md#find_ensure_otp) | **POST** /user/otp/verify/{otp} | Verify user by providing an OTP +*OTPsApi* | [**find_recovery_codes**](equinix/services/metalv1/docs/OTPsApi.md#find_recovery_codes) | **GET** /user/otp/recovery-codes | Retrieve my recovery codes +*OTPsApi* | [**receive_codes**](equinix/services/metalv1/docs/OTPsApi.md#receive_codes) | **POST** /user/otp/sms/receive | Receive an OTP per sms +*OTPsApi* | [**regenerate_codes**](equinix/services/metalv1/docs/OTPsApi.md#regenerate_codes) | **POST** /user/otp/recovery-codes | Generate new recovery codes +*OperatingSystemsApi* | [**find_operating_system_version**](equinix/services/metalv1/docs/OperatingSystemsApi.md#find_operating_system_version) | **GET** /operating-system-versions | Retrieve all operating system versions +*OperatingSystemsApi* | [**find_operating_systems**](equinix/services/metalv1/docs/OperatingSystemsApi.md#find_operating_systems) | **GET** /operating-systems | Retrieve all operating systems +*OrganizationsApi* | [**create_organization**](equinix/services/metalv1/docs/OrganizationsApi.md#create_organization) | **POST** /organizations | Create an organization +*OrganizationsApi* | [**create_organization_invitation**](equinix/services/metalv1/docs/OrganizationsApi.md#create_organization_invitation) | **POST** /organizations/{id}/invitations | Create an invitation for an organization +*OrganizationsApi* | [**create_organization_project**](equinix/services/metalv1/docs/OrganizationsApi.md#create_organization_project) | **POST** /organizations/{id}/projects | Create a project for the organization +*OrganizationsApi* | [**create_payment_method**](equinix/services/metalv1/docs/OrganizationsApi.md#create_payment_method) | **POST** /organizations/{id}/payment-methods | Create a payment method for the given organization +*OrganizationsApi* | [**delete_organization**](equinix/services/metalv1/docs/OrganizationsApi.md#delete_organization) | **DELETE** /organizations/{id} | Delete the organization +*OrganizationsApi* | [**find_operating_systems_by_organization**](equinix/services/metalv1/docs/OrganizationsApi.md#find_operating_systems_by_organization) | **GET** /organizations/{id}/operating-systems | Retrieve all operating systems visible by the organization +*OrganizationsApi* | [**find_organization_by_id**](equinix/services/metalv1/docs/OrganizationsApi.md#find_organization_by_id) | **GET** /organizations/{id} | Retrieve an organization's details +*OrganizationsApi* | [**find_organization_customdata**](equinix/services/metalv1/docs/OrganizationsApi.md#find_organization_customdata) | **GET** /organizations/{id}/customdata | Retrieve the custom metadata of an organization +*OrganizationsApi* | [**find_organization_invitations**](equinix/services/metalv1/docs/OrganizationsApi.md#find_organization_invitations) | **GET** /organizations/{id}/invitations | Retrieve organization invitations +*OrganizationsApi* | [**find_organization_payment_methods**](equinix/services/metalv1/docs/OrganizationsApi.md#find_organization_payment_methods) | **GET** /organizations/{id}/payment-methods | Retrieve all payment methods of an organization +*OrganizationsApi* | [**find_organization_projects**](equinix/services/metalv1/docs/OrganizationsApi.md#find_organization_projects) | **GET** /organizations/{id}/projects | Retrieve all projects of an organization +*OrganizationsApi* | [**find_organization_transfers**](equinix/services/metalv1/docs/OrganizationsApi.md#find_organization_transfers) | **GET** /organizations/{id}/transfers | Retrieve all project transfer requests from or to an organization +*OrganizationsApi* | [**find_organizations**](equinix/services/metalv1/docs/OrganizationsApi.md#find_organizations) | **GET** /organizations | Retrieve all organizations +*OrganizationsApi* | [**find_plans_by_organization**](equinix/services/metalv1/docs/OrganizationsApi.md#find_plans_by_organization) | **GET** /organizations/{id}/plans | Retrieve all plans visible by the organization +*OrganizationsApi* | [**update_organization**](equinix/services/metalv1/docs/OrganizationsApi.md#update_organization) | **PUT** /organizations/{id} | Update the organization +*PasswordResetTokensApi* | [**create_password_reset_token**](equinix/services/metalv1/docs/PasswordResetTokensApi.md#create_password_reset_token) | **POST** /reset-password | Create a password reset token +*PasswordResetTokensApi* | [**reset_password**](equinix/services/metalv1/docs/PasswordResetTokensApi.md#reset_password) | **DELETE** /reset-password | Reset current user password +*PaymentMethodsApi* | [**delete_payment_method**](equinix/services/metalv1/docs/PaymentMethodsApi.md#delete_payment_method) | **DELETE** /payment-methods/{id} | Delete the payment method +*PaymentMethodsApi* | [**find_payment_method_by_id**](equinix/services/metalv1/docs/PaymentMethodsApi.md#find_payment_method_by_id) | **GET** /payment-methods/{id} | Retrieve a payment method +*PaymentMethodsApi* | [**update_payment_method**](equinix/services/metalv1/docs/PaymentMethodsApi.md#update_payment_method) | **PUT** /payment-methods/{id} | Update the payment method +*PlansApi* | [**find_plans**](equinix/services/metalv1/docs/PlansApi.md#find_plans) | **GET** /plans | Retrieve all plans +*PlansApi* | [**find_plans_by_project**](equinix/services/metalv1/docs/PlansApi.md#find_plans_by_project) | **GET** /projects/{id}/plans | Retrieve all plans visible by the project +*PortsApi* | [**assign_native_vlan**](equinix/services/metalv1/docs/PortsApi.md#assign_native_vlan) | **POST** /ports/{id}/native-vlan | Assign a native VLAN +*PortsApi* | [**assign_port**](equinix/services/metalv1/docs/PortsApi.md#assign_port) | **POST** /ports/{id}/assign | Assign a port to virtual network +*PortsApi* | [**bond_port**](equinix/services/metalv1/docs/PortsApi.md#bond_port) | **POST** /ports/{id}/bond | Enabling bonding +*PortsApi* | [**convert_layer2**](equinix/services/metalv1/docs/PortsApi.md#convert_layer2) | **POST** /ports/{id}/convert/layer-2 | Convert to Layer 2 +*PortsApi* | [**convert_layer3**](equinix/services/metalv1/docs/PortsApi.md#convert_layer3) | **POST** /ports/{id}/convert/layer-3 | Convert to Layer 3 +*PortsApi* | [**create_port_vlan_assignment_batch**](equinix/services/metalv1/docs/PortsApi.md#create_port_vlan_assignment_batch) | **POST** /ports/{id}/vlan-assignments/batches | Create a new Port-VLAN Assignment management batch +*PortsApi* | [**delete_native_vlan**](equinix/services/metalv1/docs/PortsApi.md#delete_native_vlan) | **DELETE** /ports/{id}/native-vlan | Remove native VLAN +*PortsApi* | [**disbond_port**](equinix/services/metalv1/docs/PortsApi.md#disbond_port) | **POST** /ports/{id}/disbond | Disabling bonding +*PortsApi* | [**find_port_by_id**](equinix/services/metalv1/docs/PortsApi.md#find_port_by_id) | **GET** /ports/{id} | Retrieve a port +*PortsApi* | [**find_port_vlan_assignment_batch_by_port_id_and_batch_id**](equinix/services/metalv1/docs/PortsApi.md#find_port_vlan_assignment_batch_by_port_id_and_batch_id) | **GET** /ports/{id}/vlan-assignments/batches/{batch_id} | Retrieve a VLAN Assignment Batch's details +*PortsApi* | [**find_port_vlan_assignment_batches**](equinix/services/metalv1/docs/PortsApi.md#find_port_vlan_assignment_batches) | **GET** /ports/{id}/vlan-assignments/batches | List the VLAN Assignment Batches for a port +*PortsApi* | [**find_port_vlan_assignment_by_port_id_and_assignment_id**](equinix/services/metalv1/docs/PortsApi.md#find_port_vlan_assignment_by_port_id_and_assignment_id) | **GET** /ports/{id}/vlan-assignments/{assignment_id} | Show a particular Port VLAN assignment's details +*PortsApi* | [**find_port_vlan_assignments**](equinix/services/metalv1/docs/PortsApi.md#find_port_vlan_assignments) | **GET** /ports/{id}/vlan-assignments | List Current VLAN assignments for a port +*PortsApi* | [**unassign_port**](equinix/services/metalv1/docs/PortsApi.md#unassign_port) | **POST** /ports/{id}/unassign | Unassign a port +*ProjectsApi* | [**create_project**](equinix/services/metalv1/docs/ProjectsApi.md#create_project) | **POST** /projects | Create a project +*ProjectsApi* | [**create_project_invitation**](equinix/services/metalv1/docs/ProjectsApi.md#create_project_invitation) | **POST** /projects/{project_id}/invitations | Create an invitation for a project +*ProjectsApi* | [**create_transfer_request**](equinix/services/metalv1/docs/ProjectsApi.md#create_transfer_request) | **POST** /projects/{id}/transfers | Create a transfer request +*ProjectsApi* | [**delete_project**](equinix/services/metalv1/docs/ProjectsApi.md#delete_project) | **DELETE** /projects/{id} | Delete the project +*ProjectsApi* | [**find_ip_reservation_customdata**](equinix/services/metalv1/docs/ProjectsApi.md#find_ip_reservation_customdata) | **GET** /projects/{project_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Reservation +*ProjectsApi* | [**find_project_by_id**](equinix/services/metalv1/docs/ProjectsApi.md#find_project_by_id) | **GET** /projects/{id} | Retrieve a project +*ProjectsApi* | [**find_project_customdata**](equinix/services/metalv1/docs/ProjectsApi.md#find_project_customdata) | **GET** /projects/{id}/customdata | Retrieve the custom metadata of a project +*ProjectsApi* | [**find_project_invitations**](equinix/services/metalv1/docs/ProjectsApi.md#find_project_invitations) | **GET** /projects/{project_id}/invitations | Retrieve project invitations +*ProjectsApi* | [**find_project_memberships**](equinix/services/metalv1/docs/ProjectsApi.md#find_project_memberships) | **GET** /projects/{project_id}/memberships | Retrieve project memberships +*ProjectsApi* | [**find_projects**](equinix/services/metalv1/docs/ProjectsApi.md#find_projects) | **GET** /projects | Retrieve all projects +*ProjectsApi* | [**update_project**](equinix/services/metalv1/docs/ProjectsApi.md#update_project) | **PUT** /projects/{id} | Update the project +*SSHKeysApi* | [**create_project_ssh_key**](equinix/services/metalv1/docs/SSHKeysApi.md#create_project_ssh_key) | **POST** /projects/{id}/ssh-keys | Create a ssh key for the given project +*SSHKeysApi* | [**create_ssh_key**](equinix/services/metalv1/docs/SSHKeysApi.md#create_ssh_key) | **POST** /ssh-keys | Create a ssh key for the current user +*SSHKeysApi* | [**delete_ssh_key**](equinix/services/metalv1/docs/SSHKeysApi.md#delete_ssh_key) | **DELETE** /ssh-keys/{id} | Delete the ssh key +*SSHKeysApi* | [**find_device_ssh_keys**](equinix/services/metalv1/docs/SSHKeysApi.md#find_device_ssh_keys) | **GET** /devices/{id}/ssh-keys | Retrieve a device's ssh keys +*SSHKeysApi* | [**find_project_ssh_keys**](equinix/services/metalv1/docs/SSHKeysApi.md#find_project_ssh_keys) | **GET** /projects/{id}/ssh-keys | Retrieve a project's ssh keys +*SSHKeysApi* | [**find_ssh_key_by_id**](equinix/services/metalv1/docs/SSHKeysApi.md#find_ssh_key_by_id) | **GET** /ssh-keys/{id} | Retrieve a ssh key +*SSHKeysApi* | [**find_ssh_keys**](equinix/services/metalv1/docs/SSHKeysApi.md#find_ssh_keys) | **GET** /ssh-keys | Retrieve all ssh keys +*SSHKeysApi* | [**update_ssh_key**](equinix/services/metalv1/docs/SSHKeysApi.md#update_ssh_key) | **PUT** /ssh-keys/{id} | Update the ssh key +*SelfServiceReservationsApi* | [**create_self_service_reservation**](equinix/services/metalv1/docs/SelfServiceReservationsApi.md#create_self_service_reservation) | **POST** /projects/{project_id}/self-service/reservations | Create a reservation +*SelfServiceReservationsApi* | [**find_self_service_reservation**](equinix/services/metalv1/docs/SelfServiceReservationsApi.md#find_self_service_reservation) | **GET** /projects/{project_id}/self-service/reservations/{id} | Retrieve a reservation +*SelfServiceReservationsApi* | [**find_self_service_reservations**](equinix/services/metalv1/docs/SelfServiceReservationsApi.md#find_self_service_reservations) | **GET** /projects/{project_id}/self-service/reservations | Retrieve all reservations +*SpotMarketApi* | [**create_spot_market_request**](equinix/services/metalv1/docs/SpotMarketApi.md#create_spot_market_request) | **POST** /projects/{id}/spot-market-requests | Create a spot market request +*SpotMarketApi* | [**delete_spot_market_request**](equinix/services/metalv1/docs/SpotMarketApi.md#delete_spot_market_request) | **DELETE** /spot-market-requests/{id} | Delete the spot market request +*SpotMarketApi* | [**find_metro_spot_market_prices**](equinix/services/metalv1/docs/SpotMarketApi.md#find_metro_spot_market_prices) | **GET** /market/spot/prices/metros | Get current spot market prices for metros +*SpotMarketApi* | [**find_spot_market_prices**](equinix/services/metalv1/docs/SpotMarketApi.md#find_spot_market_prices) | **GET** /market/spot/prices | Get current spot market prices +*SpotMarketApi* | [**find_spot_market_prices_history**](equinix/services/metalv1/docs/SpotMarketApi.md#find_spot_market_prices_history) | **GET** /market/spot/prices/history | Get spot market prices for a given period of time +*SpotMarketApi* | [**find_spot_market_request_by_id**](equinix/services/metalv1/docs/SpotMarketApi.md#find_spot_market_request_by_id) | **GET** /spot-market-requests/{id} | Retrieve a spot market request +*SpotMarketApi* | [**list_spot_market_requests**](equinix/services/metalv1/docs/SpotMarketApi.md#list_spot_market_requests) | **GET** /projects/{id}/spot-market-requests | List spot market requests +*SupportRequestApi* | [**request_support**](equinix/services/metalv1/docs/SupportRequestApi.md#request_support) | **POST** /support-requests | Create a support ticket +*TransferRequestsApi* | [**accept_transfer_request**](equinix/services/metalv1/docs/TransferRequestsApi.md#accept_transfer_request) | **PUT** /transfers/{id} | Accept a transfer request +*TransferRequestsApi* | [**decline_transfer_request**](equinix/services/metalv1/docs/TransferRequestsApi.md#decline_transfer_request) | **DELETE** /transfers/{id} | Decline a transfer request +*TransferRequestsApi* | [**find_transfer_request_by_id**](equinix/services/metalv1/docs/TransferRequestsApi.md#find_transfer_request_by_id) | **GET** /transfers/{id} | View a transfer request +*TwoFactorAuthApi* | [**disable_tfa_app**](equinix/services/metalv1/docs/TwoFactorAuthApi.md#disable_tfa_app) | **DELETE** /user/otp/app | Disable two factor authentication +*TwoFactorAuthApi* | [**disable_tfa_sms**](equinix/services/metalv1/docs/TwoFactorAuthApi.md#disable_tfa_sms) | **DELETE** /user/otp/sms | Disable two factor authentication +*TwoFactorAuthApi* | [**enable_tfa_app**](equinix/services/metalv1/docs/TwoFactorAuthApi.md#enable_tfa_app) | **POST** /user/otp/app | Enable two factor auth using app +*TwoFactorAuthApi* | [**enable_tfa_sms**](equinix/services/metalv1/docs/TwoFactorAuthApi.md#enable_tfa_sms) | **POST** /user/otp/sms | Enable two factor auth using sms +*UsagesApi* | [**find_device_usages**](equinix/services/metalv1/docs/UsagesApi.md#find_device_usages) | **GET** /devices/{id}/usages | Retrieve all usages for device +*UsagesApi* | [**find_project_usage**](equinix/services/metalv1/docs/UsagesApi.md#find_project_usage) | **GET** /projects/{id}/usages | Retrieve all usages for project +*UserVerificationTokensApi* | [**consume_verification_request**](equinix/services/metalv1/docs/UserVerificationTokensApi.md#consume_verification_request) | **PUT** /verify-email | Verify a user using an email verification token +*UserVerificationTokensApi* | [**create_validation_request**](equinix/services/metalv1/docs/UserVerificationTokensApi.md#create_validation_request) | **POST** /verify-email | Create an email verification request +*UserdataApi* | [**validate_userdata**](equinix/services/metalv1/docs/UserdataApi.md#validate_userdata) | **POST** /userdata/validate | Validate user data +*UsersApi* | [**create_user**](equinix/services/metalv1/docs/UsersApi.md#create_user) | **POST** /users | Create a user +*UsersApi* | [**find_current_user**](equinix/services/metalv1/docs/UsersApi.md#find_current_user) | **GET** /user | Retrieve the current user +*UsersApi* | [**find_invitations**](equinix/services/metalv1/docs/UsersApi.md#find_invitations) | **GET** /invitations | Retrieve current user invitations +*UsersApi* | [**find_user_by_id**](equinix/services/metalv1/docs/UsersApi.md#find_user_by_id) | **GET** /users/{id} | Retrieve a user +*UsersApi* | [**find_user_customdata**](equinix/services/metalv1/docs/UsersApi.md#find_user_customdata) | **GET** /users/{id}/customdata | Retrieve the custom metadata of a user +*UsersApi* | [**find_users**](equinix/services/metalv1/docs/UsersApi.md#find_users) | **GET** /users | Retrieve all users +*UsersApi* | [**update_current_user**](equinix/services/metalv1/docs/UsersApi.md#update_current_user) | **PUT** /user | Update the current user +*VLANsApi* | [**create_virtual_network**](equinix/services/metalv1/docs/VLANsApi.md#create_virtual_network) | **POST** /projects/{id}/virtual-networks | Create a virtual network +*VLANsApi* | [**delete_virtual_network**](equinix/services/metalv1/docs/VLANsApi.md#delete_virtual_network) | **DELETE** /virtual-networks/{id} | Delete a virtual network +*VLANsApi* | [**find_virtual_networks**](equinix/services/metalv1/docs/VLANsApi.md#find_virtual_networks) | **GET** /projects/{id}/virtual-networks | Retrieve all virtual networks +*VLANsApi* | [**get_virtual_network**](equinix/services/metalv1/docs/VLANsApi.md#get_virtual_network) | **GET** /virtual-networks/{id} | Get a virtual network +*VLANsApi* | [**update_virtual_network**](equinix/services/metalv1/docs/VLANsApi.md#update_virtual_network) | **PUT** /virtual-networks/{id} | Updates the virtual network +*VRFsApi* | [**bgp_dynamic_neighbors_id_get**](equinix/services/metalv1/docs/VRFsApi.md#bgp_dynamic_neighbors_id_get) | **GET** /bgp-dynamic-neighbors/{id} | Retrieve a BGP Dynamic Neighbor +*VRFsApi* | [**create_vrf**](equinix/services/metalv1/docs/VRFsApi.md#create_vrf) | **POST** /projects/{id}/vrfs | Create a new VRF in the specified project +*VRFsApi* | [**create_vrf_route**](equinix/services/metalv1/docs/VRFsApi.md#create_vrf_route) | **POST** /vrfs/{id}/routes | Create a VRF route +*VRFsApi* | [**delete_bgp_dynamic_neighbor_by_id**](equinix/services/metalv1/docs/VRFsApi.md#delete_bgp_dynamic_neighbor_by_id) | **DELETE** /bgp-dynamic-neighbors/{id} | Delete a VRF BGP Dynamic Neighbor +*VRFsApi* | [**delete_vrf**](equinix/services/metalv1/docs/VRFsApi.md#delete_vrf) | **DELETE** /vrfs/{id} | Delete the VRF +*VRFsApi* | [**delete_vrf_route_by_id**](equinix/services/metalv1/docs/VRFsApi.md#delete_vrf_route_by_id) | **DELETE** /routes/{id} | Delete a VRF Route +*VRFsApi* | [**find_vrf_by_id**](equinix/services/metalv1/docs/VRFsApi.md#find_vrf_by_id) | **GET** /vrfs/{id} | Retrieve a VRF +*VRFsApi* | [**find_vrf_ip_reservation**](equinix/services/metalv1/docs/VRFsApi.md#find_vrf_ip_reservation) | **GET** /vrfs/{vrf_id}/ips/{id} | Retrieve the Specified VRF IP Reservation +*VRFsApi* | [**find_vrf_ip_reservations**](equinix/services/metalv1/docs/VRFsApi.md#find_vrf_ip_reservations) | **GET** /vrfs/{id}/ips | Retrieve all VRF IP Reservations in the VRF +*VRFsApi* | [**find_vrf_route_by_id**](equinix/services/metalv1/docs/VRFsApi.md#find_vrf_route_by_id) | **GET** /routes/{id} | Retrieve a VRF Route +*VRFsApi* | [**find_vrfs**](equinix/services/metalv1/docs/VRFsApi.md#find_vrfs) | **GET** /projects/{id}/vrfs | Retrieve all VRFs in the project +*VRFsApi* | [**get_vrf_bgp_neighbors**](equinix/services/metalv1/docs/VRFsApi.md#get_vrf_bgp_neighbors) | **GET** /vrfs/{id}/bgp-neighbors | Retrieve BGP neighbor states for the VRF +*VRFsApi* | [**get_vrf_learned_routes**](equinix/services/metalv1/docs/VRFsApi.md#get_vrf_learned_routes) | **GET** /vrfs/{id}/learned-routes | Retrieve learned L3 routes within the VRF +*VRFsApi* | [**get_vrf_routes**](equinix/services/metalv1/docs/VRFsApi.md#get_vrf_routes) | **GET** /vrfs/{id}/routes | Retrieve all routes in the VRF +*VRFsApi* | [**update_vrf**](equinix/services/metalv1/docs/VRFsApi.md#update_vrf) | **PUT** /vrfs/{id} | Update the VRF +*VRFsApi* | [**update_vrf_route_by_id**](equinix/services/metalv1/docs/VRFsApi.md#update_vrf_route_by_id) | **PUT** /routes/{id} | Update a VRF Route + + +## Documentation For Models + + - [AWSFabricProvider](equinix/services/metalv1/docs/AWSFabricProvider.md) + - [ActivateHardwareReservationRequest](equinix/services/metalv1/docs/ActivateHardwareReservationRequest.md) + - [Address](equinix/services/metalv1/docs/Address.md) + - [Attribute](equinix/services/metalv1/docs/Attribute.md) + - [AttributeData](equinix/services/metalv1/docs/AttributeData.md) + - [AuthToken](equinix/services/metalv1/docs/AuthToken.md) + - [AuthTokenInput](equinix/services/metalv1/docs/AuthTokenInput.md) + - [AuthTokenList](equinix/services/metalv1/docs/AuthTokenList.md) + - [AuthTokenProject](equinix/services/metalv1/docs/AuthTokenProject.md) + - [AuthTokenUser](equinix/services/metalv1/docs/AuthTokenUser.md) + - [BGPSessionInput](equinix/services/metalv1/docs/BGPSessionInput.md) + - [Batch](equinix/services/metalv1/docs/Batch.md) + - [BatchesList](equinix/services/metalv1/docs/BatchesList.md) + - [BgpConfig](equinix/services/metalv1/docs/BgpConfig.md) + - [BgpConfigRequestInput](equinix/services/metalv1/docs/BgpConfigRequestInput.md) + - [BgpDynamicNeighbor](equinix/services/metalv1/docs/BgpDynamicNeighbor.md) + - [BgpDynamicNeighborCreateInput](equinix/services/metalv1/docs/BgpDynamicNeighborCreateInput.md) + - [BgpDynamicNeighborList](equinix/services/metalv1/docs/BgpDynamicNeighborList.md) + - [BgpNeighborData](equinix/services/metalv1/docs/BgpNeighborData.md) + - [BgpRoute](equinix/services/metalv1/docs/BgpRoute.md) + - [BgpSession](equinix/services/metalv1/docs/BgpSession.md) + - [BgpSessionList](equinix/services/metalv1/docs/BgpSessionList.md) + - [BgpSessionNeighbors](equinix/services/metalv1/docs/BgpSessionNeighbors.md) + - [BondPortData](equinix/services/metalv1/docs/BondPortData.md) + - [CapacityCheckPerFacilityInfo](equinix/services/metalv1/docs/CapacityCheckPerFacilityInfo.md) + - [CapacityCheckPerFacilityList](equinix/services/metalv1/docs/CapacityCheckPerFacilityList.md) + - [CapacityCheckPerMetroInfo](equinix/services/metalv1/docs/CapacityCheckPerMetroInfo.md) + - [CapacityCheckPerMetroList](equinix/services/metalv1/docs/CapacityCheckPerMetroList.md) + - [CapacityInput](equinix/services/metalv1/docs/CapacityInput.md) + - [CapacityLevelPerBaremetal](equinix/services/metalv1/docs/CapacityLevelPerBaremetal.md) + - [CapacityList](equinix/services/metalv1/docs/CapacityList.md) + - [Component](equinix/services/metalv1/docs/Component.md) + - [Coordinates](equinix/services/metalv1/docs/Coordinates.md) + - [CreateDeviceRequest](equinix/services/metalv1/docs/CreateDeviceRequest.md) + - [CreateEmailInput](equinix/services/metalv1/docs/CreateEmailInput.md) + - [CreateMetalGatewayRequest](equinix/services/metalv1/docs/CreateMetalGatewayRequest.md) + - [CreateOrganizationInterconnectionRequest](equinix/services/metalv1/docs/CreateOrganizationInterconnectionRequest.md) + - [CreateSelfServiceReservationRequest](equinix/services/metalv1/docs/CreateSelfServiceReservationRequest.md) + - [CreateSelfServiceReservationRequestPeriod](equinix/services/metalv1/docs/CreateSelfServiceReservationRequestPeriod.md) + - [DedicatedPortCreateInput](equinix/services/metalv1/docs/DedicatedPortCreateInput.md) + - [Device](equinix/services/metalv1/docs/Device.md) + - [DeviceActionInput](equinix/services/metalv1/docs/DeviceActionInput.md) + - [DeviceActionsInner](equinix/services/metalv1/docs/DeviceActionsInner.md) + - [DeviceCreateInFacilityInput](equinix/services/metalv1/docs/DeviceCreateInFacilityInput.md) + - [DeviceCreateInMetroInput](equinix/services/metalv1/docs/DeviceCreateInMetroInput.md) + - [DeviceCreateInput](equinix/services/metalv1/docs/DeviceCreateInput.md) + - [DeviceCreatedBy](equinix/services/metalv1/docs/DeviceCreatedBy.md) + - [DeviceHealthRollup](equinix/services/metalv1/docs/DeviceHealthRollup.md) + - [DeviceList](equinix/services/metalv1/docs/DeviceList.md) + - [DeviceMetro](equinix/services/metalv1/docs/DeviceMetro.md) + - [DeviceProjectLite](equinix/services/metalv1/docs/DeviceProjectLite.md) + - [DeviceUpdateInput](equinix/services/metalv1/docs/DeviceUpdateInput.md) + - [DeviceUsage](equinix/services/metalv1/docs/DeviceUsage.md) + - [DeviceUsageList](equinix/services/metalv1/docs/DeviceUsageList.md) + - [Disk](equinix/services/metalv1/docs/Disk.md) + - [Email](equinix/services/metalv1/docs/Email.md) + - [EmailInput](equinix/services/metalv1/docs/EmailInput.md) + - [Entitlement](equinix/services/metalv1/docs/Entitlement.md) + - [Error](equinix/services/metalv1/docs/Error.md) + - [Event](equinix/services/metalv1/docs/Event.md) + - [EventList](equinix/services/metalv1/docs/EventList.md) + - [FabricServiceToken](equinix/services/metalv1/docs/FabricServiceToken.md) + - [Facility](equinix/services/metalv1/docs/Facility.md) + - [FacilityInput](equinix/services/metalv1/docs/FacilityInput.md) + - [FacilityInputFacility](equinix/services/metalv1/docs/FacilityInputFacility.md) + - [FacilityList](equinix/services/metalv1/docs/FacilityList.md) + - [Filesystem](equinix/services/metalv1/docs/Filesystem.md) + - [FindIPAddressById200Response](equinix/services/metalv1/docs/FindIPAddressById200Response.md) + - [FindMetalGatewayById200Response](equinix/services/metalv1/docs/FindMetalGatewayById200Response.md) + - [FindTrafficTimeframeParameter](equinix/services/metalv1/docs/FindTrafficTimeframeParameter.md) + - [FirmwareSet](equinix/services/metalv1/docs/FirmwareSet.md) + - [FirmwareSetListResponse](equinix/services/metalv1/docs/FirmwareSetListResponse.md) + - [FirmwareSetResponse](equinix/services/metalv1/docs/FirmwareSetResponse.md) + - [GlobalBgpRange](equinix/services/metalv1/docs/GlobalBgpRange.md) + - [GlobalBgpRangeList](equinix/services/metalv1/docs/GlobalBgpRangeList.md) + - [HardwareReservation](equinix/services/metalv1/docs/HardwareReservation.md) + - [HardwareReservationList](equinix/services/metalv1/docs/HardwareReservationList.md) + - [Href](equinix/services/metalv1/docs/Href.md) + - [IPAddress](equinix/services/metalv1/docs/IPAddress.md) + - [IPAssignment](equinix/services/metalv1/docs/IPAssignment.md) + - [IPAssignmentInput](equinix/services/metalv1/docs/IPAssignmentInput.md) + - [IPAssignmentList](equinix/services/metalv1/docs/IPAssignmentList.md) + - [IPAssignmentMetro](equinix/services/metalv1/docs/IPAssignmentMetro.md) + - [IPAssignmentUpdateInput](equinix/services/metalv1/docs/IPAssignmentUpdateInput.md) + - [IPAvailabilitiesList](equinix/services/metalv1/docs/IPAvailabilitiesList.md) + - [IPReservation](equinix/services/metalv1/docs/IPReservation.md) + - [IPReservationFacility](equinix/services/metalv1/docs/IPReservationFacility.md) + - [IPReservationList](equinix/services/metalv1/docs/IPReservationList.md) + - [IPReservationListIpAddressesInner](equinix/services/metalv1/docs/IPReservationListIpAddressesInner.md) + - [IPReservationMetro](equinix/services/metalv1/docs/IPReservationMetro.md) + - [IPReservationRequestInput](equinix/services/metalv1/docs/IPReservationRequestInput.md) + - [InstancesBatchCreateInput](equinix/services/metalv1/docs/InstancesBatchCreateInput.md) + - [InstancesBatchCreateInputBatchesInner](equinix/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md) + - [Interconnection](equinix/services/metalv1/docs/Interconnection.md) + - [InterconnectionFabricProvider](equinix/services/metalv1/docs/InterconnectionFabricProvider.md) + - [InterconnectionList](equinix/services/metalv1/docs/InterconnectionList.md) + - [InterconnectionMetroList](equinix/services/metalv1/docs/InterconnectionMetroList.md) + - [InterconnectionMetroListMetrosInner](equinix/services/metalv1/docs/InterconnectionMetroListMetrosInner.md) + - [InterconnectionMetroListMetrosInnerAllOfProvidersInner](equinix/services/metalv1/docs/InterconnectionMetroListMetrosInnerAllOfProvidersInner.md) + - [InterconnectionPort](equinix/services/metalv1/docs/InterconnectionPort.md) + - [InterconnectionPortList](equinix/services/metalv1/docs/InterconnectionPortList.md) + - [InterconnectionPricingList](equinix/services/metalv1/docs/InterconnectionPricingList.md) + - [InterconnectionPricingListProviderPricingInner](equinix/services/metalv1/docs/InterconnectionPricingListProviderPricingInner.md) + - [InterconnectionPricingListProviderPricingInnerTiersInner](equinix/services/metalv1/docs/InterconnectionPricingListProviderPricingInnerTiersInner.md) + - [InterconnectionUpdateInput](equinix/services/metalv1/docs/InterconnectionUpdateInput.md) + - [Invitation](equinix/services/metalv1/docs/Invitation.md) + - [InvitationInput](equinix/services/metalv1/docs/InvitationInput.md) + - [InvitationList](equinix/services/metalv1/docs/InvitationList.md) + - [Invoice](equinix/services/metalv1/docs/Invoice.md) + - [InvoiceList](equinix/services/metalv1/docs/InvoiceList.md) + - [License](equinix/services/metalv1/docs/License.md) + - [LicenseCreateInput](equinix/services/metalv1/docs/LicenseCreateInput.md) + - [LicenseList](equinix/services/metalv1/docs/LicenseList.md) + - [LicenseUpdateInput](equinix/services/metalv1/docs/LicenseUpdateInput.md) + - [LineItem](equinix/services/metalv1/docs/LineItem.md) + - [LineItemAdjustment](equinix/services/metalv1/docs/LineItemAdjustment.md) + - [Membership](equinix/services/metalv1/docs/Membership.md) + - [MembershipInput](equinix/services/metalv1/docs/MembershipInput.md) + - [MembershipList](equinix/services/metalv1/docs/MembershipList.md) + - [Meta](equinix/services/metalv1/docs/Meta.md) + - [Metadata](equinix/services/metalv1/docs/Metadata.md) + - [MetadataNetwork](equinix/services/metalv1/docs/MetadataNetwork.md) + - [MetadataNetworkNetwork](equinix/services/metalv1/docs/MetadataNetworkNetwork.md) + - [MetadataNetworkNetworkBonding](equinix/services/metalv1/docs/MetadataNetworkNetworkBonding.md) + - [MetalGateway](equinix/services/metalv1/docs/MetalGateway.md) + - [MetalGatewayCreateInput](equinix/services/metalv1/docs/MetalGatewayCreateInput.md) + - [MetalGatewayElasticIpCreateInput](equinix/services/metalv1/docs/MetalGatewayElasticIpCreateInput.md) + - [MetalGatewayList](equinix/services/metalv1/docs/MetalGatewayList.md) + - [MetalGatewayListMetalGatewaysInner](equinix/services/metalv1/docs/MetalGatewayListMetalGatewaysInner.md) + - [MetalGatewayLite](equinix/services/metalv1/docs/MetalGatewayLite.md) + - [Metro](equinix/services/metalv1/docs/Metro.md) + - [MetroInput](equinix/services/metalv1/docs/MetroInput.md) + - [MetroList](equinix/services/metalv1/docs/MetroList.md) + - [Mount](equinix/services/metalv1/docs/Mount.md) + - [MoveHardwareReservationRequest](equinix/services/metalv1/docs/MoveHardwareReservationRequest.md) + - [NewPassword](equinix/services/metalv1/docs/NewPassword.md) + - [OperatingSystem](equinix/services/metalv1/docs/OperatingSystem.md) + - [OperatingSystemList](equinix/services/metalv1/docs/OperatingSystemList.md) + - [Organization](equinix/services/metalv1/docs/Organization.md) + - [OrganizationInput](equinix/services/metalv1/docs/OrganizationInput.md) + - [OrganizationList](equinix/services/metalv1/docs/OrganizationList.md) + - [ParentBlock](equinix/services/metalv1/docs/ParentBlock.md) + - [Partition](equinix/services/metalv1/docs/Partition.md) + - [PaymentMethod](equinix/services/metalv1/docs/PaymentMethod.md) + - [PaymentMethodBillingAddress](equinix/services/metalv1/docs/PaymentMethodBillingAddress.md) + - [PaymentMethodCreateInput](equinix/services/metalv1/docs/PaymentMethodCreateInput.md) + - [PaymentMethodList](equinix/services/metalv1/docs/PaymentMethodList.md) + - [PaymentMethodUpdateInput](equinix/services/metalv1/docs/PaymentMethodUpdateInput.md) + - [Plan](equinix/services/metalv1/docs/Plan.md) + - [PlanAvailableInInner](equinix/services/metalv1/docs/PlanAvailableInInner.md) + - [PlanAvailableInInnerPrice](equinix/services/metalv1/docs/PlanAvailableInInnerPrice.md) + - [PlanAvailableInMetrosInner](equinix/services/metalv1/docs/PlanAvailableInMetrosInner.md) + - [PlanIdName](equinix/services/metalv1/docs/PlanIdName.md) + - [PlanList](equinix/services/metalv1/docs/PlanList.md) + - [PlanSpecs](equinix/services/metalv1/docs/PlanSpecs.md) + - [PlanSpecsCpusInner](equinix/services/metalv1/docs/PlanSpecsCpusInner.md) + - [PlanSpecsDrivesInner](equinix/services/metalv1/docs/PlanSpecsDrivesInner.md) + - [PlanSpecsFeatures](equinix/services/metalv1/docs/PlanSpecsFeatures.md) + - [PlanSpecsMemory](equinix/services/metalv1/docs/PlanSpecsMemory.md) + - [PlanSpecsNicsInner](equinix/services/metalv1/docs/PlanSpecsNicsInner.md) + - [Port](equinix/services/metalv1/docs/Port.md) + - [PortAssignInput](equinix/services/metalv1/docs/PortAssignInput.md) + - [PortConvertLayer3Input](equinix/services/metalv1/docs/PortConvertLayer3Input.md) + - [PortConvertLayer3InputRequestIpsInner](equinix/services/metalv1/docs/PortConvertLayer3InputRequestIpsInner.md) + - [PortData](equinix/services/metalv1/docs/PortData.md) + - [PortVlanAssignment](equinix/services/metalv1/docs/PortVlanAssignment.md) + - [PortVlanAssignmentBatch](equinix/services/metalv1/docs/PortVlanAssignmentBatch.md) + - [PortVlanAssignmentBatchCreateInput](equinix/services/metalv1/docs/PortVlanAssignmentBatchCreateInput.md) + - [PortVlanAssignmentBatchCreateInputVlanAssignmentsInner](equinix/services/metalv1/docs/PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.md) + - [PortVlanAssignmentBatchList](equinix/services/metalv1/docs/PortVlanAssignmentBatchList.md) + - [PortVlanAssignmentBatchVlanAssignmentsInner](equinix/services/metalv1/docs/PortVlanAssignmentBatchVlanAssignmentsInner.md) + - [PortVlanAssignmentList](equinix/services/metalv1/docs/PortVlanAssignmentList.md) + - [Project](equinix/services/metalv1/docs/Project.md) + - [ProjectCreateFromRootInput](equinix/services/metalv1/docs/ProjectCreateFromRootInput.md) + - [ProjectCreateInput](equinix/services/metalv1/docs/ProjectCreateInput.md) + - [ProjectIdName](equinix/services/metalv1/docs/ProjectIdName.md) + - [ProjectList](equinix/services/metalv1/docs/ProjectList.md) + - [ProjectUpdateInput](equinix/services/metalv1/docs/ProjectUpdateInput.md) + - [ProjectUsage](equinix/services/metalv1/docs/ProjectUsage.md) + - [ProjectUsageList](equinix/services/metalv1/docs/ProjectUsageList.md) + - [Raid](equinix/services/metalv1/docs/Raid.md) + - [RecoveryCodeList](equinix/services/metalv1/docs/RecoveryCodeList.md) + - [RequestIPReservation201Response](equinix/services/metalv1/docs/RequestIPReservation201Response.md) + - [RequestIPReservationRequest](equinix/services/metalv1/docs/RequestIPReservationRequest.md) + - [SSHKey](equinix/services/metalv1/docs/SSHKey.md) + - [SSHKeyCreateInput](equinix/services/metalv1/docs/SSHKeyCreateInput.md) + - [SSHKeyInput](equinix/services/metalv1/docs/SSHKeyInput.md) + - [SSHKeyList](equinix/services/metalv1/docs/SSHKeyList.md) + - [SelfServiceReservationItemRequest](equinix/services/metalv1/docs/SelfServiceReservationItemRequest.md) + - [SelfServiceReservationItemResponse](equinix/services/metalv1/docs/SelfServiceReservationItemResponse.md) + - [SelfServiceReservationList](equinix/services/metalv1/docs/SelfServiceReservationList.md) + - [SelfServiceReservationResponse](equinix/services/metalv1/docs/SelfServiceReservationResponse.md) + - [ServerInfo](equinix/services/metalv1/docs/ServerInfo.md) + - [SharedPortVCVlanCreateInput](equinix/services/metalv1/docs/SharedPortVCVlanCreateInput.md) + - [SpotMarketPricesList](equinix/services/metalv1/docs/SpotMarketPricesList.md) + - [SpotMarketPricesPerMetroList](equinix/services/metalv1/docs/SpotMarketPricesPerMetroList.md) + - [SpotMarketPricesPerMetroReport](equinix/services/metalv1/docs/SpotMarketPricesPerMetroReport.md) + - [SpotMarketRequest](equinix/services/metalv1/docs/SpotMarketRequest.md) + - [SpotMarketRequestCreateInput](equinix/services/metalv1/docs/SpotMarketRequestCreateInput.md) + - [SpotMarketRequestCreateInputInstanceParameters](equinix/services/metalv1/docs/SpotMarketRequestCreateInputInstanceParameters.md) + - [SpotMarketRequestList](equinix/services/metalv1/docs/SpotMarketRequestList.md) + - [SpotMarketRequestMetro](equinix/services/metalv1/docs/SpotMarketRequestMetro.md) + - [SpotPricesDatapoints](equinix/services/metalv1/docs/SpotPricesDatapoints.md) + - [SpotPricesHistoryReport](equinix/services/metalv1/docs/SpotPricesHistoryReport.md) + - [SpotPricesPerBaremetal](equinix/services/metalv1/docs/SpotPricesPerBaremetal.md) + - [SpotPricesPerFacility](equinix/services/metalv1/docs/SpotPricesPerFacility.md) + - [SpotPricesPerNewFacility](equinix/services/metalv1/docs/SpotPricesPerNewFacility.md) + - [SpotPricesReport](equinix/services/metalv1/docs/SpotPricesReport.md) + - [Storage](equinix/services/metalv1/docs/Storage.md) + - [SupportRequestInput](equinix/services/metalv1/docs/SupportRequestInput.md) + - [TransferRequest](equinix/services/metalv1/docs/TransferRequest.md) + - [TransferRequestInput](equinix/services/metalv1/docs/TransferRequestInput.md) + - [TransferRequestList](equinix/services/metalv1/docs/TransferRequestList.md) + - [UpdateEmailInput](equinix/services/metalv1/docs/UpdateEmailInput.md) + - [User](equinix/services/metalv1/docs/User.md) + - [UserCreateInput](equinix/services/metalv1/docs/UserCreateInput.md) + - [UserLimited](equinix/services/metalv1/docs/UserLimited.md) + - [UserList](equinix/services/metalv1/docs/UserList.md) + - [UserLite](equinix/services/metalv1/docs/UserLite.md) + - [UserUpdateInput](equinix/services/metalv1/docs/UserUpdateInput.md) + - [Userdata](equinix/services/metalv1/docs/Userdata.md) + - [VerifyEmail](equinix/services/metalv1/docs/VerifyEmail.md) + - [VirtualCircuit](equinix/services/metalv1/docs/VirtualCircuit.md) + - [VirtualCircuitCreateInput](equinix/services/metalv1/docs/VirtualCircuitCreateInput.md) + - [VirtualCircuitList](equinix/services/metalv1/docs/VirtualCircuitList.md) + - [VirtualCircuitUpdateInput](equinix/services/metalv1/docs/VirtualCircuitUpdateInput.md) + - [VirtualNetwork](equinix/services/metalv1/docs/VirtualNetwork.md) + - [VirtualNetworkCreateInput](equinix/services/metalv1/docs/VirtualNetworkCreateInput.md) + - [VirtualNetworkList](equinix/services/metalv1/docs/VirtualNetworkList.md) + - [VirtualNetworkUpdateInput](equinix/services/metalv1/docs/VirtualNetworkUpdateInput.md) + - [VlanCSPConnectionCreateInput](equinix/services/metalv1/docs/VlanCSPConnectionCreateInput.md) + - [VlanCSPConnectionCreateInputFabricProvider](equinix/services/metalv1/docs/VlanCSPConnectionCreateInputFabricProvider.md) + - [VlanFabricVcCreateInput](equinix/services/metalv1/docs/VlanFabricVcCreateInput.md) + - [VlanVirtualCircuit](equinix/services/metalv1/docs/VlanVirtualCircuit.md) + - [VlanVirtualCircuitCreateInput](equinix/services/metalv1/docs/VlanVirtualCircuitCreateInput.md) + - [VlanVirtualCircuitUpdateInput](equinix/services/metalv1/docs/VlanVirtualCircuitUpdateInput.md) + - [Vrf](equinix/services/metalv1/docs/Vrf.md) + - [VrfBGPNeighbors](equinix/services/metalv1/docs/VrfBGPNeighbors.md) + - [VrfBGPNeighborsList](equinix/services/metalv1/docs/VrfBGPNeighborsList.md) + - [VrfCreateInput](equinix/services/metalv1/docs/VrfCreateInput.md) + - [VrfFabricVcCreateInput](equinix/services/metalv1/docs/VrfFabricVcCreateInput.md) + - [VrfIpReservation](equinix/services/metalv1/docs/VrfIpReservation.md) + - [VrfIpReservationCreateInput](equinix/services/metalv1/docs/VrfIpReservationCreateInput.md) + - [VrfIpReservationList](equinix/services/metalv1/docs/VrfIpReservationList.md) + - [VrfLearnedRoutes](equinix/services/metalv1/docs/VrfLearnedRoutes.md) + - [VrfLearnedRoutesList](equinix/services/metalv1/docs/VrfLearnedRoutesList.md) + - [VrfList](equinix/services/metalv1/docs/VrfList.md) + - [VrfMetalGateway](equinix/services/metalv1/docs/VrfMetalGateway.md) + - [VrfMetalGatewayCreateInput](equinix/services/metalv1/docs/VrfMetalGatewayCreateInput.md) + - [VrfRoute](equinix/services/metalv1/docs/VrfRoute.md) + - [VrfRouteCreateInput](equinix/services/metalv1/docs/VrfRouteCreateInput.md) + - [VrfRouteList](equinix/services/metalv1/docs/VrfRouteList.md) + - [VrfRouteUpdateInput](equinix/services/metalv1/docs/VrfRouteUpdateInput.md) + - [VrfUpdateInput](equinix/services/metalv1/docs/VrfUpdateInput.md) + - [VrfVirtualCircuit](equinix/services/metalv1/docs/VrfVirtualCircuit.md) + - [VrfVirtualCircuitCreateInput](equinix/services/metalv1/docs/VrfVirtualCircuitCreateInput.md) + - [VrfVirtualCircuitUpdateInput](equinix/services/metalv1/docs/VrfVirtualCircuitUpdateInput.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### x_auth_token + +- **Type**: API key +- **API key parameter name**: X-Auth-Token +- **Location**: HTTP header + + +## Author + +support@equinixmetal.com + + diff --git a/examples/connection.py b/examples/connection.py new file mode 100755 index 00000000..174d5cea --- /dev/null +++ b/examples/connection.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +# Example of hardware_reservation resource fetch + +import os +import time + +from equinix.services import metalv1 + + +def get_equinix_metal_client(api_token): + conf = metalv1.Configuration( + host="https://api.equinix.com/metal/v1" + ) + conf.api_key['x_auth_token'] = api_token + conf.debug= True + return metalv1.ApiClient(conf) + + +client = get_equinix_metal_client(os.environ["METAL_AUTH_TOKEN"]) + + +org_api = metalv1.InterconnectionsApi(client) +resp = org_api.project_list_interconnections_all_pages("126d9a9d-f425-47a8-97ad-537185b5bebe") + +print(resp) + diff --git a/examples/device_basic.py b/examples/device_basic.py new file mode 100755 index 00000000..131865e0 --- /dev/null +++ b/examples/device_basic.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 + +import os +import time + +from equinix.services import metalv1 + + +def get_equinix_metal_client(api_token): + conf = metalv1.Configuration( + host="https://api.equinix.com/metal/v1" + ) + print(api_token) + conf.api_key['x_auth_token'] = api_token + return metalv1.ApiClient(conf) + + +def wait_for_device_active(client, did): + wait_timeout = time.time() + time.time() + 60 * 5 + while wait_timeout > time.time(): + device = metalv1.DevicesApi(client).find_device_by_id(did) + if device.state == 'active': + return device + print( + f"Waiting for device {did} to become active, device state is {device.state}") + time.sleep(5) + raise Exception("Timed out waiting for device to become active") + + +client = get_equinix_metal_client(os.environ["METAL_AUTH_TOKEN"]) +project_id = os.environ["METAL_PROJECT_ID"] + +# Since there are 2 models for CreateDeviceRequest, we need to create the +# appropriate one and then pass it to the CreateDeviceRequest constructor. +# The second model is DeviceCreateInFacilityInput. + +cdm = metalv1.DeviceCreateInMetroInput( + operating_system="ubuntu_18_04", + plan="c3.small.x86", + hostname="test", + metro="sv", + billing_cycle="hourly", + tags=["test"] +) + +cdr = metalv1.CreateDeviceRequest(actual_instance=cdm) +print("About to create device in project: " + project_id) +devices_api = metalv1.DevicesApi(client) +new_device_resp = devices_api.create_device(project_id, cdr) + +print("New Device:") +print(new_device_resp) + +active_device_resp = wait_for_device_active(client, new_device_resp.id) + +print("Device is active:") +print(active_device_resp) + +print("About to delete device") +device_del_resp = metalv1.DevicesApi( + client).delete_device(new_device_resp.id) +print("Deleted device") diff --git a/examples/hw_reservation_get.py b/examples/hw_reservation_get.py new file mode 100755 index 00000000..dcb750f7 --- /dev/null +++ b/examples/hw_reservation_get.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +# Example of hardware_reservation resource fetch + +import os +import time + +from equinix.services import metalv1 + + +def get_equinix_metal_client(api_token): + conf = metalv1.Configuration( + host="https://api.equinix.com/metal/v1" + ) + conf.api_key['x_auth_token'] = api_token + conf.debug= True + return metalv1.ApiClient(conf) + + +client = get_equinix_metal_client(os.environ["METAL_AUTH_TOKEN"]) +hardware_reservation_id = os.environ["METAL_HARDWARE_RESERVATION_ID"] + + +hwr_api = metalv1.HardwareReservationsApi(client) +resp = hwr_api.find_hardware_reservation_by_id(hardware_reservation_id) + +print(resp) + diff --git a/examples/organization.py b/examples/organization.py new file mode 100755 index 00000000..31f42a8a --- /dev/null +++ b/examples/organization.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +# Example of hardware_reservation resource fetch + +import os +import time + +from equinix.services import metalv1 + + +def get_equinix_metal_client(api_token): + conf = metalv1.Configuration( + host="https://api.equinix.com/metal/v1" + ) + conf.api_key['x_auth_token'] = api_token + conf.debug= True + return metalv1.ApiClient(conf) + + +client = get_equinix_metal_client(os.environ["METAL_AUTH_TOKEN"]) + + +org_api = metalv1.OrganizationsApi(client) +resp = org_api.find_organizations() + +print(resp) + diff --git a/examples/requirements.txt b/examples/requirements.txt new file mode 100644 index 00000000..a61453b2 --- /dev/null +++ b/examples/requirements.txt @@ -0,0 +1 @@ +../equinix_metal diff --git a/patches/services/metalv1/.keep b/patches/services/metalv1/.keep new file mode 100644 index 00000000..e69de29b diff --git a/script/download_spec.sh b/script/download_spec.sh index 7e1dd606..8896bb3f 100755 --- a/script/download_spec.sh +++ b/script/download_spec.sh @@ -38,8 +38,15 @@ function download_file () { for path in $ref_targets do - resolve_relative_path $output_dir/ $current_output_dir/$path - download_file $spec_base_url $output_dir $resolved_path + case $path in + \#*) + echo "Skipping resolution of internal ref '${path}'"; + ;; + *) + resolve_relative_path $output_dir/ $current_output_dir/$path + download_file $spec_base_url $output_dir $resolved_path + ;; + esac done fi } diff --git a/script/patch_metal_spec.py b/script/patch_metal_spec.py new file mode 100755 index 00000000..6e43bd09 --- /dev/null +++ b/script/patch_metal_spec.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python3 + +import yaml +import os +from yaml.loader import FullLoader +import copy +import sys +from collections import OrderedDict + +if len(sys.argv) != 3: + print("Usage: {} ".format(sys.argv[0])) + sys.exit(1) + +INFILE = sys.argv[1] +OUTFILE = sys.argv[2] + + +def setup_yaml(): + """ https://stackoverflow.com/a/8661021 """ + + def represent_dict_order(self, data): return self.represent_mapping( + 'tag:yaml.org,2002:map', data.items()) + yaml.add_representer(OrderedDict, represent_dict_order) + + +setup_yaml() + +def loadYaml(fn): + with open(fn) as f: + return yaml.load(f, Loader=FullLoader) + + +originalSpec = loadYaml(INFILE) + +fixedSpec = copy.deepcopy(originalSpec) + +# FIX 0. organization href to project +fixedSpec['components']['schemas']['Project']['properties']['organization'] = { + "$ref": "#/components/schemas/Href" +} + +# FIX 1. href property to all schemas if they have "properties" and don't already have "href" +for s in fixedSpec['components']['schemas']: + if 'properties' in fixedSpec['components']['schemas'][s]: + if 'href' not in fixedSpec['components']['schemas'][s]['properties']: + fixedSpec['components']['schemas'][s]['properties']['href'] = { + "type": "string", + "format": "uri" + } + +# FIX 2. remove defaults for always_pxe and hardware_reservation_id +fixSchemas = ["DeviceCreateInput"] +removeProperties = ["always_pxe", "hardware_reservation_id"] +for s in fixSchemas: + for p in removeProperties: + if p in fixedSpec['components']['schemas'][s]['properties']: + del fixedSpec['components']['schemas'][s]['properties'][p]['default'] + + +# FIX 5. add backend_transfer_enabled to Project Schema +project_props = fixedSpec['components']['schemas']['Project']['properties'] +project_props['backend_transfer_enabled'] = {'type': 'boolean'} + +# FIX 8. make requested_by mandatory for parsing ip reservation +# .. in order to distinguish from ip assignment and vrf + +fixedSpec['components']['schemas']['IPAssignment']['required'] = [ + 'assigned_to'] + +# FIX 9. make IPReservation assignments href, instead of IPAssignment, +# .. so that it's not parsed as a list of IPAssignments which has mandatory fields + +fixedSpec['components']['schemas']['IPReservation']['properties']['assignments']['items'] = { + "$ref": "#/components/schemas/Href" +} + +# FIX 11. Make all Address parameters non-mandatory + +del fixedSpec['components']['schemas']['Address']['required'] + +# FIX 13. rename query attribute categories to "categories[]" + +plans_get_params = fixedSpec['paths']['/plans']['get']['parameters'] + +for i, p in enumerate(plans_get_params): + if p['name'] == 'categories': + fixedSpec['paths']['/plans']['get']['parameters'][i]['name'] = "categories[]" + break + + + +# Mark paginated operation with `x-equinix-metal-paginated-property` + +refkey = "$ref" + +page_param_marker = 'x-equinix-metal-page-param' + +for opPath, methods in fixedSpec['paths'].items(): + if 'get' not in methods: + continue + getOp = methods['get'] + if 'parameters' not in getOp: + continue + getOpParams = getOp['parameters'] + for i, p in enumerate(getOpParams): + if p['name'] == 'page': + fixedSpec['paths'][opPath]['get']['parameters'][i][page_param_marker] = True + respSchemaPath = getOp['responses']['200']['content']['application/json']['schema'][refkey] + respSchemaName = os.path.basename(respSchemaPath) + oid = getOp['operationId'] + respSchemaProperties = set(fixedSpec['components']['schemas'][respSchemaName]['properties'].keys()) + if 'href' in respSchemaProperties: + respSchemaProperties.remove("href") + if 'meta' in respSchemaProperties: + respSchemaProperties.remove("meta") + else: + print("%s => %s doesn't have 'meta', and therefore no PageNum etc" % (oid, respSchemaName)) + break + if len(respSchemaProperties) > 1: + print("%s => %s has 'page' but ambiguous response type with args %s" % + (oid, respSchemaName, respSchemaProperties)) + break + print("marking %s as paginated" % oid) + fixedSpec['paths'][opPath]['get']['x-equinix-metal-paginated-property'] = respSchemaProperties.pop() + fixedSpec['paths'][opPath]['get']['parameters'][i] + +with open(OUTFILE, 'w') as f: + originalSpec = yaml.dump( + fixedSpec, f, default_flow_style=False) + + +print(INFILE, "was fixed into", OUTFILE) diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/DeviceSearch.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/DeviceSearch.yaml new file mode 100644 index 00000000..0ff7e3c5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/DeviceSearch.yaml @@ -0,0 +1,5 @@ +description: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. +in: query +name: search +schema: + type: string diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/Exclude.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/Exclude.yaml new file mode 100644 index 00000000..dc844437 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/Exclude.yaml @@ -0,0 +1,12 @@ +description: |- + Nested attributes to exclude. Excluded objects will return only the href + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. +in: query +name: exclude +schema: + items: + type: string + type: array +style: form +explode: false diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/Include.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/Include.yaml new file mode 100644 index 00000000..715b84d9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/Include.yaml @@ -0,0 +1,12 @@ +description: |- + Nested attributes to include. Included objects will return their full + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + nested objects. +in: query +name: include +schema: + items: + type: string + type: array +style: form +explode: false diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/Page.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/Page.yaml new file mode 100644 index 00000000..98b2cf73 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/Page.yaml @@ -0,0 +1,9 @@ +description: Page to return +in: query +name: page +schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/PerPage.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/PerPage.yaml new file mode 100644 index 00000000..1d262157 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/PerPage.yaml @@ -0,0 +1,9 @@ +description: Items returned per page +in: query +name: per_page +schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/ProjectName.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/ProjectName.yaml new file mode 100644 index 00000000..f2e0a162 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/ProjectName.yaml @@ -0,0 +1,5 @@ +description: Filter results by name. +in: query +name: name +schema: + type: string diff --git a/spec/services/metalv1/oas3.fetched/components/requestBodies/InterconnectionCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/requestBodies/InterconnectionCreateInput.yaml new file mode 100644 index 00000000..2fc31dfb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/requestBodies/InterconnectionCreateInput.yaml @@ -0,0 +1,19 @@ +content: + application/json: + schema: + oneOf: + - $ref: '../schemas/DedicatedPortCreateInput.yaml' + - $ref: '../schemas/VlanFabricVcCreateInput.yaml' + - $ref: '../schemas/VrfFabricVcCreateInput.yaml' + - $ref: '../schemas/SharedPortVCVlanCreateInput.yaml' + - $ref: '../schemas/VlanCSPConnectionCreateInput.yaml' +description: |- + Dedicated port or shared interconnection (also known as Fabric VC) creation request. + + Shared interconnections can be created with the following request types: + * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly to your Cloud Service Provider. + * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you can finish configuration in Fabric. For new connections, this type is preferred to `VlanFabricVCCreateInput`. + * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can connect through Fabric with a service token. + * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can connect through Fabric with a service token. + +required: true diff --git a/spec/services/metalv1/oas3.fetched/components/requestBodies/InvitationInput.yaml b/spec/services/metalv1/oas3.fetched/components/requestBodies/InvitationInput.yaml new file mode 100644 index 00000000..876f949e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/requestBodies/InvitationInput.yaml @@ -0,0 +1,6 @@ +content: + application/json: + schema: + $ref: '../schemas/InvitationInput.yaml' +description: Invitation to create +required: true \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/requestBodies/PortAssignInput.yaml b/spec/services/metalv1/oas3.fetched/components/requestBodies/PortAssignInput.yaml new file mode 100644 index 00000000..c9e68501 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/requestBodies/PortAssignInput.yaml @@ -0,0 +1,6 @@ +content: + application/json: + schema: + $ref: '../schemas/PortAssignInput.yaml' +description: 'Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: ''1001'').' +required: true \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/requestBodies/SSHKeyCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/requestBodies/SSHKeyCreateInput.yaml new file mode 100644 index 00000000..b93aa52a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/requestBodies/SSHKeyCreateInput.yaml @@ -0,0 +1,6 @@ +content: + application/json: + schema: + $ref: '../schemas/SSHKeyCreateInput.yaml' +description: ssh key to create +required: true \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/AWSFabricProvider.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/AWSFabricProvider.yaml new file mode 100644 index 00000000..2ca58242 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/AWSFabricProvider.yaml @@ -0,0 +1,16 @@ +properties: + type: + type: string + enum: + - "CSP_AWS" + account_id: + type: string + description: "AWS Account ID" + example: "123412341234" + pattern: '^\d{12}$' + location: + type: string + example: "us-west-1" +required: +- type +- account_id diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Address.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Address.yaml new file mode 100644 index 00000000..7cbab354 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Address.yaml @@ -0,0 +1,20 @@ +properties: + address: + type: string + address2: + type: string + city: + type: string + coordinates: + $ref: './Coordinates.yaml' + country: + type: string + state: + type: string + zip_code: + type: string +required: +- address +- zip_code +- country +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Attribute.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Attribute.yaml new file mode 100644 index 00000000..fdd3bcde --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Attribute.yaml @@ -0,0 +1,17 @@ +properties: + namespace: + readOnly: true + type: string + description: Attribute namespace + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. + data: + $ref: "./AttributeData.yaml" diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/AttributeData.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/AttributeData.yaml new file mode 100644 index 00000000..bba3c908 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/AttributeData.yaml @@ -0,0 +1,17 @@ +properties: + latest: + readOnly: true + type: boolean + description: Boolean flag to know if the firmware set is the latest for the model and vendor + model: + readOnly: true + type: string + description: Model on which this firmware set can be applied + vendor: + readOnly: true + type: string + description: Vendor on which this firmware set can be applied + plan: + readOnly: true + type: string + description: Plan where the firmware set can be applied diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/AuthToken.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/AuthToken.yaml new file mode 100644 index 00000000..8a43219c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/AuthToken.yaml @@ -0,0 +1,26 @@ +properties: + created_at: + format: date-time + type: string + description: + description: Available only for API keys + type: string + id: + format: uuid + type: string + project: + allOf: + - $ref: './Project.yaml' + - description: Available only for project tokens + read_only: + type: boolean + token: + type: string + updated_at: + format: date-time + type: string + user: + allOf: + - $ref: './User.yaml' + - description: Available only for user tokens +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenInput.yaml new file mode 100644 index 00000000..203a139e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenInput.yaml @@ -0,0 +1,6 @@ +properties: + description: + type: string + read_only: + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenList.yaml new file mode 100644 index 00000000..c99752f6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenList.yaml @@ -0,0 +1,6 @@ +properties: + api_keys: + items: + $ref: './AuthToken.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BGPSessionInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BGPSessionInput.yaml new file mode 100644 index 00000000..a06baae8 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BGPSessionInput.yaml @@ -0,0 +1,13 @@ +properties: + address_family: + description: Address family for BGP session. + enum: + - ipv4 + - ipv6 + example: ipv4 + type: string + default_route: + default: false + description: Set the default route policy. + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Batch.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Batch.yaml new file mode 100644 index 00000000..919aa209 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Batch.yaml @@ -0,0 +1,25 @@ +properties: + created_at: + format: date-time + type: string + devices: + items: + $ref: './Href.yaml' + type: array + error_messages: + items: + type: string + type: array + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + quantity: + type: integer + state: + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BatchesList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BatchesList.yaml new file mode 100644 index 00000000..0da8f68b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BatchesList.yaml @@ -0,0 +1,6 @@ +properties: + batches: + items: + $ref: './Batch.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfig.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfig.yaml new file mode 100644 index 00000000..81e0cd90 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfig.yaml @@ -0,0 +1,63 @@ +properties: + asn: + description: Autonomous System Number. ASN is required with Global BGP. With Local + BGP the private ASN, 65000, is assigned. + example: 65000 + minimum: 0 + maximum: 4294967295 + format: int64 + type: integer + created_at: + format: date-time + type: string + deployment_type: + description: | + In a Local BGP deployment, a customer uses an internal ASN to control routes within a single Equinix Metal datacenter. This means that the routes are never advertised to the global Internet. Global BGP, on the other hand, requires a customer to have a registered ASN and IP space. + enum: + - global + - local + example: local + type: string + href: + type: string + id: + format: uuid + type: string + max_prefix: + default: 10 + description: The maximum number of route filters allowed per server + type: integer + md5: + description: (Optional) Password for BGP session in plaintext (not a checksum) + nullable: true + type: string + project: + $ref: './Href.yaml' + ranges: + description: The IP block ranges associated to the ASN (Populated in Global BGP + only) + items: + $ref: './GlobalBgpRange.yaml' + type: array + requested_at: + format: date-time + type: string + route_object: + description: Specifies AS-MACRO (aka AS-SET) to use when building client route + filters + type: string + sessions: + description: The direct connections between neighboring routers that want to exchange + routing information. + items: + $ref: './BgpSession.yaml' + type: array + status: + description: Status of the BGP Config. Status "requested" is valid only with the + "global" deployment_type. + enum: + - requested + - enabled + - disabled + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfigRequestInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfigRequestInput.yaml new file mode 100644 index 00000000..b7342df8 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfigRequestInput.yaml @@ -0,0 +1,31 @@ +properties: + asn: + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + description: Autonomous System Number for local BGP deployment. + example: 65000 + deployment_type: + description: Wether the BGP deployment is local or global. Local deployments are configured immediately. Global deployments will need to be reviewed by Equinix Metal engineers. + type: string + example: local + enum: + - local + - global + md5: + type: string + description: | + The plaintext password to share between BGP neighbors as an MD5 checksum: + * must be 10-20 characters long + * may not include punctuation + * must be a combination of numbers and letters + * must contain at least one lowercase, uppercase, and digit character + pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$' + use_case: + description: A use case explanation (necessary for global BGP request review). + type: string +required: +- deployment_type +- asn +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighbor.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighbor.yaml new file mode 100644 index 00000000..eeec59aa --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighbor.yaml @@ -0,0 +1,46 @@ +properties: + id: + description: The unique identifier for the resource + format: uuid + readOnly: true + type: string + example: aea82f16-57ec-412c-9523-b7f2b27635b2 + bgp_neighbor_asn: + description: The ASN of the dynamic BGP neighbor + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 12345 + bgp_neighbor_range: + description: Network range of the dynamic BGP neighbor in CIDR format + type: string + example: 192.168.1.0/25 + metal_gateway: + $ref: './VrfMetalGateway.yaml' + state: + readOnly: true + type: string + enum: + - active + - deleting + - pending + - ready + href: + type: string + readOnly: true + example: /bgp-dynamic-neighbors/aea82f16-57ec-412c-9523-b7f2b27635b2 + created_at: + format: date-time + readOnly: true + type: string + created_by: + $ref: './UserLimited.yaml' + updated_at: + format: date-time + readOnly: true + type: string + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborCreateInput.yaml new file mode 100644 index 00000000..40347f6a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborCreateInput.yaml @@ -0,0 +1,19 @@ +properties: + bgp_neighbor_range: + description: Network range of the dynamic BGP neighbor in CIDR format + type: string + example: 192.168.1.0/25 + bgp_neighbor_asn: + description: The ASN of the dynamic BGP neighbor + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 12345 + tags: + items: + type: string + type: array +required: +- bgp_neighbor_range +- bgp_neighbor_asn diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborList.yaml new file mode 100644 index 00000000..69e368a3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborList.yaml @@ -0,0 +1,8 @@ +properties: + bgp_dynamic_neighbors: + items: + $ref: './BgpDynamicNeighbor.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpNeighborData.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpNeighborData.yaml new file mode 100644 index 00000000..8914ad1a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpNeighborData.yaml @@ -0,0 +1,61 @@ +properties: + address_family: + description: Address Family for IP Address. Accepted values are 4 or 6 + example: 4 + format: int32 + type: integer + customer_as: + description: The customer's ASN. In a local BGP deployment, this will be an internal + ASN used to route within the data center. For a global BGP deployment, this + will be the your own ASN, configured when you set up BGP for your project. + example: 65000 + format: int32 + type: integer + customer_ip: + description: The device's IP address. For an IPv4 BGP session, this is typically + the private bond0 address for the device. + example: 10.32.16.1 (IPv4) or 2604:1380:4111:2700::1 (IPv6) + type: string + md5_enabled: + description: True if an MD5 password is configured for the project. + type: boolean + md5_password: + description: The MD5 password configured for the project, if set. + type: string + multihop: + description: True when the BGP session should be configured as multihop. + type: boolean + peer_as: + description: The Peer ASN to use when configuring BGP on your device. + example: 65530 + format: int32 + type: integer + peer_ips: + description: A list of one or more IP addresses to use for the Peer IP section + of your BGP configuration. For non-multihop sessions, this will typically be + a single gateway address for the device. For multihop sessions, it will be a + list of IPs. + example: + - 169.254.255.1 + - 169.254.255.2 + items: + type: string + type: array + routes_in: + description: A list of project subnets + example: + - exact: true + route: 10.32.16.0/31 + items: + $ref: "./BgpRoute.yaml" + type: array + routes_out: + description: A list of outgoing routes. Only populated if the BGP session has + default route enabled. + example: + - exact: true + route: 0.0.0.0/0 + items: + $ref: "./BgpRoute.yaml" + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpRoute.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpRoute.yaml new file mode 100644 index 00000000..18d325c3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpRoute.yaml @@ -0,0 +1,6 @@ +properties: + exact: + type: boolean + route: + example: 10.32.16.0/31 + type: string diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpSession.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSession.yaml new file mode 100644 index 00000000..6e073419 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSession.yaml @@ -0,0 +1,38 @@ +properties: + address_family: + enum: + - ipv4 + - ipv6 + type: string + created_at: + format: date-time + type: string + default_route: + type: boolean + device: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + learned_routes: + items: + description: IPv4 or IPv6 range + example: 10.32.16.0/31 + type: string + type: array + status: + description: ' The status of the BGP Session. Multiple status values may be reported + when the device is connected to multiple switches, one value per switch. Each + status will start with "unknown" and progress to "up" or "down" depending on + the connected device. Subsequent "unknown" values indicate a problem acquiring + status from the switch. ' + type: string + example: up,down + updated_at: + format: date-time + type: string +required: +- address_family +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionList.yaml new file mode 100644 index 00000000..78bcbcb6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionList.yaml @@ -0,0 +1,6 @@ +properties: + bgp_sessions: + items: + $ref: './BgpSession.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionNeighbors.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionNeighbors.yaml new file mode 100644 index 00000000..11bc4c5e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionNeighbors.yaml @@ -0,0 +1,7 @@ +properties: + bgp_neighbors: + description: A list of BGP session neighbor data + items: + $ref: './BgpNeighborData.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BondPortData.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BondPortData.yaml new file mode 100644 index 00000000..da6a03d7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BondPortData.yaml @@ -0,0 +1,9 @@ +properties: + id: + description: ID of the bonding port + type: string + format: uuid + name: + description: Name of the port interface for the bond ("bond0") + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityInfo.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityInfo.yaml new file mode 100644 index 00000000..e970ec63 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityInfo.yaml @@ -0,0 +1,10 @@ +properties: + available: + type: boolean + facility: + type: string + plan: + type: string + quantity: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityList.yaml new file mode 100644 index 00000000..530332a2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityList.yaml @@ -0,0 +1,6 @@ +properties: + servers: + items: + $ref: './CapacityCheckPerFacilityInfo.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroInfo.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroInfo.yaml new file mode 100644 index 00000000..2fb51ba2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroInfo.yaml @@ -0,0 +1,15 @@ +properties: + available: + description: Returns true if there is enough capacity in the metro to fulfill + the quantity set. Returns false if there is not enough. + type: boolean + metro: + description: The metro ID or code sent to check capacity. + type: string + plan: + description: The plan ID or slug sent to check capacity. + type: string + quantity: + description: The number of servers sent to check capacity. + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroList.yaml new file mode 100644 index 00000000..9ec1ecc1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroList.yaml @@ -0,0 +1,6 @@ +properties: + servers: + items: + $ref: './CapacityCheckPerMetroInfo.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityInput.yaml new file mode 100644 index 00000000..c1a02be0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityInput.yaml @@ -0,0 +1,6 @@ +properties: + servers: + items: + $ref: './ServerInfo.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityLevelPerBaremetal.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityLevelPerBaremetal.yaml new file mode 100644 index 00000000..c8ec393f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityLevelPerBaremetal.yaml @@ -0,0 +1,5 @@ +properties: + level: + type: string + available_servers: integer +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityList.yaml new file mode 100644 index 00000000..ecc3f627 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityList.yaml @@ -0,0 +1,4 @@ +properties: + capacity: + $ref: './CapacityReport.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityReport.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityReport.yaml new file mode 100644 index 00000000..7af91e6b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityReport.yaml @@ -0,0 +1,5 @@ +additionalProperties: + type: object + additionalProperties: + $ref: './CapacityLevelPerBaremetal.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Component.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Component.yaml new file mode 100644 index 00000000..efce1ccc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Component.yaml @@ -0,0 +1,55 @@ +properties: + uuid: + readOnly: true + type: string + description: Component UUID + format: uuid + example: "0516463a-47ee-4809-9a66-ece8c740eed9" + vendor: + readOnly: true + type: string + description: Component vendor + example: "equinix" + model: + readOnly: true + type: array + description: List of models where this component version can be applied + items: + type: string + example: romed8hm3 + filename: + readOnly: true + type: string + description: name of the file + version: + readOnly: true + type: string + description: Version of the component + example: 1.5.0 + component: + readOnly: true + type: string + description: Component type + example: bmc + checksum: + readOnly: true + type: string + description: File checksum + upstream_url: + readOnly: true + type: string + description: Location of the file + repository_url: + readOnly: true + type: string + description: Location of the file in the repository + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Coordinates.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Coordinates.yaml new file mode 100644 index 00000000..036c6627 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Coordinates.yaml @@ -0,0 +1,6 @@ +properties: + latitude: + type: string + longitude: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CreateEmailInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CreateEmailInput.yaml new file mode 100644 index 00000000..5aa749bd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CreateEmailInput.yaml @@ -0,0 +1,6 @@ +properties: + address: + type: string +required: +- address +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CreateSelfServiceReservationRequest.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CreateSelfServiceReservationRequest.yaml new file mode 100644 index 00000000..84e9138c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CreateSelfServiceReservationRequest.yaml @@ -0,0 +1,23 @@ +properties: + item: + items: + $ref: './SelfServiceReservationItemRequest.yaml' + type: array + notes: + type: string + period: + properties: + count: + enum: + - 12 + - 36 + type: integer + unit: + enum: + - monthly + type: string + type: object + start_date: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DedicatedPortCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DedicatedPortCreateInput.yaml new file mode 100644 index 00000000..c8ad3aff --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DedicatedPortCreateInput.yaml @@ -0,0 +1,56 @@ +properties: + billing_account_name: + description: The billing account name of the Equinix Fabric account. + type: string + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. + type: string + format: email + description: + type: string + facility_id: + type: string + x-deprecated: true + metro: + description: A Metro ID or code. For interconnections with Dedicated Ports, this will be the location of the issued Dedicated Ports. + type: string + mode: + description: |- + The mode of the interconnection (only relevant to Dedicated Ports). Fabric VCs 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. + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Dedicated Ports, this can be 10Gbps or 100Gbps. + type: string + example: 10000000000 + tags: + items: + type: string + type: array + type: + description: When requesting for a dedicated port, the value of this field should be 'dedicated'. + type: string + enum: + - dedicated + use_case: + description: The intended use case of the dedicated port. + type: string +required: +- name +- metro +- type +- redundancy +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Device.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Device.yaml new file mode 100644 index 00000000..120e1583 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Device.yaml @@ -0,0 +1,179 @@ +properties: + always_pxe: + type: boolean + billing_cycle: + type: string + bonding_mode: + type: integer + created_at: + format: date-time + type: string + created_by: + allOf: + - $ref: './UserLite.yaml' + - description: The user that created the device. + customdata: + default: {} + type: object + additionalProperties: true + description: + type: string + facility: + $ref: './Facility.yaml' + firmware_set_id: + description: The UUID of the firmware set to associate with the device. + format: uuid + type: string + hardware_reservation: + $ref: './HardwareReservation.yaml' + hostname: + type: string + href: + type: string + id: + format: uuid + type: string + image_url: + type: string + ip_addresses: + items: + $ref: './IPAssignment.yaml' + type: array + ipxe_script_url: + type: string + iqn: + type: string + locked: + type: boolean + description: Prevents accidental deletion of this resource when set to true. + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the facility is in + network_frozen: + type: boolean + description: Whether network mode changes such as converting to/from Layer2 or Layer3 networking, bonding or disbonding network interfaces are permitted for the device. + network_ports: + description: + By default, servers at Equinix Metal are configured in a “bonded” mode + using LACP (Link Aggregation Control Protocol). Each 2-NIC server is + configured with a single bond (namely bond0) with both interfaces eth0 + and eth1 as members of the bond in a default Layer 3 mode. Some device + plans may have a different number of ports and bonds available. + type: array + items: + $ref: './Port.yaml' + operating_system: + $ref: './OperatingSystem.yaml' + actions: + description: Actions supported by the device instance. + items: + properties: + type: + type: string + name: + type: string + type: object + type: array + plan: + $ref: './Plan.yaml' + project: + $ref: './Project.yaml' + project_lite: + allOf: + - $ref: './Href.yaml' + - description: Lite version of project object when included + provisioning_events: + items: + $ref: './Event.yaml' + type: array + provisioning_percentage: + description: Only visible while device provisioning + format: float + type: number + root_password: + description: Root password is automatically generated when server is provisioned + and it is removed after 24 hours + type: string + short_id: + type: string + spot_instance: + description: Whether or not the device is a spot instance. + type: boolean + spot_price_max: + description: |- + The maximum price per hour you are willing to pay to keep this spot + instance. If you are outbid, the termination will be set allowing two + minutes before shutdown. + format: float + type: number + ssh_keys: + items: + $ref: './Href.yaml' + type: array + state: + type: string + enum: + - queued + - provisioning + - deprovisioning + - reinstalling + - active + - inactive + - failed + - powering_on + - powering_off + - deleted + description: |- + The current state the instance is in. + + * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. + * Once provisioning has begun on the instance it's state will move to `provisioning`. + * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. + * If an instance fails to provision or deprovision it will move to `failed` state. + * Once an instance has completed provisioning it will move to `active` state. + * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. + * When the instance is powered off completely it will move to the `inactive` state. + * When an instance is powered on completely it will move to the `active` state. + * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. + * When the reinstall action is complete the instance will move to `active` state. + storage: + $ref: './Storage.yaml' + switch_uuid: + description: |- + Switch short id. This can be used to determine if two devices are + connected to the same switch, for example. + type: string + tags: + items: + type: string + type: array + termination_time: + description: |- + When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. + + This is commonly set in advance for + ephemeral spot market instances but this field may also be set with + on-demand and reservation instances to automatically delete the resource + at a given time. The termination time can also be used to release a + hardware reservation instance at a given time, keeping the reservation + open for other uses. On a spot market device, the termination time will + be set automatically when outbid. + format: date-time + example: "2021-09-03T16:32:00+03:00" + type: string + updated_at: + format: date-time + type: string + user: + type: string + userdata: + type: string + volumes: + items: + $ref: './Href.yaml' + type: array + sos: + description: Hostname used to connect to the instance via the SOS (Serial over SSH) out-of-band console. + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceActionInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceActionInput.yaml new file mode 100644 index 00000000..671b5974 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceActionInput.yaml @@ -0,0 +1,30 @@ +type: object +required: +- type +properties: + type: + description: Action to perform. See Device.actions for possible actions. + type: string + enum: + - power_on + - power_off + - reboot + - rescue + - reinstall + force_delete: + description: May be required to perform actions under certain conditions + type: boolean + deprovision_fast: + description: When type is `reinstall`, enabling fast deprovisioning will bypass full disk wiping. + type: boolean + preserve_data: + description: When type is `reinstall`, preserve the existing data on all disks except the operating-system disk. + type: boolean + operating_system: + description: When type is `reinstall`, use this `operating_system` (defaults to the current `operating system`) + type: string + example: ubuntu_22_04 + ipxe_script_url: + description: When type is `reinstall`, use this `ipxe_script_url` (`operating_system` must be `custom_ipxe`, defaults to the current `ipxe_script_url`) + type: string + diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInFacilityInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInFacilityInput.yaml new file mode 100644 index 00000000..655100bb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInFacilityInput.yaml @@ -0,0 +1,3 @@ +allOf: +- $ref: './FacilityInput.yaml' +- $ref: './DeviceCreateInput.yaml' \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInMetroInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInMetroInput.yaml new file mode 100644 index 00000000..90c69ecd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInMetroInput.yaml @@ -0,0 +1,3 @@ +allOf: +- $ref: './MetroInput.yaml' +- $ref: './DeviceCreateInput.yaml' diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInput.yaml new file mode 100644 index 00000000..ed4c776d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInput.yaml @@ -0,0 +1,211 @@ +properties: + always_pxe: + default: false + 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. + type: boolean + billing_cycle: + description: The billing cycle of the device. + enum: + - hourly + - daily + - monthly + - yearly + type: string + customdata: + description: |- + Customdata is an arbitrary JSON value that can be accessed via the + metadata service. + default: {} + type: object + additionalProperties: true + description: + description: |- + Any description of the device or how it will be used. This may be used + to inform other API consumers with project access. + type: string + features: + description: |- + 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. + items: + type: string + type: array + hardware_reservation_id: + default: "" + description: |- + 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. + example: next-available + type: string + hostname: + description: The hostname to use within the operating system. The same hostname + may be used on multiple devices within a project. + type: string + ip_addresses: + default: + - address_family: 4 + public: true + - address_family: 4 + public: false + - address_family: 6 + public: true + description: |- + 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. + items: + $ref: './IPAddress.yaml' + type: array + ipxe_script_url: + description: |- + 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. + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/operating-systems/custom-ipxe/ + type: string + locked: + default: false + description: Whether the device should be locked, preventing accidental deletion. + type: boolean + network_frozen: + description: If true, this instance can not be converted to a different network + type. + type: boolean + no_ssh_keys: + default: false + description: Overrides default behaviour of attaching all of the organization + members ssh keys and project ssh keys to device if no specific keys specified + type: boolean + operating_system: + description: The slug of the operating system to provision. Check the Equinix + Metal operating system documentation for rules that may be imposed per operating + system, including restrictions on IP address options and device plans. + type: string + plan: + description: The slug of the device plan to provision. + type: string + example: "c3.large.x86" + private_ipv4_subnet_size: + description: Deprecated. Use ip_addresses. Subnet range for addresses allocated + to this device. + format: int32 + type: integer + x-deprecated: true + project_ssh_keys: + description: |+ + A list of UUIDs identifying the device parent project + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. + + If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), + all parent project keys, parent project members keys and organization members keys will be included. This behaviour can + be changed with 'no_ssh_keys' option to omit any SSH key being added. + items: + format: uuid + type: string + type: array + public_ipv4_subnet_size: + description: Deprecated. Use ip_addresses. Subnet range for addresses allocated + to this device. Your project must have addresses available for a non-default + request. + format: int32 + type: integer + x-deprecated: true + spot_instance: + type: boolean + description: Create a spot instance. Spot instances are created with a maximum + bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. + spot_price_max: + format: float + type: number + example: 1.23 + description: The maximum amount to bid for a spot instance. + ssh_keys: + description: | + A list of new or existing project ssh_keys + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also + appear in the device metadata. + + These keys are added in addition to any keys defined by + `project_ssh_keys` and `user_ssh_keys`. + items: + $ref: './SSHKeyInput.yaml' + type: array + storage: + $ref: './Storage.yaml' + tags: + items: + type: string + type: array + termination_time: + description: | + When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. + + This is commonly set in advance for + ephemeral spot market instances but this field may also be set with + on-demand and reservation instances to automatically delete the resource + at a given time. The termination time can also be used to release a + hardware reservation instance at a given time, keeping the reservation + open for other uses. On a spot market device, the termination time will + be set automatically when outbid. + format: date-time + example: "2021-09-03T16:32:00+03:00" + type: string + user_ssh_keys: + description: | + A list of UUIDs identifying the users + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also + appear in the device metadata. + + The users must be members of the project or organization. + + If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), + all parent project keys, parent project members keys and organization members keys will be included. This behaviour can + be changed with 'no_ssh_keys' option to omit any SSH key being added. + items: + format: uuid + type: string + type: array + userdata: + 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. + type: string + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/server-metadata/user-data/ +required: +- plan +- operating_system diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceHealthRollup.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceHealthRollup.yaml new file mode 100644 index 00000000..7396b72d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceHealthRollup.yaml @@ -0,0 +1,16 @@ +properties: + health_rollup: + readOnly: true + type: string + description: Health Status + enum: + - ok + - warning + - critical + updated_at: + readOnly: true + type: string + format: date-time + description: Last update of health status. +type: object +description: Represents a Device Health Status diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceList.yaml new file mode 100644 index 00000000..ca171496 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceList.yaml @@ -0,0 +1,8 @@ +properties: + devices: + items: + $ref: './Device.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUpdateInput.yaml new file mode 100644 index 00000000..35a8aec1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUpdateInput.yaml @@ -0,0 +1,36 @@ +properties: + always_pxe: + type: boolean + billing_cycle: + type: string + customdata: + default: {} + type: object + additionalProperties: true + description: + type: string + hostname: + type: string + firmware_set_id: + type: string + ipxe_script_url: + type: string + locked: + type: boolean + description: Whether the device should be locked, preventing accidental deletion. + network_frozen: + description: If true, this instance can not be converted to a different network + type. + type: boolean + spot_instance: + type: boolean + description: Can be set to false to convert a spot-market instance to on-demand. + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/spot-market/#converting-a-spot-market-server-to-on-demand + tags: + items: + type: string + type: array + userdata: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsage.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsage.yaml new file mode 100644 index 00000000..6968295c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsage.yaml @@ -0,0 +1,8 @@ +properties: + quantity: + type: string + total: + type: string + unit: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsageList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsageList.yaml new file mode 100644 index 00000000..d266838b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsageList.yaml @@ -0,0 +1,6 @@ +properties: + usages: + items: + $ref: './DeviceUsage.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Disk.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Disk.yaml new file mode 100644 index 00000000..3a8b9237 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Disk.yaml @@ -0,0 +1,10 @@ +properties: + device: + type: string + wipeTable: + type: boolean + partitions: + items: + $ref: './Partition.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Email.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Email.yaml new file mode 100644 index 00000000..9b420b33 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Email.yaml @@ -0,0 +1,13 @@ +properties: + address: + type: string + default: + type: boolean + href: + type: string + id: + format: uuid + type: string + verified: + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/EmailInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/EmailInput.yaml new file mode 100644 index 00000000..7563066d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/EmailInput.yaml @@ -0,0 +1,8 @@ +properties: + address: + type: string + default: + type: boolean +required: +- address +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Entitlement.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Entitlement.yaml new file mode 100644 index 00000000..c8bde23b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Entitlement.yaml @@ -0,0 +1,32 @@ +properties: + description: + type: string + feature_access: + type: object + href: + type: string + id: + format: uuid + type: string + instance_quota: + type: object + ip_quota: + type: object + name: + type: string + project_quota: + default: 0 + type: integer + slug: + type: string + volume_limits: + type: object + volume_quota: + type: object + weight: + type: integer +required: +- id +- slug +- weight +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Error.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Error.yaml new file mode 100644 index 00000000..f940b13d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Error.yaml @@ -0,0 +1,13 @@ +description: Error responses are included with 4xx and 5xx HTTP responses from the + API service. Either "error" or "errors" will be set. +properties: + error: + description: A description of the error that caused the request to fail. + type: string + errors: + description: A list of errors that contributed to the request failing. + items: + description: An error message that contributed to the request failing. + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Event.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Event.yaml new file mode 100644 index 00000000..9f4effd2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Event.yaml @@ -0,0 +1,26 @@ +properties: + body: + type: string + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + interpolated: + type: string + relationships: + items: + $ref: './Href.yaml' + type: array + state: + type: string + type: + type: string + modified_by: + type: object + ip: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/EventList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/EventList.yaml new file mode 100644 index 00000000..75b2d4c5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/EventList.yaml @@ -0,0 +1,8 @@ +properties: + events: + items: + $ref: './Event.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FabricServiceToken.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FabricServiceToken.yaml new file mode 100644 index 00000000..54d2d97f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FabricServiceToken.yaml @@ -0,0 +1,49 @@ +properties: + expires_at: + description: The expiration date and time of the Fabric service token. Once a + service token is expired, it is no longer redeemable. + format: date-time + type: string + id: + description: |- + The UUID that can be used on the Fabric Portal to redeem either an A-Side or Z-Side Service Token. + For Fabric VCs (Metal Billed), this UUID will represent an A-Side Service Token, which will allow interconnections + to be made from Equinix Metal to other Service Providers on Fabric. For Fabric VCs (Fabric Billed), this UUID will + represent a Z-Side Service Token, which will allow interconnections to be made to connect an owned Fabric Port or + Virtual Device to Equinix Metal. + format: uuid + type: string + max_allowed_speed: + description: |- + The maximum speed that can be selected on the Fabric Portal when configuring a interconnection with either + an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this is what the billing is based off of, and can be one + of the following options, '50mbps', '200mbps', '500mbps', '1gbps', '2gbps', '5gbps' or '10gbps'. For Fabric VCs + (Fabric Billed), this will default to 10Gbps. + type: integer + format: int64 + example: 10000000000 + role: + description: Either primary or secondary, depending on which interconnection the service token is associated to. + enum: + - primary + - secondary + type: string + service_token_type: + description: Either 'a_side' or 'z_side', depending on which type of Fabric VC was requested. + enum: + - a_side + - z_side + type: string + state: + description: |- + The state of the service token that corresponds with the service + token state on Fabric. An 'inactive' state refers to a token that has not been + redeemed yet on the Fabric side, an 'active' state refers to a token that has + already been redeemed, and an 'expired' state refers to a token that has reached + its expiry time. + enum: + - inactive + - active + - expired + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Facility.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Facility.yaml new file mode 100644 index 00000000..dd0203c4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Facility.yaml @@ -0,0 +1,37 @@ +properties: + address: + $ref: './Address.yaml' + code: + type: string + features: + example: + - baremetal + - backend_transfer + - global_ipv4 + items: + enum: + - baremetal + - backend_transfer + - layer_2 + - global_ipv4 + - ibx + type: string + type: array + id: + format: uuid + type: string + ip_ranges: + description: IP ranges registered in facility. Can be used for GeoIP location + example: + - 2604:1380::/36 + - 147.75.192.0/21 + items: + type: string + type: array + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the facility is in + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FacilityInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FacilityInput.yaml new file mode 100644 index 00000000..bd9b215c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FacilityInput.yaml @@ -0,0 +1,20 @@ +required: + - facility +properties: + facility: + deprecated: true + description: |- + The datacenter where the device should be created. + + Either metro or facility must be provided. + + The API will accept either a single facility `{ "facility": "f1" }`, or it can be instructed to create the device in the best available datacenter `{ "facility": "any" }`. + + Additionally it is possible to set a prioritized location selection. For example `{ "facility": ["f3", "f2", "any"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. + anyOf: + - type: array + items: + type: string + example: ["sv15"] + - type: string + example: "any" \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FacilityList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FacilityList.yaml new file mode 100644 index 00000000..f7a4af1a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FacilityList.yaml @@ -0,0 +1,6 @@ +properties: + facilities: + items: + $ref: './Facility.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Filesystem.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Filesystem.yaml new file mode 100644 index 00000000..d309cba1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Filesystem.yaml @@ -0,0 +1,4 @@ +properties: + mount: + $ref: './Mount.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSet.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSet.yaml new file mode 100644 index 00000000..2d8bf7cb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSet.yaml @@ -0,0 +1,36 @@ +properties: + uuid: + readOnly: true + type: string + description: Firmware Set UUID + format: uuid + example: "0516463a-47ee-4809-9a66-ece8c740eed9" + name: + readOnly: true + type: string + description: Firmware Set Name + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. + attributes: + type: array + description: Represents a list of attributes + items: + $ref: "./Attribute.yaml" + component_firmware: + type: array + description: List of components versions + items: + $ref: "./Component.yaml" +required: + - uuid + - name +type: object +description: Represents a Firmware Set diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetList.yaml new file mode 100644 index 00000000..7e9fe5ee --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetList.yaml @@ -0,0 +1,4 @@ +type: array +description: Represents a list of FirmwareSets +items: + $ref: "./FirmwareSet.yaml" diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetListResponse.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetListResponse.yaml new file mode 100644 index 00000000..47d81795 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetListResponse.yaml @@ -0,0 +1,20 @@ +type: object +description: Represents collection of Firmware Sets +properties: + page_size: + description: Max number of items returned in a page + type: integer + page: + description: Page returned + type: integer + page_count: + description: Items returned in current page + type: integer + total_pages: + description: Total count of pages + type: integer + total_record_count: + description: Total count of items + type: integer + records: + $ref: "./FirmwareSetList.yaml" diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetResponse.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetResponse.yaml new file mode 100644 index 00000000..adb43e43 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetResponse.yaml @@ -0,0 +1,5 @@ +type: object +description: Represents single Firmware set response +properties: + record: + $ref: "./FirmwareSet.yaml" diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRange.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRange.yaml new file mode 100644 index 00000000..ac2eaa3b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRange.yaml @@ -0,0 +1,13 @@ +properties: + address_family: + type: integer + href: + type: string + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + range: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRangeList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRangeList.yaml new file mode 100644 index 00000000..a0bd661e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRangeList.yaml @@ -0,0 +1,6 @@ +properties: + global_bgp_ranges: + items: + $ref: './GlobalBgpRange.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservation.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservation.yaml new file mode 100644 index 00000000..59aa31ff --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservation.yaml @@ -0,0 +1,46 @@ +properties: + created_at: + format: date-time + type: string + custom_rate: + description: Amount that will be charged for every billing_cycle. + example: 1050.5 + format: float + type: number + device: + $ref: './Device.yaml' + facility: + $ref: './Facility.yaml' + href: + type: string + id: + format: uuid + type: string + need_of_service: + description: Whether this Device requires assistance from Equinix Metal. + type: boolean + plan: + $ref: './Plan.yaml' + project: + $ref: './Project.yaml' + provisionable: + description: Whether the reserved server is provisionable or not. Spare devices + can't be provisioned unless they are activated first. + type: boolean + short_id: + description: Short version of the ID. + format: string + type: string + spare: + description: Whether the Hardware Reservation is a spare. Spare Hardware Reservations + are used when a Hardware Reservations requires service from Equinix Metal + type: boolean + switch_uuid: + description: Switch short id. This can be used to determine if two devices are + connected to the same switch, for example. + type: string + termination_time: + description: Expiration date for the reservation. + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservationList.yaml new file mode 100644 index 00000000..1ffd5b75 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservationList.yaml @@ -0,0 +1,8 @@ +properties: + hardware_reservations: + items: + $ref: './HardwareReservation.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Href.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Href.yaml new file mode 100644 index 00000000..bbe7e220 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Href.yaml @@ -0,0 +1,6 @@ +properties: + href: + type: string +required: +- href +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAddress.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAddress.yaml new file mode 100644 index 00000000..90e98687 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAddress.yaml @@ -0,0 +1,27 @@ +properties: + address_family: + description: Address Family for IP Address + enum: + - 4 + - 6 + example: 4 + format: int32 + type: integer + cidr: + description: Cidr Size for the IP Block created. Valid values depends on + the operating system being provisioned. (28..32 for IPv4 addresses, 124..127 + for IPv6 addresses) + example: 28 + format: int32 + type: integer + ip_reservations: + description: UUIDs of any IP reservations to use when assigning IPs + items: + type: string + type: array + public: + default: true + description: Address Type for IP Address + example: false + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignment.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignment.yaml new file mode 100644 index 00000000..efce269a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignment.yaml @@ -0,0 +1,57 @@ +properties: + address: + type: string + address_family: + type: integer + assigned_to: + $ref: './Href.yaml' + cidr: + type: integer + created_at: + format: date-time + type: string + enabled: + type: boolean + gateway: + type: string + global_ip: + type: boolean + href: + type: string + id: + format: uuid + type: string + manageable: + type: boolean + management: + type: boolean + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the IP address is in + netmask: + type: string + network: + type: string + parent_block: + $ref: './ParentBlock.yaml' + public: + type: boolean + state: + type: string + enum: + - pending + - active + - deleting + description: | + Only set when this is a Metal Gateway Elastic IP Assignment. + + Describes the current configuration state of this IP on the network. + next_hop: + type: string + format: ipv4 + description: | + Only set when this is a Metal Gateway Elastic IP Assignment. + + The IP address within the Metal Gateway to which requests to the Elastic IP are forwarded. +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentInput.yaml new file mode 100644 index 00000000..90efc5ee --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentInput.yaml @@ -0,0 +1,8 @@ +properties: + address: + type: string + customdata: + type: object +required: +- address +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentList.yaml new file mode 100644 index 00000000..94f11aeb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentList.yaml @@ -0,0 +1,6 @@ +properties: + ip_addresses: + items: + $ref: './IPAssignment.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentUpdateInput.yaml new file mode 100644 index 00000000..47556d84 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentUpdateInput.yaml @@ -0,0 +1,10 @@ +properties: + details: + type: string + customdata: + type: object + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAvailabilitiesList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAvailabilitiesList.yaml new file mode 100644 index 00000000..1bb6642f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAvailabilitiesList.yaml @@ -0,0 +1,6 @@ +properties: + available: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPReservation.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservation.yaml new file mode 100644 index 00000000..848adb57 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservation.yaml @@ -0,0 +1,83 @@ +properties: + addon: + type: boolean + address: + type: string + address_family: + type: integer + assignments: + items: + $ref: './IPAssignment.yaml' + type: array + available: + type: string + bill: + type: boolean + cidr: + type: integer + created_at: + format: date-time + type: string + customdata: + type: object + enabled: + type: boolean + details: + type: string + facility: + allOf: + - $ref: './Facility.yaml' + - description: The facility the IP reservation is in. If the facility the IP reservation + was requested in is in a metro, a metro value will also be set, and the subsequent + IP reservation can be used on a metro level. Can be null if requesting an + IP reservation in a metro. + gateway: + type: string + global_ip: + type: boolean + href: + type: string + id: + format: uuid + type: string + manageable: + type: boolean + management: + type: boolean + metal_gateway: + $ref: './MetalGatewayLite.yaml' + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the IP reservation is in. As long as the IP reservation + has a metro, it can be used on a metro level. Can be null if requesting an + IP reservation in a facility that is not in a metro. + netmask: + type: string + network: + type: string + project: + $ref: './Project.yaml' + project_lite: + $ref: './Href.yaml' + requested_by: + $ref: './Href.yaml' + public: + type: boolean + state: + type: string + tags: + items: + type: string + type: array + type: + type: string + enum: + - global_ipv4 + - public_ipv4 + - private_ipv4 + - public_ipv6 +type: object +additionalProperties: false +required: + - type diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationList.yaml new file mode 100644 index 00000000..56393f25 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationList.yaml @@ -0,0 +1,10 @@ +properties: + ip_addresses: + items: + anyOf: + - $ref: './IPReservation.yaml' + - $ref: './VrfIpReservation.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationRequestInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationRequestInput.yaml new file mode 100644 index 00000000..d76c68fe --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationRequestInput.yaml @@ -0,0 +1,27 @@ +properties: + comments: + type: string + customdata: + type: object + details: + type: string + facility: + type: string + fail_on_approval_required: + type: boolean + metro: + description: The code of the metro you are requesting the IP reservation in. + example: SV + type: string + quantity: + type: integer + tags: + items: + type: string + type: array + type: + type: string +required: +- type +- quantity +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InstancesBatchCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InstancesBatchCreateInput.yaml new file mode 100644 index 00000000..97c166be --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InstancesBatchCreateInput.yaml @@ -0,0 +1,18 @@ +properties: + batches: + items: + allOf: + - properties: + hostnames: + items: + type: string + type: array + quantity: + type: integer + 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. + - oneOf: + - $ref: 'DeviceCreateInMetroInput.yaml' + - $ref: 'DeviceCreateInFacilityInput.yaml' + type: array +type: object + diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Interconnection.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Interconnection.yaml new file mode 100644 index 00000000..318dc74f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Interconnection.yaml @@ -0,0 +1,94 @@ +properties: + contact_email: + type: string + description: + type: string + facility: + $ref: './Facility.yaml' + x-deprecated: true + id: + format: uuid + type: string + metro: + allOf: + - $ref: './Metro.yaml' + 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: + 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. + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + organization: + $ref: './Organization.yaml' + ports: + items: + $ref: './InterconnectionPort.yaml' + type: array + description: For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the Dedicated Port(s). + project: + $ref: './Project.yaml' + redundancy: + type: string + enum: + - primary + - redundant + description: Either 'primary', meaning a single interconnection, or 'redundant', meaning a redundant interconnection. + service_tokens: + items: + $ref: './FabricServiceToken.yaml' + type: array + description: For Fabric VCs (Metal Billed), this will show details of the A-Side service tokens issued for the interconnection. For Fabric VCs (Fabric Billed), this will show the details of the Z-Side service tokens issued for the interconnection. Dedicated interconnections will not have any service tokens issued. + There will be one per interconnection, so for redundant interconnections, there should be two service tokens issued. + authorization_code: + type: string + description: For Fabric VCs (Metal Billed), this allows Fabric to connect the Metal network to any connection Fabric facilitates. Fabric uses this token to be able to give more detailed information about the Metal end of the network, when viewing resources from within Fabric. + speed: + description: For interconnections on Dedicated Ports and shared connections, this represents the interconnection's speed in bps. For Fabric VCs, this field refers to the maximum speed of the interconnection in bps. This value will default to 10Gbps for Fabric VCs (Fabric Billed). + type: integer + format: int64 + example: 10000000000 + status: + type: string + tags: + items: + type: string + type: array + token: + format: uuid + type: string + description: This token is used for shared interconnections to be used as the Fabric Token. This field is entirely deprecated. + type: + type: string + enum: + - shared + - dedicated + - shared_port_vlan + - shared_port_vlan_to_csp + description: The 'shared' type of interconnection refers to shared connections, or later also known as Fabric Virtual Connections (or Fabric VCs). + The 'dedicated' type of interconnection refers to interconnections created with Dedicated Ports. + The 'shared_port_vlan' type of interconnection refers to shared connections created without service tokens. + The 'shared_port_vlan_to_csp' type of interconnection refers to connections created directly to a supported cloud service provider. + fabric_provider: + description: Configuration information for connecting to external cloud service provider. Only available if the fabric_provider param was used when creating the interconnection. + oneOf: + - $ref: './AWSFabricProvider.yaml' + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string + requested_by: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionList.yaml new file mode 100644 index 00000000..5683309b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionList.yaml @@ -0,0 +1,8 @@ +properties: + interconnections: + items: + $ref: './Interconnection.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionMetroList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionMetroList.yaml new file mode 100644 index 00000000..9257a7a4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionMetroList.yaml @@ -0,0 +1,38 @@ +properties: + metros: + type: array + items: + allOf: + - $ref: './Metro.yaml' + - properties: + providers: + type: array + description: "A list of providers and their equivalent regions available for connecting to the provider network." + items: + properties: + type: + type: string + example: "CSP_AWS" + name: + type: string + example: "AWS Direct Connect" + locations: + type: array + items: + type: string + example: "us-east-1" + description: "The provider's network region name that is equivalent to the Equinix Metro." + bandwidths: + type: array + items: + type: integer + example: 50 + description: "Supported bandwidths in Mbps" + features: + type: array + items: + type: string + example: "high capacity" + description: "Additional features available in this profile." + meta: + $ref: '../../components/schemas/Meta.yaml' diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPort.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPort.yaml new file mode 100644 index 00000000..0932e76f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPort.yaml @@ -0,0 +1,40 @@ +properties: + id: + format: uuid + type: string + organization: + $ref: './Href.yaml' + role: + description: Either 'primary' or 'secondary'. + type: string + enum: + - primary + - secondary + status: + type: string + description: For both Fabric VCs and Dedicated Ports, this will be 'requested' on creation and 'deleting' on deletion. Once the Fabric VC has found its corresponding Fabric connection, + this will turn to 'active'. For Dedicated Ports, once the dedicated port is associated, this will also turn to 'active'. For Fabric VCs, this can turn into an 'expired' state if the + service token associated is expired. + enum: + - requested + - active + - deleting + - expired + - delete_failed + switch_id: + description: A switch 'short ID' + type: string + virtual_circuits: + items: + $ref: './VirtualCircuit.yaml' + type: array + name: + type: string + speed: + type: integer + format: int64 + link_status: + type: string + href: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPortList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPortList.yaml new file mode 100644 index 00000000..6c86e0c1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPortList.yaml @@ -0,0 +1,6 @@ +properties: + ports: + items: + $ref: './InterconnectionPort.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPricingList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPricingList.yaml new file mode 100644 index 00000000..13a407fd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPricingList.yaml @@ -0,0 +1,26 @@ +properties: + provider_pricing: + type: array + description: "Pricing information per connection provider." + items: + type: object + properties: + provider: + type: string + example: "CSP_AWS" + tiers: + type: array + items: + type: object + properties: + bandwidth: + type: integer + example: 500 + description: "Bandwidth tier in Mbps" + price: + type: number + format: float + example: 10.04 + billing_cycle: + type: string + example: "monthly" diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionUpdateInput.yaml new file mode 100644 index 00000000..aac3b37d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionUpdateInput.yaml @@ -0,0 +1,22 @@ +properties: + contact_email: + type: string + description: + type: string + mode: + 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. + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Invitation.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Invitation.yaml new file mode 100644 index 00000000..fb587f0f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Invitation.yaml @@ -0,0 +1,37 @@ +properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + invitation: + $ref: './Href.yaml' + invited_by: + $ref: './Href.yaml' + invitee: + type: string + format: email + nonce: + type: string + organization: + $ref: './Href.yaml' + projects: + items: + $ref: './Href.yaml' + type: array + roles: + items: + type: string + enum: + - admin + - billing + - collaborator + - limited_collaborator + type: array + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InvitationInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InvitationInput.yaml new file mode 100644 index 00000000..3461ddcb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InvitationInput.yaml @@ -0,0 +1,26 @@ +properties: + invitee: + type: string + format: email + message: + type: string + organization_id: + type: string + format: uuid + projects_ids: + items: + type: string + format: uuid + type: array + roles: + items: + type: string + enum: + - admin + - billing + - collaborator + - limited_collaborator + type: array +required: +- invitee +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InvitationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InvitationList.yaml new file mode 100644 index 00000000..5077f623 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InvitationList.yaml @@ -0,0 +1,6 @@ +properties: + invitations: + items: + $ref: './Membership.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Invoice.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Invoice.yaml new file mode 100644 index 00000000..ec764a0e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Invoice.yaml @@ -0,0 +1,41 @@ +properties: + amount: + format: float + type: number + balance: + format: float + type: number + created_on: + format: date + type: string + credit_amount: + format: float + type: number + credits_applied: + format: float + type: number + currency: + example: USD + type: string + due_on: + format: date + type: string + id: + format: uuid + type: string + items: + items: + $ref: './LineItem.yaml' + type: array + number: + type: string + project: + $ref: './ProjectIdName.yaml' + reference_number: + type: string + status: + type: string + target_date: + format: date + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InvoiceList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InvoiceList.yaml new file mode 100644 index 00000000..16410460 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InvoiceList.yaml @@ -0,0 +1,6 @@ +properties: + invoices: + items: + $ref: './Invoice.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/License.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/License.yaml new file mode 100644 index 00000000..d16812b6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/License.yaml @@ -0,0 +1,15 @@ +properties: + description: + type: string + id: + format: uuid + type: string + license_key: + type: string + licensee_product: + $ref: './Href.yaml' + project: + $ref: './Href.yaml' + size: + type: number +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/LicenseCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseCreateInput.yaml new file mode 100644 index 00000000..f1bec3dd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseCreateInput.yaml @@ -0,0 +1,8 @@ +properties: + description: + type: string + licensee_product_id: + type: string + size: + type: number +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/LicenseList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseList.yaml new file mode 100644 index 00000000..a74cf2f0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseList.yaml @@ -0,0 +1,6 @@ +properties: + licenses: + items: + $ref: './License.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/LicenseUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseUpdateInput.yaml new file mode 100644 index 00000000..11c51efa --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseUpdateInput.yaml @@ -0,0 +1,6 @@ +properties: + description: + type: string + size: + type: number +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/LineItem.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/LineItem.yaml new file mode 100644 index 00000000..e94c5641 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/LineItem.yaml @@ -0,0 +1,46 @@ +properties: + amount: + format: float + type: number + currency: + type: string + description: + type: string + details: + type: string + plan: + $ref: './PlanIdName.yaml' + unit: + type: string + unit_price: + format: float + type: number + hostname: + type: string + location: + type: string + item_type: + type: string + service_id: + format: uuid + type: string + start_date: + format: date + type: string + end_date: + format: date + type: string + project_id: + format: uuid + type: string + plan_id: + format: uuid + type: string + project: + $ref: './ProjectIdName.yaml' + adjustments: + description: Adjustments for the line item + items: + $ref: './LineItemAdjustment.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/LineItemAdjustment.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/LineItemAdjustment.yaml new file mode 100644 index 00000000..3f5a5e50 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/LineItemAdjustment.yaml @@ -0,0 +1,7 @@ +properties: + amount: + format: float + type: number + description: + type: string +type: object \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Membership.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Membership.yaml new file mode 100644 index 00000000..9adde1ac --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Membership.yaml @@ -0,0 +1,21 @@ +properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + roles: + items: + type: string + type: array + updated_at: + format: date-time + type: string + user: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MembershipInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MembershipInput.yaml new file mode 100644 index 00000000..6054927a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MembershipInput.yaml @@ -0,0 +1,6 @@ +properties: + role: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MembershipList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MembershipList.yaml new file mode 100644 index 00000000..81d7735b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MembershipList.yaml @@ -0,0 +1,6 @@ +properties: + memberships: + items: + $ref: './Membership.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Meta.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Meta.yaml new file mode 100644 index 00000000..88a52dc1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Meta.yaml @@ -0,0 +1,18 @@ +properties: + first: + $ref: './Href.yaml' + last: + $ref: './Href.yaml' + next: + $ref: './Href.yaml' + previous: + $ref: './Href.yaml' + self: + $ref: './Href.yaml' + total: + type: integer + current_page: + type: integer + last_page: + type: integer +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Metadata.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Metadata.yaml new file mode 100644 index 00000000..4c2d5e62 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Metadata.yaml @@ -0,0 +1,99 @@ +properties: + class: + type: string + customdata: + default: {} + type: object + additionalProperties: true + facility: + description: The facility code of the instance + type: string + hostname: + type: string + id: + format: uuid + type: string + iqn: + type: string + metro: + description: The metro code of the instance + type: string + network: + properties: + addresses: + items: + type: string + type: array + interfaces: + items: + type: object + type: array + network: + properties: + bonding: + properties: + link_aggregation: + type: string + mac: + type: string + mode: + type: integer + type: object + type: object + type: object + operating_system: + type: object + plan: + description: The plan slug of the instance + type: string + private_subnets: + description: An array of the private subnets + items: + type: string + type: array + reserved: + type: boolean + specs: + description: The specs of the plan version of the instance + type: object + ssh_keys: + items: + type: string + type: array + switch_short_id: + type: string + state: + type: string + enum: + - queued + - provisioning + - deprovisioning + - reinstalling + - active + - inactive + - failed + - powering_on + - powering_off + - deleted + description: |- + The current state the instance is in. + + * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. + * Once provisioning has begun on the instance it's state will move to `provisioning`. + * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. + * If an instance fails to provision or deprovision it will move to `failed` state. + * Once an instance has completed provisioning it will move to `active` state. + * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. + * When the instance is powered off completely it will move to the `inactive` state. + * When an instance is powered on completely it will move to the `active` state. + * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. + * When the reinstall action is complete the instance will move to `active` state. + tags: + items: + type: string + type: array + volumes: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetalGateway.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGateway.yaml new file mode 100644 index 00000000..ed0eb307 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGateway.yaml @@ -0,0 +1,32 @@ +properties: + created_at: + format: date-time + type: string + created_by: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + ip_reservation: + $ref: './IPReservation.yaml' + project: + $ref: './Project.yaml' + state: + description: The current state of the Metal Gateway. 'Ready' indicates the gateway + record has been configured, but is currently not active on the network. 'Active' + indicates the gateway has been configured on the network. 'Deleting' is a temporary + state used to indicate that the gateway is in the process of being un-configured + from the network, after which the gateway record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: './VirtualNetwork.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayCreateInput.yaml new file mode 100644 index 00000000..e4be2e54 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayCreateInput.yaml @@ -0,0 +1,20 @@ +properties: + ip_reservation_id: + description: The UUID of an IP reservation that belongs to the same project as + where the metal gateway will be created in. This field is required unless the + private IPv4 subnet size is specified. + format: uuid + type: string + private_ipv4_subnet_size: + description: |- + The subnet size (8, 16, 32, 64, or 128) of the private IPv4 reservation that will be created for the metal gateway. This field is required unless a project IP reservation was specified. + Please keep in mind that the number of private metal gateway ranges are limited per project. If you would like to increase the limit per project, please contact support for assistance. + type: integer + virtual_network_id: + description: The UUID of a metro virtual network that belongs to the same project + as where the metal gateway will be created in. + format: uuid + type: string +required: +- virtual_network_id +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayElasticIpCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayElasticIpCreateInput.yaml new file mode 100644 index 00000000..dea3a00c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayElasticIpCreateInput.yaml @@ -0,0 +1,24 @@ +properties: + address: + type: string + description: An IP address (or IP Address range) contained within one of the project's IP Reservations + example: "147.75.234.8/31" + next_hop: + type: string + format: ipv4 + description: An IP address contained within the Metal Gateways' IP Reservation range. + example: "192.168.12.13" + customdata: + type: object + additionalProperties: true + description: Optional User-defined JSON object value. + tags: + items: + type: string + type: array + description: Optional list of User-defined tags. Can be used by users to provide additional details or context regarding the purpose or usage of this resource. + example: [NY,prod,public] +required: +- address +- next_hop +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayList.yaml new file mode 100644 index 00000000..3b66ccdc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayList.yaml @@ -0,0 +1,10 @@ +properties: + metal_gateways: + items: + anyOf: + - $ref: './MetalGateway.yaml' + - $ref: './VrfMetalGateway.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayLite.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayLite.yaml new file mode 100644 index 00000000..ce42cc15 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayLite.yaml @@ -0,0 +1,35 @@ +properties: + created_at: + format: date-time + type: string + gateway_address: + description: The gateway address with subnet CIDR value for this Metal Gateway. + For example, a Metal Gateway using an IP reservation with block 10.1.2.0/27 + would have a gateway address of 10.1.2.1/27. + type: string + example: 10.1.2.1/27 + href: + type: string + id: + format: uuid + type: string + state: + description: The current state of the Metal Gateway. 'Ready' indicates the gateway + record has been configured, but is currently not active on the network. 'Active' + indicates the gateway has been configured on the network. 'Deleting' is a temporary + state used to indicate that the gateway is in the process of being un-configured + from the network, after which the gateway record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + vlan: + description: 'The VLAN id of the Virtual Network record associated to this Metal + Gateway.' + type: integer + example: 1001 +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Metro.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Metro.yaml new file mode 100644 index 00000000..c98a13f8 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Metro.yaml @@ -0,0 +1,11 @@ +properties: + code: + type: string + country: + type: string + id: + format: uuid + type: string + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetroInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetroInput.yaml new file mode 100644 index 00000000..5cd1b9d5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetroInput.yaml @@ -0,0 +1,11 @@ +required: + - metro +properties: + metro: + 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. + type: string + example: sv \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetroList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetroList.yaml new file mode 100644 index 00000000..e3863ad4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetroList.yaml @@ -0,0 +1,6 @@ +properties: + metros: + items: + $ref: './Metro.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Mount.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Mount.yaml new file mode 100644 index 00000000..916e3161 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Mount.yaml @@ -0,0 +1,12 @@ +properties: + device: + type: string + format: + type: string + point: + type: string + options: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/NewPassword.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/NewPassword.yaml new file mode 100644 index 00000000..2be80d13 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/NewPassword.yaml @@ -0,0 +1,4 @@ +properties: + new_password: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystem.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystem.yaml new file mode 100644 index 00000000..b1171edf --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystem.yaml @@ -0,0 +1,61 @@ +properties: + build_date: + description: The date on which the current OS image was build and released + type: string + format: date + deprecation_date: + description: The date when the OS is deprecated + type: string + format: date + distro: + type: string + distro_label: + type: string + end_of_life_date: + description: The OS no longer receives any updates and may be disabled at any time + type: string + format: date + end_of_service_date: + description: When the OS is nearing end of life, typically 30 days before end of life + type: string + format: date + id: + format: uuid + type: string + licensed: + description: Licenced OS is priced according to pricing property + type: boolean + lifecycle_state: + description: Where in the support lifecycle the OS is + type: string + name: + type: string + preinstallable: + description: Servers can be already preinstalled with OS in order to shorten provision + time. + type: boolean + pricing: + description: This object contains price per time unit and optional multiplier + value if licence price depends on hardware plan or components (e.g. number of + cores) + type: object + provisionable_on: + items: + type: string + type: array + release_date: + description: The date when the OS was released + type: string + format: date + release_notes: + description: The current release notes for this OS image, typically in Markdown format + type: string + slug: + type: string + version: + type: string + default_operating_system: + description: Default operating system for the distro. + readOnly: true + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystemList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystemList.yaml new file mode 100644 index 00000000..01793610 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystemList.yaml @@ -0,0 +1,6 @@ +properties: + operating_systems: + items: + $ref: './OperatingSystem.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Organization.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Organization.yaml new file mode 100644 index 00000000..6a5e89a2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Organization.yaml @@ -0,0 +1,51 @@ +properties: + address: + $ref: './Address.yaml' + billing_address: + $ref: './Address.yaml' + created_at: + format: date-time + type: string + credit_amount: + format: float + type: number + customdata: + type: object + description: + type: string + enforce_2fa_at: + description: Force to all members to have enabled the two factor authentication + after that date, unless the value is null + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + logo: + type: string + members: + items: + $ref: './Href.yaml' + type: array + memberships: + items: + $ref: './Href.yaml' + type: array + name: + type: string + projects: + items: + $ref: './Href.yaml' + type: array + terms: + type: integer + twitter: + type: string + updated_at: + format: date-time + type: string + website: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationInput.yaml new file mode 100644 index 00000000..e825228a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationInput.yaml @@ -0,0 +1,21 @@ +properties: + address: + $ref: './Address.yaml' + billing_address: + $ref: './Address.yaml' + customdata: + type: object + description: + type: string + enforce_2fa_at: + description: Force to all members to have enabled the two factor authentication + after that date, unless the value is null + format: date-time + type: string + name: + type: string + twitter: + type: string + website: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationList.yaml new file mode 100644 index 00000000..43d0c9ec --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationList.yaml @@ -0,0 +1,8 @@ +properties: + meta: + $ref: './Meta.yaml' + organizations: + items: + $ref: './Organization.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ParentBlock.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ParentBlock.yaml new file mode 100644 index 00000000..0eeeed3e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ParentBlock.yaml @@ -0,0 +1,10 @@ +properties: + cidr: + type: integer + href: + type: string + netmask: + type: string + network: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Partition.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Partition.yaml new file mode 100644 index 00000000..f0190354 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Partition.yaml @@ -0,0 +1,9 @@ +properties: + label: + type: string + number: + type: integer + format: int32 + size: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethod.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethod.yaml new file mode 100644 index 00000000..1ead6a67 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethod.yaml @@ -0,0 +1,37 @@ +properties: + billing_address: + $ref: './PaymentMethodBillingAddress.yaml' + card_type: + type: string + cardholder_name: + type: string + created_at: + format: date-time + type: string + created_by_user: + $ref: './Href.yaml' + default: + type: boolean + email: + type: string + expiration_month: + type: string + expiration_year: + type: string + id: + format: uuid + type: string + name: + type: string + organization: + $ref: './Href.yaml' + projects: + items: + $ref: './Href.yaml' + type: array + type: + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodBillingAddress.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodBillingAddress.yaml new file mode 100644 index 00000000..e9a84861 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodBillingAddress.yaml @@ -0,0 +1,8 @@ +properties: + country_code_alpha2: + type: string + postal_code: + type: string + street_address: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodCreateInput.yaml new file mode 100644 index 00000000..662f1eb7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodCreateInput.yaml @@ -0,0 +1,11 @@ +properties: + default: + type: boolean + name: + type: string + nonce: + type: string +required: +- name +- nonce +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodList.yaml new file mode 100644 index 00000000..f6318e40 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodList.yaml @@ -0,0 +1,6 @@ +properties: + payment_methods: + items: + $ref: './PaymentMethod.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodUpdateInput.yaml new file mode 100644 index 00000000..01092b0e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodUpdateInput.yaml @@ -0,0 +1,14 @@ +properties: + billing_address: + type: object + cardholder_name: + type: string + default: + type: boolean + expiration_month: + type: string + expiration_year: + type: integer + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Plan.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Plan.yaml new file mode 100644 index 00000000..e517d82f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Plan.yaml @@ -0,0 +1,131 @@ +properties: + available_in: + description: Shows which facilities the plan is available in, and the facility-based + price if it is different from the default price. + items: + type: object + properties: + href: + description: href to the Facility + type: string + price: + type: object + properties: + hour: + type: number + format: double + example: 1.23 + type: array + available_in_metros: + description: Shows which metros the plan is available in, and the metro-based + price if it is different from the default price. + items: + type: object + properties: + href: + description: href to the Metro + type: string + price: + type: object + properties: + hour: + type: number + format: double + example: 1.23 + type: array + categories: + description: Categories of the plan, like compute or storage. A Plan can belong to multiple categories. + items: + type: string + type: array + class: + type: string + example: m3.large.x86 + description: + type: string + deployment_types: + items: + type: string + enum: + - on_demand + - spot_market + type: array + minItems: 0 + uniqueItems: true + id: + format: uuid + type: string + legacy: + description: Deprecated. Always return false + type: boolean + x-deprecated: true + line: + type: string + name: + type: string + pricing: + type: object + slug: + type: string + example: m3.large.x86 + specs: + type: object + properties: + cpus: + type: array + items: + type: object + properties: + count: + type: integer + type: + type: string + memory: + type: object + properties: + total: + type: string + drives: + type: array + items: + type: object + properties: + count: + type: integer + type: + type: string + description: Values may include 'HDD', 'SSD', 'NVME' + size: + type: string + example: 3.84TB + category: + type: string + description: Values may include 'boot', 'cache', 'storage' + nics: + type: array + items: + type: object + properties: + count: + type: integer + example: 2 + type: + type: string + description: Values may include '1Gbps', '10Gbps', '25Gbps' + features: + type: object + properties: + raid: + type: boolean + txt: + type: boolean + uefi: + type: boolean + type: + description: The plan type + type: string + enum: + - standard + - workload_optimized + - custom +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PlanIdName.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PlanIdName.yaml new file mode 100644 index 00000000..3a06d9b4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PlanIdName.yaml @@ -0,0 +1,7 @@ +properties: + id: + format: uuid + type: string + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PlanList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PlanList.yaml new file mode 100644 index 00000000..a22e4dec --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PlanList.yaml @@ -0,0 +1,6 @@ +properties: + plans: + items: + $ref: './Plan.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Port.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Port.yaml new file mode 100644 index 00000000..e232c6dd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Port.yaml @@ -0,0 +1,40 @@ +description: Port is a hardware port associated with a reserved or instantiated hardware device. +properties: + bond: + $ref: './BondPortData.yaml' + data: + $ref: './PortData.yaml' + disbond_operation_supported: + description: Indicates whether or not the bond can be broken on the port (when + applicable). + type: boolean + href: + type: string + id: + format: uuid + type: string + name: + type: string + example: bond0 + type: + description: Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports + type: string + enum: + - NetworkPort + - NetworkBondPort + network_type: + description: Composite network type of the bond + type: string + enum: + - 'layer2-bonded' + - 'layer2-individual' + - 'layer3' + - 'hybrid' + - 'hybrid-bonded' + native_virtual_network: + $ref: './VirtualNetwork.yaml' + virtual_networks: + items: + $ref: './VirtualNetwork.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortAssignInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortAssignInput.yaml new file mode 100644 index 00000000..2e08fd80 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortAssignInput.yaml @@ -0,0 +1,8 @@ +properties: + vnid: + description: > + Virtual Network ID. May be the UUID of the Virtual Network record, + or the VLAN value itself. + type: string + example: "1001" +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortConvertLayer3Input.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortConvertLayer3Input.yaml new file mode 100644 index 00000000..175e77c7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortConvertLayer3Input.yaml @@ -0,0 +1,11 @@ +properties: + request_ips: + items: + properties: + address_family: + type: integer + public: + type: boolean + type: object + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortData.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortData.yaml new file mode 100644 index 00000000..adf41a01 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortData.yaml @@ -0,0 +1,8 @@ +properties: + mac: + description: MAC address is set for NetworkPort ports + type: string + bonded: + description: Bonded is true for NetworkPort ports in a bond and NetworkBondPort ports that are active + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignment.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignment.yaml new file mode 100644 index 00000000..889b3486 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignment.yaml @@ -0,0 +1,24 @@ +properties: + created_at: + format: date-time + type: string + id: + format: uuid + type: string + native: + type: boolean + port: + $ref: './Href.yaml' + state: + enum: + - assigned + - unassigning + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: './Href.yaml' + vlan: + type: integer +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatch.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatch.yaml new file mode 100644 index 00000000..0d5e8a2b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatch.yaml @@ -0,0 +1,45 @@ +properties: + created_at: + format: date-time + type: string + error_messages: + items: + type: string + type: array + id: + format: uuid + type: string + port: + $ref: './Port.yaml' + quantity: + type: integer + state: + enum: + - queued + - in_progress + - completed + - failed + type: string + updated_at: + format: date-time + type: string + vlan_assignments: + items: + properties: + id: + format: uuid + type: string + native: + type: boolean + state: + enum: + - assigned + - unassigned + type: string + vlan: + type: integer + type: object + type: array + project: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchCreateInput.yaml new file mode 100644 index 00000000..a6bc0925 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchCreateInput.yaml @@ -0,0 +1,16 @@ +properties: + vlan_assignments: + items: + properties: + native: + type: boolean + state: + enum: + - assigned + - unassigned + type: string + vlan: + type: string + type: object + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchList.yaml new file mode 100644 index 00000000..af95e08f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchList.yaml @@ -0,0 +1,6 @@ +properties: + batches: + items: + $ref: './PortVlanAssignmentBatch.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentList.yaml new file mode 100644 index 00000000..d058582e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentList.yaml @@ -0,0 +1,6 @@ +properties: + vlan_assignments: + items: + $ref: './PortVlanAssignment.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Project.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Project.yaml new file mode 100644 index 00000000..48af7d0b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Project.yaml @@ -0,0 +1,66 @@ +properties: + bgp_config: + $ref: './Href.yaml' + created_at: + format: date-time + type: string + customdata: + type: object + devices: + items: + $ref: './Href.yaml' + type: array + href: + type: string + id: + format: uuid + type: string + invitations: + items: + $ref: './Href.yaml' + type: array + max_devices: + type: object + members: + items: + $ref: './Href.yaml' + type: array + memberships: + items: + $ref: './Href.yaml' + type: array + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + network_status: + type: object + organization: + $ref: './Organization.yaml' + payment_method: + $ref: './Href.yaml' + ssh_keys: + items: + $ref: './Href.yaml' + type: array + updated_at: + format: date-time + type: string + url: + type: string + volumes: + items: + $ref: './Href.yaml' + type: array + type: + type: string + description: The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers. + enum: + - default + - vmce + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateFromRootInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateFromRootInput.yaml new file mode 100644 index 00000000..e138c704 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateFromRootInput.yaml @@ -0,0 +1,28 @@ +properties: + customdata: + type: object + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + organization_id: + format: uuid + type: string + payment_method_id: + format: uuid + type: string + type: + type: string + description: The type of the project. If no type is specified the project type will automatically be `default` + Projects of type 'vmce' are part of an in development feature and not available to all customers. + enum: + - default + - vmce + tags: + items: + type: string + type: array +required: +- name +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateInput.yaml new file mode 100644 index 00000000..5dd2966b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateInput.yaml @@ -0,0 +1,25 @@ +properties: + customdata: + type: object + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + payment_method_id: + format: uuid + type: string + type: + type: string + description: The type of the project. If no type is specified the project type will automatically be `default` + Projects of type 'vmce' are part of an in development feature and not available to all customers. + enum: + - default + - vmce + tags: + items: + type: string + type: array +required: +- name +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectIdName.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectIdName.yaml new file mode 100644 index 00000000..3a06d9b4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectIdName.yaml @@ -0,0 +1,7 @@ +properties: + id: + format: uuid + type: string + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectList.yaml new file mode 100644 index 00000000..a4c8a58c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectList.yaml @@ -0,0 +1,8 @@ +properties: + meta: + $ref: './Meta.yaml' + projects: + items: + $ref: './Project.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUpdateInput.yaml new file mode 100644 index 00000000..7acaad09 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUpdateInput.yaml @@ -0,0 +1,18 @@ +properties: + backend_transfer_enabled: + type: boolean + customdata: + type: object + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + payment_method_id: + format: uuid + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsage.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsage.yaml new file mode 100644 index 00000000..cec80ec2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsage.yaml @@ -0,0 +1,20 @@ +properties: + facility: + type: string + name: + type: string + plan: + type: string + plan_version: + type: string + price: + type: string + quantity: + type: string + total: + type: string + type: + type: string + unit: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsageList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsageList.yaml new file mode 100644 index 00000000..827d8ad2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsageList.yaml @@ -0,0 +1,6 @@ +properties: + usages: + items: + $ref: './ProjectUsage.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Raid.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Raid.yaml new file mode 100644 index 00000000..c2a892f6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Raid.yaml @@ -0,0 +1,10 @@ +properties: + devices: + items: + type: string + type: array + level: + type: string + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/RecoveryCodeList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/RecoveryCodeList.yaml new file mode 100644 index 00000000..40928232 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/RecoveryCodeList.yaml @@ -0,0 +1,6 @@ +properties: + recovery_codes: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SSHKey.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKey.yaml new file mode 100644 index 00000000..135e59d0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKey.yaml @@ -0,0 +1,25 @@ +properties: + created_at: + format: date-time + type: string + entity: + $ref: './Href.yaml' + fingerprint: + type: string + href: + type: string + id: + format: uuid + type: string + key: + type: string + label: + type: string + updated_at: + format: date-time + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyCreateInput.yaml new file mode 100644 index 00000000..2aab7ffa --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyCreateInput.yaml @@ -0,0 +1,18 @@ +properties: + instances_ids: + description: |- + List of instance UUIDs to associate SSH key with, when empty array is sent all instances belonging + to entity will be included + items: + format: uuid + type: string + type: array + key: + type: string + label: + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyInput.yaml new file mode 100644 index 00000000..fb5db698 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyInput.yaml @@ -0,0 +1,10 @@ +properties: + key: + type: string + label: + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyList.yaml new file mode 100644 index 00000000..8a99546c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyList.yaml @@ -0,0 +1,6 @@ +properties: + ssh_keys: + items: + $ref: './SSHKey.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemRequest.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemRequest.yaml new file mode 100644 index 00000000..65b0acf8 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemRequest.yaml @@ -0,0 +1,16 @@ +properties: + metro_id: + format: uuid + type: string + description: Metro ID of the item. + plan_id: + format: uuid + type: string + description: Plan ID of the item. + quantity: + type: integer + description: Number of items. + term: + type: string + description: Contract term of the item. +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemResponse.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemResponse.yaml new file mode 100644 index 00000000..26e7a479 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemResponse.yaml @@ -0,0 +1,35 @@ +properties: + amount: + format: float + type: number + id: + type: string + metro_code: + type: string + metro_id: + format: uuid + type: string + metro_name: + type: string + plan: + $ref: './Plan.yaml' + plan_id: + format: uuid + type: string + x-deprecated: true + plan_name: + type: string + x-deprecated: true + plan_slug: + type: string + x-deprecated: true + plan_categories: + type: array + items: + type: string + x-deprecated: true + quantity: + type: integer + term: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationList.yaml new file mode 100644 index 00000000..c0960915 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationList.yaml @@ -0,0 +1,6 @@ +properties: + reservations: + items: + $ref: './SelfServiceReservationResponse.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationResponse.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationResponse.yaml new file mode 100644 index 00000000..60cbfb0b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationResponse.yaml @@ -0,0 +1,40 @@ +properties: + created_at: + format: date-time + type: string + item: + items: + $ref: './SelfServiceReservationItemResponse.yaml' + type: array + notes: + type: string + organization: + type: string + organization_id: + format: uuid + type: string + period: + properties: + count: + enum: + - 12 + - 36 + type: integer + unit: + enum: + - monthly + type: string + type: object + project: + type: string + project_id: + format: uuid + type: string + start_date: + format: date-time + type: string + status: + type: string + total_cost: + type: integer +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ServerInfo.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ServerInfo.yaml new file mode 100644 index 00000000..83566aa5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ServerInfo.yaml @@ -0,0 +1,14 @@ +properties: + facility: + deprecated: true + type: string + metro: + description: The metro ID or code to check the capacity in. + type: string + plan: + description: The plan ID or slug to check the capacity of. + type: string + quantity: + description: The number of servers to check the capacity of. + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SharedPortVCVlanCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SharedPortVCVlanCreateInput.yaml new file mode 100644 index 00000000..c7e63be3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SharedPortVCVlanCreateInput.yaml @@ -0,0 +1,48 @@ +properties: + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. + type: string + format: email + description: + type: string + name: + type: string + project: + type: string + metro: + description: A Metro ID or code. When creating 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), or shared connections, 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. + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: + ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. + For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. + type: string + example: 10000000000 + tags: + items: + type: string + type: array + type: + type: string + enum: + - shared_port_vlan + vlans: + description: A list of one or two metro-based VLANs that will be set on the virtual circuits of primary + and/or secondary interconnections respectively when creating Fabric VCs. + VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. + example: + - 1000 + - 1001 + items: + type: integer + type: array +required: +- name +- type +- metro +- vlans +- project +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesList.yaml new file mode 100644 index 00000000..1164d10c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesList.yaml @@ -0,0 +1,4 @@ +properties: + spot_market_prices: + $ref: './SpotPricesReport.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroList.yaml new file mode 100644 index 00000000..e0a9b36b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroList.yaml @@ -0,0 +1,4 @@ +properties: + spot_market_prices: + $ref: './SpotMarketPricesPerMetroReport.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroReport.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroReport.yaml new file mode 100644 index 00000000..3dae22bc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroReport.yaml @@ -0,0 +1,16 @@ +properties: + am: + $ref: './SpotPricesPerFacility.yaml' + ch: + $ref: './SpotPricesPerFacility.yaml' + da: + $ref: './SpotPricesPerFacility.yaml' + la: + $ref: './SpotPricesPerFacility.yaml' + ny: + $ref: './SpotPricesPerFacility.yaml' + sg: + $ref: './SpotPricesPerFacility.yaml' + sv: + $ref: './SpotPricesPerFacility.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequest.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequest.yaml new file mode 100644 index 00000000..bea87517 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequest.yaml @@ -0,0 +1,30 @@ +properties: + created_at: + format: date-time + type: string + devices_max: + type: integer + devices_min: + type: integer + end_at: + format: date-time + type: string + facilities: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + instances: + $ref: './Href.yaml' + max_bid_price: + format: float + type: number + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the spot market request was created in + project: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestCreateInput.yaml new file mode 100644 index 00000000..085397cb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestCreateInput.yaml @@ -0,0 +1,76 @@ +properties: + devices_max: + type: integer + devices_min: + type: integer + end_at: + format: date-time + type: string + facilities: + deprecated: true + items: + format: uuid + type: string + type: array + instance_parameters: + properties: + always_pxe: + type: boolean + billing_cycle: + type: string + customdata: + type: object + description: + type: string + features: + items: + type: string + type: array + hostname: + type: string + hostnames: + items: + type: string + type: array + locked: + type: boolean + description: Whether the device should be locked, preventing accidental deletion. + no_ssh_keys: + type: boolean + operating_system: + type: string + plan: + type: string + private_ipv4_subnet_size: + type: integer + project_ssh_keys: + items: + format: uuid + type: string + type: array + public_ipv4_subnet_size: + type: integer + tags: + items: + type: string + type: array + termination_time: + format: date-time + type: string + user_ssh_keys: + description: The UUIDs of users whose SSH keys should be included on the provisioned + device. + items: + format: uuid + type: string + type: array + userdata: + type: string + type: object + max_bid_price: + format: float + type: number + metro: + description: The metro ID or code the spot market request will be created in. + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestList.yaml new file mode 100644 index 00000000..3ed96cd0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestList.yaml @@ -0,0 +1,6 @@ +properties: + spot_market_requests: + items: + $ref: './SpotMarketRequest.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapoints.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapoints.yaml new file mode 100644 index 00000000..27674b98 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapoints.yaml @@ -0,0 +1,6 @@ +properties: + datapoints: + items: + $ref: './SpotPricesDatapointsList.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapointsList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapointsList.yaml new file mode 100644 index 00000000..038972f5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapointsList.yaml @@ -0,0 +1,3 @@ +items: + type: number +type: array diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesHistoryReport.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesHistoryReport.yaml new file mode 100644 index 00000000..3a3c8522 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesHistoryReport.yaml @@ -0,0 +1,4 @@ +properties: + prices_history: + $ref: './SpotPricesDatapoints.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerBaremetal.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerBaremetal.yaml new file mode 100644 index 00000000..6c9b0b0a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerBaremetal.yaml @@ -0,0 +1,5 @@ +properties: + price: + format: float + type: number +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerFacility.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerFacility.yaml new file mode 100644 index 00000000..a0ba3def --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerFacility.yaml @@ -0,0 +1,20 @@ +properties: + baremetal_0: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_1: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_2: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_2a: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_2a2: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_3: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_s: + $ref: './SpotPricesPerBaremetal.yaml' + c2.medium.x86: + $ref: './SpotPricesPerBaremetal.yaml' + m2.xlarge.x86: + $ref: './SpotPricesPerBaremetal.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerNewFacility.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerNewFacility.yaml new file mode 100644 index 00000000..e72795c2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerNewFacility.yaml @@ -0,0 +1,4 @@ +properties: + baremetal_1e: + $ref: './SpotPricesPerBaremetal.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesReport.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesReport.yaml new file mode 100644 index 00000000..15b59111 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesReport.yaml @@ -0,0 +1,30 @@ +properties: + ams1: + $ref: './SpotPricesPerFacility.yaml' + atl1: + $ref: './SpotPricesPerNewFacility.yaml' + dfw1: + $ref: './SpotPricesPerNewFacility.yaml' + ewr1: + $ref: './SpotPricesPerFacility.yaml' + fra1: + $ref: './SpotPricesPerNewFacility.yaml' + iad1: + $ref: './SpotPricesPerNewFacility.yaml' + lax1: + $ref: './SpotPricesPerNewFacility.yaml' + nrt1: + $ref: './SpotPricesPerFacility.yaml' + ord1: + $ref: './SpotPricesPerNewFacility.yaml' + sea1: + $ref: './SpotPricesPerNewFacility.yaml' + sin1: + $ref: './SpotPricesPerNewFacility.yaml' + sjc1: + $ref: './SpotPricesPerFacility.yaml' + syd1: + $ref: './SpotPricesPerNewFacility.yaml' + yyz1: + $ref: './SpotPricesPerNewFacility.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Storage.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Storage.yaml new file mode 100644 index 00000000..a800531d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Storage.yaml @@ -0,0 +1,14 @@ +properties: + disks: + items: + $ref: './Disk.yaml' + type: array + raid: + items: + $ref: './Raid.yaml' + type: array + filesystems: + items: + $ref: './Filesystem.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SupportRequestInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SupportRequestInput.yaml new file mode 100644 index 00000000..27a7a640 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SupportRequestInput.yaml @@ -0,0 +1,20 @@ +properties: + device_id: + type: string + message: + type: string + priority: + enum: + - urgent + - high + - medium + - low + type: string + project_id: + type: string + subject: + type: string +required: +- subject +- message +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequest.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequest.yaml new file mode 100644 index 00000000..86f4eb42 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequest.yaml @@ -0,0 +1,17 @@ +properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + target_organization: + $ref: './Href.yaml' + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestInput.yaml new file mode 100644 index 00000000..21584bd9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestInput.yaml @@ -0,0 +1,5 @@ +properties: + target_organization_id: + format: uuid + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestList.yaml new file mode 100644 index 00000000..2e22bdbb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestList.yaml @@ -0,0 +1,6 @@ +properties: + transfers: + items: + $ref: './TransferRequest.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UpdateEmailInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UpdateEmailInput.yaml new file mode 100644 index 00000000..01eec3c4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UpdateEmailInput.yaml @@ -0,0 +1,4 @@ +properties: + default: + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/User.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/User.yaml new file mode 100644 index 00000000..b81db710 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/User.yaml @@ -0,0 +1,54 @@ +properties: + avatar_thumb_url: + type: string + avatar_url: + type: string + created_at: + format: date-time + type: string + customdata: + type: object + default_organization_id: + type: string + format: uuid + default_project_id: + type: string + format: uuid + email: + type: string + emails: + items: + $ref: './Href.yaml' + type: array + first_name: + type: string + fraud_score: + type: string + full_name: + type: string + href: + type: string + id: + format: uuid + type: string + last_login_at: + format: date-time + type: string + last_name: + type: string + max_organizations: + type: integer + max_projects: + type: integer + phone_number: + type: string + short_id: + type: string + timezone: + type: string + two_factor_auth: + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UserCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UserCreateInput.yaml new file mode 100644 index 00000000..30eb8cf6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UserCreateInput.yaml @@ -0,0 +1,42 @@ +properties: + company_name: + type: string + company_url: + type: string + customdata: + type: object + emails: + items: + $ref: './EmailInput.yaml' + type: array + first_name: + type: string + last_name: + type: string + level: + type: string + password: + type: string + phone_number: + type: string + social_accounts: + type: object + timezone: + type: string + title: + type: string + two_factor_auth: + type: string + verified_at: + format: date-time + type: string + invitation_id: + type: string + format: uuid + nonce: + type: string +required: +- first_name +- last_name +- emails +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UserLimited.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UserLimited.yaml new file mode 100644 index 00000000..3e909c3c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UserLimited.yaml @@ -0,0 +1,21 @@ +properties: + avatar_thumb_url: + description: Avatar thumbnail URL of the User + type: string + avatar_url: + description: Avatar URL of the User + type: string + full_name: + description: Full name of the User + type: string + href: + description: API URL uniquely representing the User + type: string + id: + description: ID of the User + format: uuid + type: string +required: + - id + - short_id +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UserList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UserList.yaml new file mode 100644 index 00000000..5ed5b73e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UserList.yaml @@ -0,0 +1,8 @@ +properties: + meta: + $ref: './Meta.yaml' + users: + items: + $ref: './User.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UserLite.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UserLite.yaml new file mode 100644 index 00000000..333edef4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UserLite.yaml @@ -0,0 +1,38 @@ +properties: + avatar_thumb_url: + description: Avatar thumbnail URL of the User + type: string + created_at: + description: When the user was created + format: date-time + type: string + email: + description: Primary email address of the User + type: string + first_name: + description: First name of the User + type: string + full_name: + description: Full name of the User + type: string + href: + description: API URL uniquely representing the User + type: string + id: + description: ID of the User + format: uuid + type: string + last_name: + description: Last name of the User + type: string + short_id: + description: Short ID of the User + type: string + updated_at: + description: When the user details were last updated + format: date-time + type: string +required: +- id +- short_id +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UserUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UserUpdateInput.yaml new file mode 100644 index 00000000..6ba885f6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UserUpdateInput.yaml @@ -0,0 +1,14 @@ +properties: + customdata: + type: object + first_name: + type: string + last_name: + type: string + password: + type: string + phone_number: + type: string + timezone: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Userdata.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Userdata.yaml new file mode 100644 index 00000000..8acfc608 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Userdata.yaml @@ -0,0 +1,4 @@ +properties: + userdata: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VerifyEmail.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VerifyEmail.yaml new file mode 100644 index 00000000..d32c848c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VerifyEmail.yaml @@ -0,0 +1,7 @@ +properties: + user_token: + description: User verification token + type: string + writeOnly: true +required: + - user_token diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuit.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuit.yaml new file mode 100644 index 00000000..2c12357e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuit.yaml @@ -0,0 +1,3 @@ +oneOf: +- $ref: './VlanVirtualCircuit.yaml' +- $ref: './VrfVirtualCircuit.yaml' diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitCreateInput.yaml new file mode 100644 index 00000000..d4b72f38 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitCreateInput.yaml @@ -0,0 +1,3 @@ +oneOf: + - $ref: 'VlanVirtualCircuitCreateInput.yaml' + - $ref: 'VrfVirtualCircuitCreateInput.yaml' diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitList.yaml new file mode 100644 index 00000000..03ecf33e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitList.yaml @@ -0,0 +1,6 @@ +properties: + virtual_circuits: + items: + $ref: './VirtualCircuit.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitUpdateInput.yaml new file mode 100644 index 00000000..5205301a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitUpdateInput.yaml @@ -0,0 +1,3 @@ +oneOf: + - $ref: 'VlanVirtualCircuitUpdateInput.yaml' + - $ref: 'VrfVirtualCircuitUpdateInput.yaml' diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetwork.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetwork.yaml new file mode 100644 index 00000000..311670d0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetwork.yaml @@ -0,0 +1,42 @@ +properties: + assigned_to: + $ref: './Project.yaml' + assigned_to_virtual_circuit: + description: True if the virtual network is attached to a virtual circuit. False + if not. + type: boolean + description: + type: string + facility: + $ref: './Href.yaml' + href: + type: string + created_at: + format: date-time + type: string + id: + format: uuid + type: string + instances: + description: A list of instances with ports currently associated to this Virtual + Network. + items: + $ref: './Device.yaml' + type: array + metal_gateways: + description: A list of metal gateways currently associated to this Virtual Network. + items: + $ref: './MetalGatewayLite.yaml' + type: array + metro: + $ref: './Metro.yaml' + metro_code: + description: The Metro code of the metro in which this Virtual Network is defined. + type: string + vxlan: + type: integer + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkCreateInput.yaml new file mode 100644 index 00000000..1a74eca6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkCreateInput.yaml @@ -0,0 +1,23 @@ +properties: + description: + type: string + facility: + deprecated: true + description: The UUID (or facility code) for the Facility in which to create this + Virtual network. + type: string + metro: + description: The UUID (or metro code) for the Metro in which to create this Virtual + Network. + type: string + vxlan: + description: VLAN ID between 2-3999. Must be unique for the project within the + Metro in which this Virtual Network is being created. If no value is specified, + the next-available VLAN ID in the range 1000-1999 will be automatically selected. + example: 1099 + type: integer + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkList.yaml new file mode 100644 index 00000000..8d3fd950 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkList.yaml @@ -0,0 +1,6 @@ +properties: + virtual_networks: + items: + $ref: './VirtualNetwork.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkUpdateInput.yaml new file mode 100644 index 00000000..f50dea99 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkUpdateInput.yaml @@ -0,0 +1,8 @@ +properties: + description: + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VlanCSPConnectionCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VlanCSPConnectionCreateInput.yaml new file mode 100644 index 00000000..1ccf354b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VlanCSPConnectionCreateInput.yaml @@ -0,0 +1,52 @@ +properties: + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. + type: string + format: email + description: + type: string + name: + type: string + project: + type: string + metro: + description: A Metro ID or code. When creating 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), or shared connections, 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. + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: + ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. + For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. + type: string + example: 10000000000 + tags: + items: + type: string + type: array + type: + type: string + enum: + - shared_port_vlan_to_csp + vlans: + description: A list of one or two metro-based VLANs that will be set on the virtual circuits of primary + and/or secondary interconnections respectively when creating Fabric VCs. + VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. + example: + - 1000 + - 1001 + items: + type: integer + type: array + fabric_provider: + description: Configuration information for connecting to external cloud service provider. + oneOf: + - $ref: './AWSFabricProvider.yaml' +required: +- name +- metro +- vlans +- type +- project +- fabric_provider diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VlanFabricVcCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VlanFabricVcCreateInput.yaml new file mode 100644 index 00000000..b08a4f55 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VlanFabricVcCreateInput.yaml @@ -0,0 +1,65 @@ +properties: + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. + type: string + format: email + description: + type: string + facility_id: + type: string + x-deprecated: true + metro: + description: A Metro ID or code. When creating 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), or shared connections, 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. + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + service_token_type: + description: Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field + to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. + This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + enum: + - a_side + - z_side + example: a_side + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: + ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. + For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. + type: string + example: 10000000000 + tags: + items: + type: string + type: array + type: + description: When requesting for a Fabric VC, the value of this field should be 'shared'. + type: string + enum: + - shared + vlans: + description: A list of one or two metro-based VLANs that will be set on the virtual circuits of primary + and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. + VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. + example: + - 1000 + - 1001 + items: + type: integer + type: array +required: +- name +- metro +- type +- redundancy +- service_token_type +- vlans +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuit.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuit.yaml new file mode 100644 index 00000000..b96c7233 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuit.yaml @@ -0,0 +1,78 @@ +properties: + bill: + type: boolean + default: false + description: True if the Virtual Circuit is being billed. Currently, only Virtual Circuits of Fabric VCs (Metal Billed) will be billed. Usage will start the first time the Virtual Circuit becomes active, and will not stop until it is deleted from Metal. + bill_type: + type: string + nullable: true + description: Fabric Billed if the Virtual Circuit is billed by Fabric. Metal Billed if the Virtual Circuit is billed by Metal. Legacy Virtual Circuits will have a value of nil. + enum: + - metal_billed + - fabric_billed + description: + type: string + id: + format: uuid + type: string + name: + type: string + nni_vlan: + type: integer + port: + $ref: './InterconnectionPort.yaml' + project: + $ref: './Project.yaml' + speed: + description: For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual Circuits on + Fabric VCs (both Metal and Fabric Billed) that have found their corresponding Fabric connection, this is the actual speed of the interconnection that was configured when setting up the interconnection on the Fabric Portal. + Details on Fabric VCs are included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + type: integer + format: int64 + status: + type: string + description: The status of a Virtual Circuit is always 'pending' on creation. The status can turn to 'Waiting on Customer VLAN' if a Metro VLAN was not set yet on the Virtual Circuit and is the last step needed for full activation. For Dedicated interconnections, as long as the Dedicated Port has been associated + to the Virtual Circuit and a NNI VNID has been set, it will turn to 'waiting_on_customer_vlan'. + For Fabric VCs, it will only change to 'waiting_on_customer_vlan' once the corresponding Fabric connection has been found on the Fabric side. If the Fabric service token associated with the Virtual Circuit hasn't been redeemed on Fabric within the expiry time, it will change to an `expired` status. + Once a Metro VLAN is set on the Virtual Circuit (which for Fabric VCs, can be set on creation of a Fabric VC) and the necessary set up is done, it will turn into 'Activating' status as it tries to activate the Virtual Circuit. Once the Virtual Circuit fully activates and is configured on the switch, + it will turn to staus 'active'. For Fabric VCs (Metal Billed), we will start billing the moment the status of the Virtual Circuit turns to 'active'. If there are any changes to the VLAN after the Virtual Circuit is in an 'active' status, the status will show 'changing_vlan' if a new VLAN has been provided, + or 'deactivating' if we are removing the VLAN. When a deletion request is issued for the Virtual Circuit, it will move to a 'deleting' status, and we will immediately unconfigure the switch for the Virtual Circuit and issue a deletion on any associated Fabric connections. Any associated Metro VLANs on the + virtual circuit will also be unassociated after the switch has been successfully unconfigured. If there are any associated Fabric connections, we will only fully delete the Virtual Circuit once we have checked that the Fabric connection was fully deprovisioned on Fabric. + # NOTE: Any new additions to the enum will affect users using generated SDKs. + enum: + - pending + - waiting_on_customer_vlan + - activating + - changing_vlan + - deactivating + - deleting + - active + - expired + - activation_failed + - changing_vlan_failed + - deactivation_failed + - delete_failed + - configure_fabric_routing_protocols + provider_connection_id: + type: string + example: dxcon-fggxx63k + description: This field is relevant if using the `shared_port_vlan_to_csp` interconnection type. Once activated on the CSP, this field should contain the resource name that the virtual circuit is connected to on the provider's end. + tags: + items: + type: string + type: array + type: + type: string + enum: + - vlan + virtual_network: + $ref: './Href.yaml' + vnid: + type: integer + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitCreateInput.yaml new file mode 100644 index 00000000..e6d87b90 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitCreateInput.yaml @@ -0,0 +1,28 @@ +properties: + description: + type: string + name: + type: string + nni_vlan: + maximum: 4094 + minimum: 2 + type: integer + project_id: + format: uuid + type: string + speed: + description: speed can be passed as integer number representing bps speed or string + (e.g. '52m' or '100g' or '4 gbps') + type: string + tags: + items: + type: string + type: array + vnid: + description: A Virtual Network record UUID or the VNID of a Metro Virtual Network in + your project (sent as integer). + format: uuid + type: string +type: object +required: + - project_id diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitUpdateInput.yaml new file mode 100644 index 00000000..1d88bf77 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitUpdateInput.yaml @@ -0,0 +1,17 @@ +properties: + description: + type: string + name: + type: string + speed: + description: Speed can be changed only if it is an interconnection on a Dedicated Port + type: string + tags: + items: + type: string + type: array + vnid: + description: A Virtual Network record UUID or the VNID of a Metro Virtual Network in + your project. + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Vrf.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Vrf.yaml new file mode 100644 index 00000000..1be4cd4e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Vrf.yaml @@ -0,0 +1,55 @@ +properties: + id: + format: uuid + type: string + name: + type: string + description: + description: Optional field that can be set to describe the VRF + type: string + bill: + type: boolean + default: false + description: True if the VRF is being billed. Usage will start when the first VRF Virtual Circuit is active, and will only stop when the VRF has been deleted. + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + local_asn: + description: A 4-byte ASN associated with the VRF. + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 + virtual_circuits: + description: Virtual circuits that are in the VRF + type: array + items: + $ref: './VrfVirtualCircuit.yaml' + ip_ranges: + $ref: './VrfIpRangeList.yaml' + project: + $ref: './Project.yaml' + metro: + $ref: './Metro.yaml' + created_by: + $ref: './User.yaml' + href: + type: string + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfBGPNeighbors.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfBGPNeighbors.yaml new file mode 100644 index 00000000..b8510f52 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfBGPNeighbors.yaml @@ -0,0 +1,16 @@ +properties: + peer_ip: + type: string + example: "8.8.8.8" + peer_as: + description: The ASN of the peer that advertised the prefix. + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 + state: + description: The current status of the connection to the BGP peer. State is either up or down. + type: string + example: "up" +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfBGPNeighborsList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfBGPNeighborsList.yaml new file mode 100644 index 00000000..2ad2f56a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfBGPNeighborsList.yaml @@ -0,0 +1,5 @@ +properties: + bgp_neighbors: + items: + $ref: './VrfBGPNeighbors.yaml' + type: array \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfCreateInput.yaml new file mode 100644 index 00000000..dc934527 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfCreateInput.yaml @@ -0,0 +1,32 @@ +properties: + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + description: + type: string + ip_ranges: + $ref: './VrfIpRangeCreateInput.yaml' + local_asn: + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 + metro: + description: The UUID (or metro code) for the Metro in which to create this VRF. + type: string + name: + type: string + tags: + items: + type: string + type: array +required: +- metro +- name diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfFabricVcCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfFabricVcCreateInput.yaml new file mode 100644 index 00000000..7b73e153 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfFabricVcCreateInput.yaml @@ -0,0 +1,64 @@ +properties: + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Optional and defaults to the primary user email address when using a User API key or the organization owner email address when using a Project API key. + type: string + format: email + description: + type: string + facility_id: + type: string + x-deprecated: true + metro: + description: A Metro ID or code. When creating 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), or shared connections, 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. + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + service_token_type: + description: Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field + to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. + This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + enum: + - a_side + - z_side + example: a_side + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: + ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. + For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. + type: string + example: 10000000000 + tags: + items: + type: string + type: array + type: + description: When requesting for a Fabric VC, the value of this field should be 'shared'. + type: string + enum: + - shared + vrfs: + description: This field holds a list of VRF UUIDs that will be set automatically on the virtual circuits of Fabric VCs on + creation, and can hold up to two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. The first UUID will be set on the primary virtual circuit, + while the second UUID will be set on the secondary. The two UUIDs can be the same if both the primary and secondary virtual circuits will be in the same VRF. + This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + items: + format: uuid + type: string + type: array +required: +- name +- metro +- type +- redundancy +- service_token_type +- vrfs +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeCreateInput.yaml new file mode 100644 index 00000000..e6ef828d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeCreateInput.yaml @@ -0,0 +1,6 @@ +type: array +items: + type: string +description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/59"]. + IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /59 and /64. + A VRF\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeList.yaml new file mode 100644 index 00000000..1fd4ec14 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeList.yaml @@ -0,0 +1,4 @@ +type: array +items: + type: string +description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/59"]. diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeUpdateInput.yaml new file mode 100644 index 00000000..225732e1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeUpdateInput.yaml @@ -0,0 +1,10 @@ +type: array +items: + type: string +description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/59"]. + IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /59 and /64. + A VRF\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. + Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. + Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\'s associated Metal Gateways or Virtual Circuits. + If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. + Specifying a value of `[]` will remove all existing IP Ranges from the VRF. diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservation.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservation.yaml new file mode 100644 index 00000000..f17bd109 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservation.yaml @@ -0,0 +1,59 @@ +properties: + address_family: + type: integer + cidr: + type: integer + created_at: + format: date-time + type: string + created_by: + $ref: './Href.yaml' + details: + type: string + href: + type: string + id: + format: uuid + type: string + metal_gateway: + $ref: './MetalGatewayLite.yaml' + netmask: + type: string + network: + type: string + project: + $ref: './Project.yaml' + state: + type: string + tags: + items: + type: string + type: array + type: + type: string + enum: + - vrf + vrf: + $ref: './Vrf.yaml' + public: + type: boolean + management: + type: boolean + manageable: + type: boolean + customdata: + type: object + bill: + type: boolean + project_lite: + $ref: './Project.yaml' + address: + type: string + gateway: + type: string + metro: + $ref: './Metro.yaml' +required: + - vrf + - type +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationCreateInput.yaml new file mode 100644 index 00000000..23beae46 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationCreateInput.yaml @@ -0,0 +1,33 @@ +properties: + cidr: + type: integer + example: 22 + description: | + The size of the VRF IP Reservation's subnet. The following subnet sizes are supported: + - IPv4: between 22 - 29 inclusive + - IPv6: exactly 64 + customdata: + type: object + details: + type: string + network: + type: string + example: "10.1.2.0" + description: "The starting address for this VRF IP Reservation's subnet. Both IPv4 and IPv6 are supported." + tags: + items: + type: string + type: array + type: + type: string + example: vrf + description: "Must be set to 'vrf'" + vrf_id: + type: string + format: uuid + description: The ID of the VRF in which this VRF IP Reservation is created. The VRF must have an existing IP Range that contains the requested subnet. This field may be aliased as just 'vrf'. +required: + - cidr + - network + - type + - vrf_id diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationList.yaml new file mode 100644 index 00000000..bd84ddc8 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationList.yaml @@ -0,0 +1,6 @@ +properties: + ip_addresses: + items: + $ref: './VrfIpReservation.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfLearnedRoutes.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfLearnedRoutes.yaml new file mode 100644 index 00000000..b1cd8e1a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfLearnedRoutes.yaml @@ -0,0 +1,12 @@ +properties: + prefix: + type: string + example: "8.8.8.0/24" + origin_as: + description: The ASN of the peer that advertised the prefix. + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfLearnedRoutesList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfLearnedRoutesList.yaml new file mode 100644 index 00000000..b14a620f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfLearnedRoutesList.yaml @@ -0,0 +1,5 @@ +properties: + learned_routes: + items: + $ref: './VrfLearnedRoutes.yaml' + type: array \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfList.yaml new file mode 100644 index 00000000..337fb430 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfList.yaml @@ -0,0 +1,8 @@ +properties: + meta: + $ref: './Meta.yaml' + vrfs: + items: + $ref: './Vrf.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGateway.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGateway.yaml new file mode 100644 index 00000000..5864d01e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGateway.yaml @@ -0,0 +1,34 @@ +properties: + created_at: + format: date-time + type: string + created_by: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + ip_reservation: + $ref: './VrfIpReservation.yaml' + project: + $ref: './Project.yaml' + state: + description: The current state of the Metal Gateway. 'Ready' indicates the gateway + record has been configured, but is currently not active on the network. 'Active' + indicates the gateway has been configured on the network. 'Deleting' is a temporary + state used to indicate that the gateway is in the process of being un-configured + from the network, after which the gateway record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: './VirtualNetwork.yaml' + vrf: + $ref: './Vrf.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGatewayCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGatewayCreateInput.yaml new file mode 100644 index 00000000..cd871e48 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGatewayCreateInput.yaml @@ -0,0 +1,19 @@ +properties: + ip_reservation_id: + description: The UUID an a VRF IP Reservation that belongs to the same project as + the one in which the Metal Gateway is to be created. Additionally, the VRF IP Reservation + and the Virtual Network must reside in the same Metro. + format: uuid + type: string + virtual_network_id: + description: The UUID of a Metro Virtual Network that belongs to the same project as + the one in which the Metal Gateway is to be created. Additionally, the Virtual Network + and the VRF IP Reservation must reside in the same metro. In the case of the IP reservation + being an IPv6 based VRF IP Reservation, the Virtual Network must not already have an associated + IPv6 based VRF IP Reservation. There can be exactly one IPv6 based VRF IP Reservation + associated to a Virtual Network. + format: uuid + type: string +required: + - ip_reservation_id + - virtual_network_id diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfRoute.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRoute.yaml new file mode 100644 index 00000000..88bdf509 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRoute.yaml @@ -0,0 +1,61 @@ +properties: + id: + description: The unique identifier for the newly-created resource + format: uuid + type: string + readOnly: true + example: e1ff9c2b-051a-4688-965f-153e274f77e0 + status: + description: The status of the route. Potential values are "pending", "active", "deleting", and "error", representing various lifecycle states of the route and whether or not it has been successfully configured on the network + type: string + readOnly: true + example: active + enum: + - pending + - active + - deleting + - error + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation + type: string + example: 0.0.0.0/0 + next_hop: + description: The next-hop IPv4 address for the route + type: string + format: ipv4 + example: 192.168.1.254 + type: + description: VRF route type, like 'bgp', 'connected', and 'static'. Currently, only static routes are supported + type: string + readOnly: true + example: static + enum: + - static + created_at: + format: date-time + type: string + readOnly: true + updated_at: + format: date-time + type: string + readOnly: true + metal_gateway: + description: A link to the Metal Gateway to which this VRF Route is associated + readOnly: true + $ref: './VrfMetalGateway.yaml' + virtual_network: + description: A link to the Virtual Network to which this VRF Route is associated, through the Metal Gateway + readOnly: true + $ref: './VirtualNetwork.yaml' + vrf: + description: A link to the VRF within which this route exists + readOnly: true + $ref: './Vrf.yaml' + href: + type: string + readOnly: true + example: /routes/e1ff9c2b-051a-4688-965f-153e274f77e0 + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteCreateInput.yaml new file mode 100644 index 00000000..b9e672fb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteCreateInput.yaml @@ -0,0 +1,17 @@ +properties: + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be "0.0.0.0/0" + type: string + example: 0.0.0.0/0 + next_hop: + description: The IPv4 address within the VRF of the host that will handle this route + type: string + format: ipv4 + example: 192.168.1.254 + tags: + items: + type: string + type: array +required: +- prefix +- next_hop diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteList.yaml new file mode 100644 index 00000000..1c9f021e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteList.yaml @@ -0,0 +1,8 @@ +properties: + routes: + items: + $ref: './VrfRoute.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteUpdateInput.yaml new file mode 100644 index 00000000..db195555 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteUpdateInput.yaml @@ -0,0 +1,14 @@ +properties: + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be "0.0.0.0/0" + type: string + example: 0.0.0.0/0 + next_hop: + description: The IPv4 address within the VRF of the host that will handle this route + type: string + format: ipv4 + example: 192.168.1.254 + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfUpdateInput.yaml new file mode 100644 index 00000000..4dd5a4e3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfUpdateInput.yaml @@ -0,0 +1,24 @@ +properties: + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + description: + type: string + ip_ranges: + $ref: './VrfIpRangeUpdateInput.yaml' + local_asn: + type: integer + format: int32 + description: The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance. + name: + type: string + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuit.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuit.yaml new file mode 100644 index 00000000..c9e982aa --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuit.yaml @@ -0,0 +1,116 @@ +required: +- vrf +properties: + customer_ip: + description: >- + An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, + the last usable IP address in the subnet will be used. + type: string + example: "12.0.0.2" + customer_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, + the last usable IP address in the subnet IPv6 will be used. + type: string + example: "2604:1380:4641:a00::6" + description: + type: string + id: + format: uuid + type: string + md5: + description: >- + The MD5 password for the BGP peering in plaintext (not a checksum). + type: string + metal_ip: + description: >- + An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, + the first usable IP address in the subnet will be used. + type: string + example: "12.0.0.1" + metal_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, + the first usable IPv6 address in the subnet IPv6 will be used. + type: string + example: "2604:1380:4641:a00::6" + name: + type: string + port: + $ref: './InterconnectionPort.yaml' + nni_vlan: + type: integer + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual Circuit. + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 + project: + $ref: './Project.yaml' + speed: + description: integer representing bps speed + type: integer + format: int64 + status: + type: string + description: >- + The status changes of a VRF virtual circuit are generally the same as Virtual Circuits that aren't in a VRF. + However, for VRF Virtual Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' once + the Fabric service token associated with the virtual circuit has been redeemed on Fabric, and Metal has found + the associated Fabric connection. At this point, users can update the subnet, MD5 password, customer IP and/or + metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, we require all peering details to be set on + creation of a VRF Virtual Circuit. The status will change to `changing_peering_details` whenever an active VRF + Virtual Circuit has any of its peering details updated. + # NOTE: Any new additions to the enum will affect users using generated SDKs. + enum: + - pending + - waiting_on_peering_details + - activating + - changing_peering_details + - deactivating + - deleting + - active + - expired + - activation_failed + - changing_peering_details_failed + - deactivation_failed + - delete_failed + subnet: + description: >- + The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used + as the Metal or Customer IP. + type: string + example: "12.0.0.0/30" + subnet_ipv6: + description: The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer + IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used + as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined + IP Range for the VRF. + type: string + example: "2604:1380:4641:a00::4/126" + tags: + items: + type: string + type: array + type: + type: string + enum: + - vrf + vrf: + $ref: './Vrf.yaml' + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitCreateInput.yaml new file mode 100644 index 00000000..c61f2f4e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitCreateInput.yaml @@ -0,0 +1,90 @@ +properties: + customer_ip: + description: An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, + the last usable IP address in the subnet will be used. + type: string + example: "12.0.0.2" + description: + type: string + md5: + description: | + The plaintext BGP peering password shared by neighbors as an MD5 checksum: + * must be 10-20 characters long + * may not include punctuation + * must be a combination of numbers and letters + * must contain at least one lowercase, uppercase, and digit character + nullable: true + type: string + pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$' + metal_ip: + description: An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, + the first usable IP address in the subnet will be used. + type: string + example: "12.0.0.1" + name: + type: string + nni_vlan: + maximum: 4094 + minimum: 2 + type: integer + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual Circuit. + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 + project_id: + format: uuid + type: string + speed: + description: speed can be passed as integer number representing bps speed or string + (e.g. '52m' or '100g' or '4 gbps') + type: string + subnet: + description: The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used + as the Metal or Customer IP. The subnet specified must be contained within an already-defined + IP Range for the VRF. + type: string + example: "12.0.0.0/30" + tags: + items: + type: string + type: array + vrf: + description: The UUID of the VRF that will be associated with the Virtual Circuit. + format: uuid + type: string + subnet_ipv6: + description: The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer + IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used + as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined + IP Range for the VRF. + type: string + example: "2604:1380:4641:a00::4/126" + customer_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, + the last usable IP address in the subnet IPv6 will be used. + type: string + example: "2604:1380:4641:a00::6" + metal_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, + the first usable IPv6 address in the subnet IPv6 will be used. + type: string + example: "2604:1380:4641:a00::6" +type: object +required: +- nni_vlan +- peer_asn +- project_id +- subnet +- vrf diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitUpdateInput.yaml new file mode 100644 index 00000000..10953ec2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitUpdateInput.yaml @@ -0,0 +1,73 @@ +properties: + customer_ip: + description: >- + An IPv4 address from the subnet that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, + the last usable IP address in the subnet will be used. + type: string + example: "12.0.0.2" + description: + type: string + md5: + description: | + The plaintext BGP peering password shared by neighbors as an MD5 checksum: + * must be 10-20 characters long + * may not include punctuation + * must be a combination of numbers and letters + * must contain at least one lowercase, uppercase, and digit character + type: string + pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$' + metal_ip: + description: >- + An IPv4 address from the subnet that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, + the first usable IP address in the subnet will be used. + type: string + example: "12.0.0.1" + name: + type: string + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual Circuit. + type: integer + format: int64 + minimum: 0 + maximum: 4294967295 + example: 65000 + speed: + description: Speed can be changed only if it is an interconnection on a Dedicated Port + type: string + subnet: + description: >- + The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used + as the Metal or Customer IP. + type: string + example: "12.0.0.0/30" + subnet_ipv6: + description: The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IPv6 and Customer + IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast IPs cannot be used + as the Metal IPv6 or Customer IPv6. The subnet specified must be contained within an already-defined + IP Range for the VRF. + type: string + example: "2604:1380:4641:a00::4/126" + customer_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, + the last usable IP address in the subnet IPv6 will be used. + type: string + example: "2604:1380:4641:a00::6" + metal_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, + the first usable IPv6 address in the subnet IPv6 will be used. + type: string + example: "2604:1380:4641:a00::6" + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/openapi3.yaml b/spec/services/metalv1/oas3.fetched/openapi3.yaml new file mode 100644 index 00000000..bb464539 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/openapi3.yaml @@ -0,0 +1,1147 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Metal API + contact: + email: support@equinixmetal.com + name: Equinix Metal API Team + description: | + # 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. + license: + name: Equinix Metal + url: https://www.equinix.com/about/legal/terms + termsOfService: https://www.equinix.com/about/legal/privacy +security: + - x_auth_token: [] +servers: + - url: https://api.equinix.com/metal/v1 +components: + parameters: + DeviceSearch: + $ref: './components/parameters/DeviceSearch.yaml' + ProjectName: + $ref: './components/parameters/ProjectName.yaml' + Page: + $ref: './components/parameters/Page.yaml' + PerPage: + $ref: './components/parameters/PerPage.yaml' + Include: + $ref: './components/parameters/Include.yaml' + Exclude: + $ref: './components/parameters/Exclude.yaml' + requestBodies: + InterconnectionCreateInput: + $ref: './components/requestBodies/InterconnectionCreateInput.yaml' + InvitationInput: + $ref: './components/requestBodies/InvitationInput.yaml' + PortAssignInput: + $ref: './components/requestBodies/PortAssignInput.yaml' + SSHKeyCreateInput: + $ref: './components/requestBodies/SSHKeyCreateInput.yaml' + schemas: + Address: + $ref: './components/schemas/Address.yaml' + Attribute: + $ref: './components/schemas/Attribute.yaml' + AttributeData: + $ref: './components/schemas/AttributeData.yaml' + AuthToken: + $ref: './components/schemas/AuthToken.yaml' + AuthTokenInput: + $ref: './components/schemas/AuthTokenInput.yaml' + AuthTokenList: + $ref: './components/schemas/AuthTokenList.yaml' + BGPSessionInput: + $ref: './components/schemas/BGPSessionInput.yaml' + Batch: + $ref: './components/schemas/Batch.yaml' + BatchesList: + $ref: './components/schemas/BatchesList.yaml' + BgpConfig: + $ref: './components/schemas/BgpConfig.yaml' + BgpConfigRequestInput: + $ref: './components/schemas/BgpConfigRequestInput.yaml' + BgpDynamicNeighbor: + $ref: './components/schemas/BgpDynamicNeighbor.yaml' + BgpDynamicNeighborCreateInput: + $ref: './components/schemas/BgpDynamicNeighborCreateInput.yaml' + BgpDynamicNeighborList: + $ref: './components/schemas/BgpDynamicNeighborList.yaml' + BgpNeighborData: + $ref: './components/schemas/BgpNeighborData.yaml' + BgpSession: + $ref: './components/schemas/BgpSession.yaml' + BgpSessionList: + $ref: './components/schemas/BgpSessionList.yaml' + BgpSessionNeighbors: + $ref: './components/schemas/BgpSessionNeighbors.yaml' + CapacityCheckPerFacilityInfo: + $ref: './components/schemas/CapacityCheckPerFacilityInfo.yaml' + CapacityCheckPerFacilityList: + $ref: './components/schemas/CapacityCheckPerFacilityList.yaml' + CapacityCheckPerMetroInfo: + $ref: './components/schemas/CapacityCheckPerMetroInfo.yaml' + CapacityCheckPerMetroList: + $ref: './components/schemas/CapacityCheckPerMetroList.yaml' + CapacityInput: + $ref: './components/schemas/CapacityInput.yaml' + CapacityLevelPerBaremetal: + $ref: './components/schemas/CapacityLevelPerBaremetal.yaml' + CapacityList: + $ref: './components/schemas/CapacityList.yaml' + CapacityReport: + $ref: './components/schemas/CapacityReport.yaml' + Component: + $ref: './components/schemas/Component.yaml' + Coordinates: + $ref: './components/schemas/Coordinates.yaml' + CreateEmailInput: + $ref: './components/schemas/CreateEmailInput.yaml' + CreateSelfServiceReservationRequest: + $ref: './components/schemas/CreateSelfServiceReservationRequest.yaml' + DedicatedPortCreateInput: + $ref: './components/schemas/DedicatedPortCreateInput.yaml' + Device: + $ref: './components/schemas/Device.yaml' + DeviceCreateInput: + $ref: './components/schemas/DeviceCreateInput.yaml' + DeviceHealthRollup: + $ref: './components/schemas/DeviceHealthRollup.yaml' + DeviceCreateInFacilityInput: + $ref: './components/schemas/DeviceCreateInFacilityInput.yaml' + DeviceCreateInMetroInput: + $ref: './components/schemas/DeviceCreateInMetroInput.yaml' + DeviceList: + $ref: './components/schemas/DeviceList.yaml' + DeviceUpdateInput: + $ref: './components/schemas/DeviceUpdateInput.yaml' + DeviceUsage: + $ref: './components/schemas/DeviceUsage.yaml' + DeviceUsageList: + $ref: './components/schemas/DeviceUsageList.yaml' + Email: + $ref: './components/schemas/Email.yaml' + EmailInput: + $ref: './components/schemas/EmailInput.yaml' + Entitlement: + $ref: './components/schemas/Entitlement.yaml' + Error: + $ref: './components/schemas/Error.yaml' + Event: + $ref: './components/schemas/Event.yaml' + EventList: + $ref: './components/schemas/EventList.yaml' + FabricServiceToken: + $ref: './components/schemas/FabricServiceToken.yaml' + Facility: + $ref: './components/schemas/Facility.yaml' + FacilityInput: + $ref: './components/schemas/FacilityInput.yaml' + FacilityList: + $ref: './components/schemas/FacilityList.yaml' + FirmwareSet: + $ref: './components/schemas/FirmwareSet.yaml' + FirmwareSetList: + $ref: './components/schemas/FirmwareSetList.yaml' + FirmwareSetListResponse: + $ref: './components/schemas/FirmwareSetListResponse.yaml' + FirmwareSetResponse: + $ref: './components/schemas/FirmwareSetResponse.yaml' + GlobalBgpRange: + $ref: './components/schemas/GlobalBgpRange.yaml' + GlobalBgpRangeList: + $ref: './components/schemas/GlobalBgpRangeList.yaml' + HardwareReservation: + $ref: './components/schemas/HardwareReservation.yaml' + HardwareReservationList: + $ref: './components/schemas/HardwareReservationList.yaml' + Href: + $ref: './components/schemas/Href.yaml' + IPAddress: + $ref: './components/schemas/IPAddress.yaml' + IPAssignment: + $ref: './components/schemas/IPAssignment.yaml' + IPAssignmentInput: + $ref: './components/schemas/IPAssignmentInput.yaml' + IPAssignmentList: + $ref: './components/schemas/IPAssignmentList.yaml' + IPAvailabilitiesList: + $ref: './components/schemas/IPAvailabilitiesList.yaml' + IPReservation: + $ref: './components/schemas/IPReservation.yaml' + IPReservationList: + $ref: './components/schemas/IPReservationList.yaml' + IPReservationRequestInput: + $ref: './components/schemas/IPReservationRequestInput.yaml' + InstancesBatchCreateInput: + $ref: './components/schemas/InstancesBatchCreateInput.yaml' + Interconnection: + $ref: './components/schemas/Interconnection.yaml' + InterconnectionList: + $ref: './components/schemas/InterconnectionList.yaml' + InterconnectionPort: + $ref: './components/schemas/InterconnectionPort.yaml' + InterconnectionPortList: + $ref: './components/schemas/InterconnectionPortList.yaml' + InterconnectionUpdateInput: + $ref: './components/schemas/InterconnectionUpdateInput.yaml' + Invitation: + $ref: './components/schemas/Invitation.yaml' + InvitationInput: + $ref: './components/schemas/InvitationInput.yaml' + InvitationList: + $ref: './components/schemas/InvitationList.yaml' + Invoice: + $ref: './components/schemas/Invoice.yaml' + InvoiceList: + $ref: './components/schemas/InvoiceList.yaml' + License: + $ref: './components/schemas/License.yaml' + LicenseCreateInput: + $ref: './components/schemas/LicenseCreateInput.yaml' + LicenseList: + $ref: './components/schemas/LicenseList.yaml' + LicenseUpdateInput: + $ref: './components/schemas/LicenseUpdateInput.yaml' + LineItem: + $ref: './components/schemas/LineItem.yaml' + Membership: + $ref: './components/schemas/Membership.yaml' + MembershipInput: + $ref: './components/schemas/MembershipInput.yaml' + MembershipList: + $ref: './components/schemas/MembershipList.yaml' + Meta: + $ref: './components/schemas/Meta.yaml' + Metadata: + $ref: './components/schemas/Metadata.yaml' + MetalGateway: + $ref: './components/schemas/MetalGateway.yaml' + MetalGatewayCreateInput: + $ref: './components/schemas/MetalGatewayCreateInput.yaml' + MetalGatewayElasticIpCreateInput: + $ref: './components/schemas/MetalGatewayElasticIpCreateInput.yaml' + MetalGatewayList: + $ref: './components/schemas/MetalGatewayList.yaml' + MetalGatewayLite: + $ref: './components/schemas/MetalGatewayLite.yaml' + Metro: + $ref: './components/schemas/Metro.yaml' + MetroInput: + $ref: './components/schemas/MetroInput.yaml' + MetroList: + $ref: './components/schemas/MetroList.yaml' + NewPassword: + $ref: './components/schemas/NewPassword.yaml' + OperatingSystem: + $ref: './components/schemas/OperatingSystem.yaml' + OperatingSystemList: + $ref: './components/schemas/OperatingSystemList.yaml' + Organization: + $ref: './components/schemas/Organization.yaml' + OrganizationInput: + $ref: './components/schemas/OrganizationInput.yaml' + OrganizationList: + $ref: './components/schemas/OrganizationList.yaml' + ParentBlock: + $ref: './components/schemas/ParentBlock.yaml' + PaymentMethod: + $ref: './components/schemas/PaymentMethod.yaml' + PaymentMethodBillingAddress: + $ref: './components/schemas/PaymentMethodBillingAddress.yaml' + PaymentMethodCreateInput: + $ref: './components/schemas/PaymentMethodCreateInput.yaml' + PaymentMethodList: + $ref: './components/schemas/PaymentMethodList.yaml' + PaymentMethodUpdateInput: + $ref: './components/schemas/PaymentMethodUpdateInput.yaml' + Plan: + $ref: './components/schemas/Plan.yaml' + PlanList: + $ref: './components/schemas/PlanList.yaml' + Port: + $ref: './components/schemas/Port.yaml' + PortAssignInput: + $ref: './components/schemas/PortAssignInput.yaml' + PortConvertLayer3Input: + $ref: './components/schemas/PortConvertLayer3Input.yaml' + PortVlanAssignment: + $ref: './components/schemas/PortVlanAssignment.yaml' + PortVlanAssignmentBatch: + $ref: './components/schemas/PortVlanAssignmentBatch.yaml' + PortVlanAssignmentBatchCreateInput: + $ref: './components/schemas/PortVlanAssignmentBatchCreateInput.yaml' + PortVlanAssignmentBatchList: + $ref: './components/schemas/PortVlanAssignmentBatchList.yaml' + PortVlanAssignmentList: + $ref: './components/schemas/PortVlanAssignmentList.yaml' + Project: + $ref: './components/schemas/Project.yaml' + ProjectCreateFromRootInput: + $ref: './components/schemas/ProjectCreateFromRootInput.yaml' + ProjectCreateInput: + $ref: './components/schemas/ProjectCreateInput.yaml' + ProjectIdName: + $ref: './components/schemas/ProjectIdName.yaml' + ProjectList: + $ref: './components/schemas/ProjectList.yaml' + ProjectUpdateInput: + $ref: './components/schemas/ProjectUpdateInput.yaml' + ProjectUsage: + $ref: './components/schemas/ProjectUsage.yaml' + ProjectUsageList: + $ref: './components/schemas/ProjectUsageList.yaml' + RecoveryCodeList: + $ref: './components/schemas/RecoveryCodeList.yaml' + SSHKey: + $ref: './components/schemas/SSHKey.yaml' + SSHKeyCreateInput: + $ref: './components/schemas/SSHKeyCreateInput.yaml' + SSHKeyInput: + $ref: './components/schemas/SSHKeyInput.yaml' + SSHKeyList: + $ref: './components/schemas/SSHKeyList.yaml' + SelfServiceReservationItemRequest: + $ref: './components/schemas/SelfServiceReservationItemRequest.yaml' + SelfServiceReservationItemResponse: + $ref: './components/schemas/SelfServiceReservationItemResponse.yaml' + SelfServiceReservationList: + $ref: './components/schemas/SelfServiceReservationList.yaml' + SelfServiceReservationResponse: + $ref: './components/schemas/SelfServiceReservationResponse.yaml' + ServerInfo: + $ref: './components/schemas/ServerInfo.yaml' + SharedPortVCVlanCreateInput: + $ref: './components/schemas/SharedPortVCVlanCreateInput.yaml' + SpotMarketPricesList: + $ref: './components/schemas/SpotMarketPricesList.yaml' + SpotMarketPricesPerMetroList: + $ref: './components/schemas/SpotMarketPricesPerMetroList.yaml' + SpotMarketPricesPerMetroReport: + $ref: './components/schemas/SpotMarketPricesPerMetroReport.yaml' + SpotMarketRequest: + $ref: './components/schemas/SpotMarketRequest.yaml' + SpotMarketRequestCreateInput: + $ref: './components/schemas/SpotMarketRequestCreateInput.yaml' + SpotMarketRequestList: + $ref: './components/schemas/SpotMarketRequestList.yaml' + SpotPricesDatapoints: + $ref: './components/schemas/SpotPricesDatapoints.yaml' + SpotPricesDatapointsList: + $ref: './components/schemas/SpotPricesDatapointsList.yaml' + SpotPricesHistoryReport: + $ref: './components/schemas/SpotPricesHistoryReport.yaml' + SpotPricesPerBaremetal: + $ref: './components/schemas/SpotPricesPerBaremetal.yaml' + SpotPricesPerFacility: + $ref: './components/schemas/SpotPricesPerFacility.yaml' + SpotPricesPerNewFacility: + $ref: './components/schemas/SpotPricesPerNewFacility.yaml' + SpotPricesReport: + $ref: './components/schemas/SpotPricesReport.yaml' + SupportRequestInput: + $ref: './components/schemas/SupportRequestInput.yaml' + TransferRequest: + $ref: './components/schemas/TransferRequest.yaml' + TransferRequestInput: + $ref: './components/schemas/TransferRequestInput.yaml' + TransferRequestList: + $ref: './components/schemas/TransferRequestList.yaml' + UpdateEmailInput: + $ref: './components/schemas/UpdateEmailInput.yaml' + User: + $ref: './components/schemas/User.yaml' + UserCreateInput: + $ref: './components/schemas/UserCreateInput.yaml' + Userdata: + $ref: './components/schemas/Userdata.yaml' + UserLimited: + $ref: './components/schemas/UserLimited.yaml' + UserList: + $ref: './components/schemas/UserList.yaml' + UserLite: + $ref: './components/schemas/UserLite.yaml' + UserUpdateInput: + $ref: './components/schemas/UserUpdateInput.yaml' + VerifyEmail: + $ref: './components/schemas/VerifyEmail.yaml' + VirtualCircuit: + $ref: './components/schemas/VirtualCircuit.yaml' + VirtualCircuitCreateInput: + $ref: './components/schemas/VirtualCircuitCreateInput.yaml' + VirtualCircuitList: + $ref: './components/schemas/VirtualCircuitList.yaml' + VirtualCircuitUpdateInput: + $ref: './components/schemas/VirtualCircuitUpdateInput.yaml' + VirtualNetwork: + $ref: './components/schemas/VirtualNetwork.yaml' + VirtualNetworkCreateInput: + $ref: './components/schemas/VirtualNetworkCreateInput.yaml' + VirtualNetworkList: + $ref: './components/schemas/VirtualNetworkList.yaml' + VlanCSPConnectionCreateInput: + $ref: './components/schemas/VlanCSPConnectionCreateInput.yaml' + VlanFabricVcCreateInput: + $ref: './components/schemas/VlanFabricVcCreateInput.yaml' + VlanVirtualCircuit: + $ref: './components/schemas/VlanVirtualCircuit.yaml' + VlanVirtualCircuitCreateInput: + $ref: './components/schemas/VlanVirtualCircuitCreateInput.yaml' + VlanVirtualCircuitUpdateInput: + $ref: './components/schemas/VlanVirtualCircuitUpdateInput.yaml' + Vrf: + $ref: './components/schemas/Vrf.yaml' + VrfCreateInput: + $ref: './components/schemas/VrfCreateInput.yaml' + VrfFabricVcCreateInput: + $ref: './components/schemas/VrfFabricVcCreateInput.yaml' + VrfIpRangeCreateInput: + $ref: './components/schemas/VrfIpRangeCreateInput.yaml' + VrfIpRangeList: + $ref: './components/schemas/VrfIpRangeList.yaml' + VrfIpRangeUpdateInput: + $ref: './components/schemas/VrfIpRangeUpdateInput.yaml' + VrfIpReservation: + $ref: './components/schemas/VrfIpReservation.yaml' + VrfIpReservationCreateInput: + $ref: './components/schemas/VrfIpReservationCreateInput.yaml' + VrfIpReservationList: + $ref: './components/schemas/VrfIpReservationList.yaml' + VrfList: + $ref: './components/schemas/VrfList.yaml' + VrfMetalGateway: + $ref: './components/schemas/VrfMetalGateway.yaml' + VrfMetalGatewayCreateInput: + $ref: './components/schemas/VrfMetalGatewayCreateInput.yaml' + VrfRoute: + $ref: './components/schemas/VrfRoute.yaml' + VrfRouteCreateInput: + $ref: './components/schemas/VrfRouteCreateInput.yaml' + VrfRouteUpdateInput: + $ref: './components/schemas/VrfRouteUpdateInput.yaml' + VrfRouteList: + $ref: './components/schemas/VrfRouteList.yaml' + VrfUpdateInput: + $ref: './components/schemas/VrfUpdateInput.yaml' + VrfVirtualCircuit: + $ref: './components/schemas/VrfVirtualCircuit.yaml' + VrfVirtualCircuitCreateInput: + $ref: './components/schemas/VrfVirtualCircuitCreateInput.yaml' + VrfVirtualCircuitUpdateInput: + $ref: './components/schemas/VrfVirtualCircuitUpdateInput.yaml' + VrfBGPNeighbors: + $ref: './components/schemas/VrfBGPNeighbors.yaml' + VrfLearnedRoutes: + $ref: './components/schemas/VrfLearnedRoutes.yaml' + securitySchemes: + x_auth_token: + in: header + name: X-Auth-Token + type: apiKey + x-displayName: X-Auth-Token + description: |+ + HTTP header containing the User or Project API key that will be used to authenticate the request. +paths: + /api-keys/{id}: + $ref: ./paths/api-keys/id.yaml + /batches/{id}: + $ref: ./paths/batches/id.yaml + /bgp/sessions/{id}: + $ref: ./paths/bgp/sessions/id.yaml + /bgp-dynamic-neighbors/{id}: + $ref: ./paths/bgp-dynamic-neighbors/id.yaml + /capacity: + $ref: ./paths/capacity.yaml + /capacity/metros: + $ref: ./paths/capacity/metros.yaml + /connections/metros: + $ref: ./paths/connections/metros.yaml + /connections/prices: + $ref: ./paths/connections/prices.yaml + /connections/{connection_id}: + $ref: ./paths/connections/connection_id.yaml + /connections/{connection_id}/events: + $ref: ./paths/connections/connection_id/events.yaml + /connections/{connection_id}/ports: + $ref: ./paths/connections/connection_id/ports.yaml + /connections/{connection_id}/virtual-circuits: + $ref: ./paths/connections/connection_id/virtual-circuits.yaml + /connections/{connection_id}/ports/{id}: + $ref: ./paths/connections/connection_id/ports/id.yaml + /connections/{connection_id}/ports/{id}/events: + $ref: ./paths/connections/connection_id/ports/id/events.yaml + /connections/{connection_id}/ports/{port_id}/virtual-circuits: + $ref: ./paths/connections/connection_id/ports/port_id/virtual-circuits.yaml + /devices/{id}: + $ref: ./paths/devices/id.yaml + /devices/{id}/actions: + $ref: ./paths/devices/id/actions.yaml + /devices/{id}/bandwidth: + $ref: ./paths/devices/id/bandwidth.yaml + /devices/{id}/bgp/neighbors: + $ref: ./paths/devices/id/bgp/neighbors.yaml + /devices/{id}/bgp/sessions: + $ref: ./paths/devices/id/bgp/sessions.yaml + /devices/{id}/customdata: + $ref: ./paths/devices/id/customdata.yaml + /devices/{id}/diagnostics/screenshot: + $ref: ./paths/devices/id/diagnostics/screenshot.yaml + /devices/{id}/diagnostics/health/rollup: + $ref: ./paths/devices/id/diagnostics/health/rollup.yaml + /devices/{id}/events: + $ref: ./paths/devices/id/events.yaml + /devices/{id}/firmware-sets: + $ref: ./paths/devices/id/firmware-sets.yaml + /devices/{id}/ips: + $ref: ./paths/devices/id/ips.yaml + /devices/{id}/metadata: + $ref: ./paths/devices/id/metadata.yaml + /devices/{id}/ssh-keys: + $ref: ./paths/devices/id/ssh-keys.yaml + /devices/{id}/traffic: + $ref: ./paths/devices/id/traffic.yaml + /devices/{id}/usages: + $ref: ./paths/devices/id/usages.yaml + /devices/{id}/userdata: + $ref: ./paths/devices/id/userdata.yaml + /devices/{instance_id}/ips/{id}/customdata: + $ref: ./paths/devices/instance_id/ips/id/customdata.yaml + /emails: + $ref: ./paths/emails.yaml + /emails/{id}: + $ref: ./paths/emails/id.yaml + /events: + $ref: ./paths/events.yaml + /events/{id}: + $ref: ./paths/events/id.yaml + /facilities: + $ref: ./paths/facilities.yaml + /hardware-reservations/{id}: + $ref: ./paths/hardware-reservations/id.yaml + /hardware-reservations/{id}/activate: + $ref: ./paths/hardware-reservations/id/activate.yaml + /hardware-reservations/{id}/move: + $ref: ./paths/hardware-reservations/id/move.yaml + /incidents: + $ref: ./paths/incidents.yaml + /invitations: + $ref: ./paths/invitations.yaml + /invitations/{id}: + $ref: ./paths/invitations/id.yaml + /invoices/{id}: + $ref: ./paths/invoices/id.yaml + /ips/{id}: + $ref: ./paths/ips/id.yaml + /ips/{id}/available: + $ref: ./paths/ips/id/available.yaml + /ips/{id}/customdata: + $ref: ./paths/ips/id/customdata.yaml + /licenses/{id}: + $ref: ./paths/licenses/id.yaml + /locations/metros: + $ref: ./paths/locations/metros.yaml + /locations/metros/{id}: + $ref: ./paths/locations/metros/id.yaml + /market/spot/prices: + $ref: ./paths/market/spot/prices.yaml + /market/spot/prices/history: + $ref: ./paths/market/spot/prices/history.yaml + /market/spot/prices/metros: + $ref: ./paths/market/spot/prices/metros.yaml + /memberships/{id}: + $ref: ./paths/memberships/id.yaml + /metal-gateways/{id}: + $ref: ./paths/metal-gateways/id.yaml + /metal-gateways/{id}/bgp-dynamic-neighbors: + $ref: ./paths/metal-gateways/id/bgp-dynamic-neighbors.yaml + /metal-gateways/{id}/ips: + $ref: ./paths/metal-gateways/id/ips.yaml + /operating-system-versions: + $ref: ./paths/operating-system-versions.yaml + /operating-systems: + $ref: ./paths/operating-systems.yaml + /organizations: + $ref: ./paths/organizations.yaml + /organizations/{id}: + $ref: ./paths/organizations/id.yaml + /organizations/{id}/capacity: + $ref: ./paths/organizations/id/capacity.yaml + /organizations/{id}/capacity/metros: + $ref: ./paths/organizations/id/capacity/metros.yaml + /organizations/{id}/customdata: + $ref: ./paths/organizations/id/customdata.yaml + /organizations/{id}/devices: + $ref: ./paths/organizations/id/devices.yaml + /organizations/{id}/events: + $ref: ./paths/organizations/id/events.yaml + /organizations/{id}/facilities: + $ref: ./paths/organizations/id/facilities.yaml + /organizations/{id}/firmware-sets: + $ref: ./paths/organizations/id/firmware-sets.yaml + /organizations/{id}/invitations: + $ref: ./paths/organizations/id/invitations.yaml + /organizations/{id}/invoices: + $ref: ./paths/organizations/id/invoices.yaml + /organizations/{id}/operating-systems: + $ref: ./paths/organizations/id/operating-systems.yaml + /organizations/{id}/payment-methods: + $ref: ./paths/organizations/id/payment-methods.yaml + /organizations/{id}/plans: + $ref: ./paths/organizations/id/plans.yaml + /organizations/{id}/projects: + $ref: ./paths/organizations/id/projects.yaml + /organizations/{id}/transfers: + $ref: ./paths/organizations/id/transfers.yaml + /organizations/{organization_id}/connections: + $ref: ./paths/organizations/organization_id/connections.yaml + /payment-methods/{id}: + $ref: ./paths/payment-methods/id.yaml + /plans: + $ref: ./paths/plans.yaml + /ports/{id}: + $ref: ./paths/ports/id.yaml + /ports/{id}/assign: + $ref: ./paths/ports/id/assign.yaml + /ports/{id}/bond: + $ref: ./paths/ports/id/bond.yaml + /ports/{id}/convert/layer-2: + $ref: ./paths/ports/id/convert/layer-2.yaml + /ports/{id}/convert/layer-3: + $ref: ./paths/ports/id/convert/layer-3.yaml + /ports/{id}/disbond: + $ref: ./paths/ports/id/disbond.yaml + /ports/{id}/native-vlan: + $ref: ./paths/ports/id/native-vlan.yaml + /ports/{id}/unassign: + $ref: ./paths/ports/id/unassign.yaml + /ports/{id}/vlan-assignments: + $ref: ./paths/ports/id/vlan-assignments.yaml + /ports/{id}/vlan-assignments/{assignment_id}: + $ref: ./paths/ports/id/vlan-assignments/assignment_id.yaml + /ports/{id}/vlan-assignments/batches: + $ref: ./paths/ports/id/vlan-assignments/batches.yaml + /ports/{id}/vlan-assignments/batches/{batch_id}: + $ref: ./paths/ports/id/vlan-assignments/batches/batch_id.yaml + /projects: + $ref: ./paths/projects.yaml + /projects/{id}: + $ref: ./paths/projects/id.yaml + /projects/{id}/api-keys: + $ref: ./paths/projects/id/api-keys.yaml + /projects/{id}/batches: + $ref: ./paths/projects/id/batches.yaml + /projects/{id}/bgp-config: + $ref: ./paths/projects/id/bgp-config.yaml + /projects/{id}/bgp-configs: + $ref: ./paths/projects/id/bgp-configs.yaml + /projects/{id}/bgp/sessions: + $ref: ./paths/projects/id/bgp/sessions.yaml + /projects/{id}/customdata: + $ref: ./paths/projects/id/customdata.yaml + /projects/{id}/devices: + $ref: ./paths/projects/id/devices.yaml + /projects/{id}/devices/batch: + $ref: ./paths/projects/id/devices/batch.yaml + /projects/{id}/events: + $ref: ./paths/projects/id/events.yaml + /projects/{id}/facilities: + $ref: ./paths/projects/id/facilities.yaml + /projects/{id}/firmware-sets: + $ref: ./paths/projects/id/firmware-sets.yaml + /projects/{id}/global-bgp-ranges: + $ref: ./paths/projects/id/global-bgp-ranges.yaml + /projects/{id}/hardware-reservations: + $ref: ./paths/projects/id/hardware-reservations.yaml + /projects/{id}/ips: + $ref: ./paths/projects/id/ips.yaml + /projects/{id}/licenses: + $ref: ./paths/projects/id/licenses.yaml + /projects/{id}/plans: + $ref: ./paths/projects/id/plans.yaml + /projects/{id}/spot-market-requests: + $ref: ./paths/projects/id/spot-market-requests.yaml + /projects/{id}/ssh-keys: + $ref: ./paths/projects/id/ssh-keys.yaml + /projects/{id}/transfers: + $ref: ./paths/projects/id/transfers.yaml + /projects/{id}/usages: + $ref: ./paths/projects/id/usages.yaml + /projects/{id}/virtual-networks: + $ref: ./paths/projects/id/virtual-networks.yaml + /projects/{id}/vrfs: + $ref: ./paths/projects/id/vrfs.yaml + /projects/{project_id}/connections: + $ref: ./paths/projects/project_id/connections.yaml + /projects/{project_id}/invitations: + $ref: ./paths/projects/project_id/invitations.yaml + /projects/{project_id}/ips/{id}/customdata: + $ref: ./paths/projects/project_id/ips/id/customdata.yaml + /projects/{project_id}/memberships: + $ref: ./paths/projects/project_id/memberships.yaml + /projects/{project_id}/metal-gateways: + $ref: ./paths/projects/project_id/metal-gateways.yaml + /projects/{project_id}/self-service/reservations: + $ref: ./paths/projects/project_id/self-service/reservations.yaml + /projects/{project_id}/self-service/reservations/{id}: + $ref: ./paths/projects/project_id/self-service/reservations/id.yaml + /reset-password: + $ref: ./paths/reset-password.yaml + /routes/{id}: + $ref: ./paths/routes/id.yaml + /routes/{id}/events: + $ref: ./paths/routes/id/events.yaml + /spot-market-requests/{id}: + $ref: ./paths/spot-market-requests/id.yaml + /ssh-keys: + $ref: ./paths/ssh-keys.yaml + /ssh-keys/{id}: + $ref: ./paths/ssh-keys/id.yaml + /support-requests: + $ref: ./paths/support-requests.yaml + /transfers/{id}: + $ref: ./paths/transfers/id.yaml + /user: + $ref: ./paths/user.yaml + /user/api-keys: + $ref: ./paths/user/api-keys.yaml + /user/api-keys/{id}: + $ref: ./paths/user/api-keys/id.yaml + /user/otp/app: + $ref: ./paths/user/otp/app.yaml + /user/otp/recovery-codes: + $ref: ./paths/user/otp/recovery-codes.yaml + /user/otp/sms: + $ref: ./paths/user/otp/sms.yaml + /user/otp/sms/receive: + $ref: ./paths/user/otp/sms/receive.yaml + /user/otp/verify/{otp}: + $ref: ./paths/user/otp/verify/otp.yaml + /userdata/validate: + $ref: ./paths/userdata/validate.yaml + /users: + $ref: ./paths/users.yaml + /users/{id}: + $ref: ./paths/users/id.yaml + /users/{id}/customdata: + $ref: ./paths/users/id/customdata.yaml + /verify-email: + $ref: ./paths/verify-email.yaml + /virtual-circuits/{id}/events: + $ref: ./paths/virtual-circuits/id/events.yaml + /virtual-circuits/{id}: + $ref: ./paths/virtual-circuits/id.yaml + /virtual-networks/{id}: + $ref: ./paths/virtual-networks/id.yaml + /vrfs/{id}: + $ref: ./paths/vrfs/id.yaml + /vrfs/{id}/ips: + $ref: ./paths/vrfs/id/ips.yaml + /vrfs/{vrf_id}/ips/{id}: + $ref: ./paths/vrfs/vrf_id/ips/id.yaml + /vrfs/{id}/routes: + $ref: ./paths/vrfs/id/routes.yaml + /vrfs/{id}/learned-routes: + $ref: ./paths/vrfs/id/learned-routes.yaml + /vrfs/{id}/bgp-neighbors: + $ref: ./paths/vrfs/id/bgp-neighbors.yaml + +tags: + - description: |+ + Nearly all of the endpoints in the API require authentication. Authentication is performed by providing an authentication token (interchangeably referred to as an API key) in the `X-Auth-Token` HTTP request header. + + + + User API keys can be obtained by creating them in the Equinix Metal Portal or by using the [Create a User API Key](#operation/createAPIKey) endpoint. + + Project API keys can also be obtained by creating them in the Equinix Metal Portal or by using the [Create a Project API Key](#operation/createProjectAPIKey) endpoint. Project API keys are scoped to a single project and can only be used to access resources within that project. + + For example, to use an authenticated API token, you would make a request like the following: + + ```bash + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/user/api-keys + ``` + + Applications can take advantage of the Equinix Metal API and API keys to perform any of the actions that can be performed in the Equinix Metal Portal. For example, you can use the API to create and manage devices, projects, and other resources. + + API keys can be deleted without affecting any of the resources created with them. Access to applications using the API can be revoked by deleting the API key used to authenticate the application. + name: Authentication + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/api-keys/ + - description: | + Equinix Metal uses conventional HTTP response codes to indicate the success or failure of an API request. + + In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Equinix Metal's servers (these are rare). + + | Code | Summary + | ---------------------------------- | ------------------------------------------------------ + | 200 OK | Everything worked as expected. + | 201 Create | Everything worked as expected, the resource was created. + | 422 Bad Request | The request was unacceptable, often due to missing a required parameter. + | 401 Unauthorized | No valid API key provided. + | 404 Not Found | The requested resource doesn't exist. + | 500, 502, 503, 504 - Server Errors | Something went wrong on Equinix Metal's end. (These are rare.) + + Errors (4xx, 5xx) reported by the API will include a JSON error response. This response will be structured as one of the following: + + ```json + {"error": "the error message"} + ``` + + or + + ```json + {"errors": ["one error", "another error"} + ``` + + The JSON response is not guaranteed so check the HTTP status message. JSON may not be included if the error is reported by an API intermediary, like a loadbalancer service. + name: Errors + - description: > + Manage device batches. See project endpoints to list batches for a + particular project. Check out the product docs to learn more about [Batch + Deployment](https://deploy.equinix.com/developers/docs/metal/deploy/batch-deployment/). + name: Batches + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/batch-deployment/ + - description: > + Manage BGP configs and sessions. See device endpoints to create and list BGP + sessions for a particular device. Check out the product docs to learn more + about [Local and Global + BGP](https://deploy.equinix.com/developers/docs/metal/bgp/bgp-on-equinix-metal/#local-bgp-vs-global-bgp). + name: BGP + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/bgp/bgp-on-equinix-metal/ + - description: > + Capacity Management. Check out the product docs to learn more about + [Capacity](https://deploy.equinix.com/developers/docs/metal/locations/capacity/). + name: Capacity + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/locations/capacity/ + - description: > + Network Interconnections. See Instructions to create Network + Interconnections at Check out the product docs to learn more about [Equinix + Fabric](https://deploy.equinix.com/developers/docs/metal/interconnections/dedicated-ports-fabric/). + name: Interconnections + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/ + - description: > + Device Management. Check out the product docs to learn more about [Server + Devices](https://deploy.equinix.com/developers/docs/metal/hardware/). + name: Devices + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/on-demand/ + - description: Email Management + name: Emails + - description: Event Management + name: Events + - description: > + Facility Management. Check out the product docs to learn more about + [Facilities](https://deploy.equinix.com/developers/docs/metal/locations/metros/). + name: Facilities + - description: > + Firmware Sets Management. Notice: Firmware Sets are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: FirmwareSets + - description: > + Console Log Details. Notice: This is a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: ConsoleLogDetails + - description: > + Global BGP Range Management + name: GlobalBgpRanges + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/bgp/global-bgp/ + - description: > + Hardware Reservation Management. Check out the product docs to learn more + about [Reserved + Hardware](https://deploy.equinix.com/developers/docs/metal/deploy/reserved/). + name: HardwareReservations + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/reserved/ + - description: > + Incident Management + name: Incidents + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/locations/maintenance/ + - description: > + Manage invitations. See project endpoints to create a new invitation. Check + out the product docs to learn more about + [Invitations](https://deploy.equinix.com/developers/docs/metal/identity-access-management/users//). + name: Invitations + - description: > + Manage IP addresses. See device and project endpoints to list and create IP + assignments for a particular project or device. Check out the product docs + to learn more about [the basic networking + features](https://deploy.equinix.com/developers/docs/metal/networking/ip-addresses/). + name: IPAddresses + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/networking/server-level-networking/ + - description: > + Manage licenses. See project endpoints to list and create licenses for a + particular project. + name: Licenses + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/operating-systems/licensed/ + - description: > + Membership Management (Project). Check out the product docs to learn more + about [Membership](https://deploy.equinix.com/developers/docs/metal/projects/managing-a-project/). + name: Memberships + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/projects/managing-a-project/ + - description: > + Device Metadata + name: Metadata + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/server-metadata/metadata/ + - description: > + Metal Gateway Management.Check out the product docs to learn more about + [Metal + Gateways](https://deploy.equinix.com/developers/docs/metal/networking/vrf/). + name: MetalGateways + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/networking/vrf/ + - description: Metro Management. Check out the product docs to learn more about [Metros](https://deploy.equinix.com/developers/docs/metal/locations/metros/). + name: Metros + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/locations/metros/ + - description: > + Operating System Management. Check out the product docs to learn more about + [Operating Systems + choices](https://deploy.equinix.com/developers/docs/metal/operating-systems/licensed/). + name: OperatingSystems + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/operating-systems/supported/ + - description: + Organizations Management. Check out the product docs to learn more + about [Organizations](https://deploy.equinix.com/developers/docs/metal/identity-access-management/organizations/). + name: Organizations + - description: > + OTP Management. Check out the product docs to learn more about [OTP](https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/#multi-factor-authentication). + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/#multi-factor-authentication + name: OTPs + - description: > + Password Reset Token Management + name: PasswordResetTokens + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/#changing-your-password + - description: > + Payment Method Management + name: PaymentMethods + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/billing/payment-methods/ + - description: > + Plan Management (Device). Check out the product docs to learn more + about [Device Plans](https://deploy.equinix.com/developers/docs/metal/hardware/). + name: Plans + - description: > + Port Management. Check out the product docs to learn more about [Port + configurations](https://deploy.equinix.com/developers/docs/metal/layer2-networking/overview/). + name: Ports + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/layer2-networking/overview/ + - description: > + Project Management. Check out the product docs to learn more about + [Projects](https://deploy.equinix.com/developers/docs/metal/projects/). + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/projects/ + name: Projects + - description: > + Self Service Reservations + name: SelfServiceReservations + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/reserved/ + - description: > + Spot Market Pricing and Requests Management. Check out the product docs to learn more + about [Spot Market + features](https://deploy.equinix.com/developers/docs/metal/deploy/spot-market/). + name: SpotMarket + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/spot-market/ + - description: > + Manage SSH keys. See project endpoints to list and create project-level SSH + keys. + name: SSHKeys + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/ssh-keys/ + - description: > + Support request + name: SupportRequest + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/support-center/ + - description: > + Project Transfer Requests Management + name: TransferRequests + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/projects/#transferring-a-project + - description: > + Two Factor Authentication Management. Check out the product docs to learn + more about + [2FA](https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/#multi-factor-authentication). + name: TwoFactorAuth + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/#multi-factor-authentication + - description: Usage Management + name: Usages + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/billing/checking-usage/ + - description: > + Userdata Management + name: Userdata + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/server-metadata/user-data/ + - description: > + User Management + name: Users + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/ + - description: > + User Verification Token Management + name: UserVerificationTokens + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/organizations/#adding-team-members-to-an-organization + - description: > + Manage virtual networks (VLANs). See project endpoints to list and create + virtual networks. Check out the product docs to learn more about + [VLANs](https://deploy.equinix.com/developers/docs/metal/layer2-networking/vlans/). + name: VLANs + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/layer2-networking/vlans/ + - description: > + Volume Management (Block Storage). Notice: Block storage support will + be deprecated soon. Please check here: https://deploy.equinix.com/developers/docs/metal/storage/storage-appliances/ + for more details. + name: Volumes + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/storage/storage-appliances/ + - description: > + VRF Management. A VRF is a project-scoped virtual router resource that defines a collection of customer-managed IP blocks that can be used in BGP peering on one or more virtual networks. Metal Gateways and Interconnection Virtual Circuits can take advantage of VRFs to enable Layer 3 routing with custom network ranges. + name: VRFs +x-tagGroups: + - name: Accounts and Organization + tags: + - Authentication + - Emails + - Invitations + - Memberships + - Organizations + - OTPs + - PasswordResetTokens + - PaymentMethods + - Projects + - SSHKeys + - SupportRequest + - TransferRequests + - TwoFactorAuth + - Users + - UserVerificationTokens + - name: Services and Billing + tags: + - Events + - Facilities + - Incidents + - Invoices + - Licenses + - Metros + - Plans + - Usages + - name: Servers + tags: + - Devices + - Batches + - Capacity + - ConsoleLogDetails + - FirmwareSets + - HardwareReservations + - OperatingSystems + - Ports + - SelfServiceReservations + - SpotMarket + - Userdata + - Volumes + - name: Networking + tags: + - BGP + - Interconnections + - IPAddresses + - MetalGateways + - VLANs + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/api-keys/id.yaml b/spec/services/metalv1/oas3.fetched/paths/api-keys/id.yaml new file mode 100644 index 00000000..10caea95 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/api-keys/id.yaml @@ -0,0 +1,29 @@ +delete: + description: Deletes the API key. + operationId: deleteAPIKey + parameters: + - description: API Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the API key + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.fetched/paths/batches/id.yaml b/spec/services/metalv1/oas3.fetched/paths/batches/id.yaml new file mode 100644 index 00000000..6a97f0b2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/batches/id.yaml @@ -0,0 +1,69 @@ +delete: + description: Deletes the Batch. + operationId: deleteBatch + parameters: + - description: Batch UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Delete all instances created from this batch + in: query + name: remove_associated_instances + schema: + default: false + type: boolean + responses: + "204": + description: no content + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the Batch + tags: + - Batches +get: + description: Returns a Batch + operationId: findBatchById + parameters: + - description: Batch UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Batch.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a Batch + tags: + - Batches diff --git a/spec/services/metalv1/oas3.fetched/paths/bgp-dynamic-neighbors/id.yaml b/spec/services/metalv1/oas3.fetched/paths/bgp-dynamic-neighbors/id.yaml new file mode 100644 index 00000000..fcef32cd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/bgp-dynamic-neighbors/id.yaml @@ -0,0 +1,77 @@ +delete: + summary: Delete a VRF BGP Dynamic Neighbor + description: Trigger the removal of a BGP Neighbor range from a VRF + operationId: deleteBgpDynamicNeighborById + parameters: + - description: BGP Dynamic Neighbor UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/BgpDynamicNeighbor.yaml' + description: Accepted + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs + +get: + summary: Retrieve a BGP Dynamic Neighbor + description: Return a single BGP Dynamic Neighbor resource + operation: findBgpDynamicNeighborById + parameters: + - description: BGP Dynamic Neighbor UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/BgpDynamicNeighbor.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/bgp/sessions/id.yaml b/spec/services/metalv1/oas3.fetched/paths/bgp/sessions/id.yaml new file mode 100644 index 00000000..d34f2ae8 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/bgp/sessions/id.yaml @@ -0,0 +1,124 @@ +delete: + description: Deletes the BGP session. + operationId: deleteBgpSession + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Delete the BGP session + tags: + - BGP +get: + description: Returns a BGP session + operationId: findBgpSessionById + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpSession.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a BGP session + tags: + - BGP +put: + description: Updates the BGP session by either enabling or disabling the default + route functionality. + operationId: updateBgpSession + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + type: boolean + description: Default route + required: true + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the BGP session + tags: + - BGP diff --git a/spec/services/metalv1/oas3.fetched/paths/capacity.yaml b/spec/services/metalv1/oas3.fetched/paths/capacity.yaml new file mode 100644 index 00000000..904cdd4c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/capacity.yaml @@ -0,0 +1,69 @@ +get: + description: Returns a list of facilities and plans with their current capacity. + operationId: findCapacityForFacility + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/CapacityList.yaml' + example: + capacity: + am6: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da11: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + sv15: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: View capacity + tags: + - Capacity +post: + deprecated: true + description: Validates if a deploy can be fulfilled. + operationId: checkCapacityForFacility + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/CapacityInput.yaml' + description: Facility to check capacity in + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/CapacityCheckPerFacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Check capacity + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.fetched/paths/capacity/metros.yaml b/spec/services/metalv1/oas3.fetched/paths/capacity/metros.yaml new file mode 100644 index 00000000..e763c255 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/capacity/metros.yaml @@ -0,0 +1,74 @@ +get: + description: Returns a list of metros and plans with their current capacity. + operationId: findCapacityForMetro + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/CapacityList.yaml' + example: + capacity: + am: + "c2.medium.x86": + level: "string" + available_servers: 25 + "m2.xlarge.x86": + level: "string" + available_servers: 15 + da: + "c2.medium.x86": + level: "string" + available_servers: 26 + "m2.xlarge.x86": + level: "string" + available_servers: 11 + dc: + "c2.medium.x86": + level: "string" + available_servers: 14 + "m2.xlarge.x86": + level: "string" + available_servers: 10 + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + summary: View capacity for metros + tags: + - Capacity +post: + description: Validates if a deploy can be fulfilled in a metro. + operationId: checkCapacityForMetro + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/CapacityInput.yaml' + description: Metro to check capacity in + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/CapacityCheckPerMetroList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Check capacity for a metro + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id.yaml new file mode 100644 index 00000000..1fdf9236 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id.yaml @@ -0,0 +1,112 @@ +delete: + description: Delete a interconnection, its associated ports and virtual circuits. + operationId: deleteInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/Interconnection.yaml' + description: accepted + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete interconnection + tags: + - Interconnections +get: + description: Get the details of a interconnection + operationId: getInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Interconnection.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Get interconnection + tags: + - Interconnections +put: + description: Update the details of a interconnection + operationId: updateInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/InterconnectionUpdateInput.yaml' + description: Updated interconnection details + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Interconnection.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Update interconnection + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/events.yaml new file mode 100644 index 00000000..8d2121bc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of the interconnection events + operationId: findInterconnectionEvents + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve interconnection events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports.yaml new file mode 100644 index 00000000..11b270ec --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports.yaml @@ -0,0 +1,33 @@ +get: + description: List the ports associated to an interconnection. + operationId: listInterconnectionPorts + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InterconnectionPortList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List a interconnection's ports + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id.yaml new file mode 100644 index 00000000..540efd28 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id.yaml @@ -0,0 +1,42 @@ +get: + description: Get the details of an interconnection port. + operationId: getInterconnectionPort + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + - $ref: '../../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/InterconnectionPort.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Get a interconnection port + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id/events.yaml new file mode 100644 index 00000000..8cafd50a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id/events.yaml @@ -0,0 +1,50 @@ +get: + description: Returns a list of the interconnection port events + operationId: findInterconnectionPortEvents + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: Interconnection Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../../components/parameters/Include.yaml' + - $ref: '../../../../../components/parameters/Exclude.yaml' + - $ref: '../../../../../components/parameters/Page.yaml' + - $ref: '../../../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve interconnection port events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/port_id/virtual-circuits.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/port_id/virtual-circuits.yaml new file mode 100644 index 00000000..7d87e987 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/port_id/virtual-circuits.yaml @@ -0,0 +1,92 @@ +get: + description: List the virtual circuit record(s) associatiated with a particular + interconnection port. + operationId: listInterconnectionPortVirtualCircuits + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: UUID of the interconnection port + in: path + name: port_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../../components/parameters/Include.yaml' + - $ref: '../../../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/VirtualCircuitList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: List a interconnection port's virtual circuits + tags: + - Interconnections +post: + description: Create a new Virtual Circuit on a Dedicated Port. To create a regular Virtual Circuit, specify + a Virtual Network record and an NNI VLAN value. To create a VRF-based Virtual Circuit, specify the VRF ID and subnet, + along with the NNI VLAN value. + operationId: createInterconnectionPortVirtualCircuit + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: UUID of the interconnection port + in: path + name: port_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../../../components/schemas/VirtualCircuitCreateInput.yaml' + description: Virtual Circuit details + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/VirtualCircuit.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Create a new Virtual Circuit + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/virtual-circuits.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/virtual-circuits.yaml new file mode 100644 index 00000000..ac0c891c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/virtual-circuits.yaml @@ -0,0 +1,33 @@ +get: + description: List the virtual circuit record(s) associated with a particular interconnection id. + operationId: listInterconnectionVirtualCircuits + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualCircuitList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List a interconnection's virtual circuits + tags: + - Interconnections \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/metros.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/metros.yaml new file mode 100644 index 00000000..06bc27ab --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/metros.yaml @@ -0,0 +1,25 @@ +get: + description: Displays which providers you can connect to directly from Equinix Metal Metros. + summary: Get connectivity to network provider by metro + operationId: getInterconnectionMetros + tags: + - Interconnections + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/InterconnectionMetroList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/prices.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/prices.yaml new file mode 100644 index 00000000..0857dac5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/prices.yaml @@ -0,0 +1,25 @@ +get: + summary: Get Interconnection Pricing + description: "Displays pricing information for connecting to networks outside of Equinix." + operationId: getInterconnectionPricing + tags: + - Interconnections + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/InterconnectionPricingList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id.yaml new file mode 100644 index 00000000..1eb2ed9e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id.yaml @@ -0,0 +1,144 @@ +delete: + description: Deletes a device and deprovisions it in our datacenter. + operationId: deleteDevice + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Force the deletion of the device, by detaching any storage volume + still active. + in: query + name: force_delete + schema: + type: boolean + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Delete the device + tags: + - Devices +get: + description: |- + Type-specific options (such as facility for baremetal devices) will be included as part of the main data structure. + State value can be one of: active inactive queued or provisioning + operationId: findDeviceById + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Device.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a device + tags: + - Devices +put: + description: Updates the device. + operationId: updateDevice + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/DeviceUpdateInput.yaml' + description: Device to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Device.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the device + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/actions.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/actions.yaml new file mode 100644 index 00000000..ba60b9b4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/actions.yaml @@ -0,0 +1,44 @@ +post: + description: 'Performs an action for the given device. Possible actions include: + power_on, power_off, reboot, reinstall, and rescue (reboot the device into rescue + OS.)' + operationId: performAction + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceActionInput.yaml' + description: Action to perform + required: true + responses: + "202": + description: accepted + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Perform an action + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/bandwidth.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/bandwidth.yaml new file mode 100644 index 00000000..91524c96 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/bandwidth.yaml @@ -0,0 +1,41 @@ +get: + description: Retrieve an instance bandwidth for a given period of time. + operationId: findInstanceBandwidth + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Timestamp from range + in: query + name: from + required: true + schema: + type: string + - description: Timestamp to range + in: query + name: until + required: true + schema: + type: string + responses: + "200": + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an instance bandwidth + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/neighbors.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/neighbors.yaml new file mode 100644 index 00000000..e2711c96 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/neighbors.yaml @@ -0,0 +1,41 @@ +get: + description: Provides a summary of the BGP neighbor data associated to the BGP sessions + for this device. + operationId: getBgpNeighborData + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSessionNeighbors.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve BGP neighbor data for this device + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/sessions.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/sessions.yaml new file mode 100644 index 00000000..131fcef5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/sessions.yaml @@ -0,0 +1,81 @@ +get: + description: Provides a listing of available BGP sessions for the device. + operationId: findBgpSessions + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSessionList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + summary: Retrieve all BGP sessions + tags: + - Devices +post: + description: Creates a BGP session. + operationId: createBgpSession + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/BGPSessionInput.yaml' + description: BGP session to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSession.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a BGP session + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/customdata.yaml new file mode 100644 index 00000000..1b3c0266 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this instance in json format + operationId: findDeviceCustomdata + parameters: + - description: Instance UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an instance + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/health/rollup.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/health/rollup.yaml new file mode 100644 index 00000000..4d66456f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/health/rollup.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Devices + summary: Get Device's Health Status + description: Returns the health rollup status of the device. + operationId: getDeviceHealthRollup + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../../../components/schemas/DeviceHealthRollup.yaml' + "401": + $ref: '../../../../../components/schemas/Error.yaml' + "404": + $ref: '../../../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/screenshot.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/screenshot.yaml new file mode 100644 index 00000000..86f524eb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/screenshot.yaml @@ -0,0 +1,39 @@ +get: + description: Capture a screenshot from the device, if supported, via the BMC. + operationId: captureScreenshot + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + tags: + - ConsoleLogDetails + responses: + "200": + description: An image file + content: + application/jpeg: + schema: + type: string + format: binary + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "501": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not implemented for device diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/events.yaml new file mode 100644 index 00000000..62a179c5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of events pertaining to a specific device + operationId: findDeviceEvents + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve device's events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/firmware-sets.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/firmware-sets.yaml new file mode 100644 index 00000000..b3eca50a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/firmware-sets.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Devices + summary: Get Device's associated Firmware Set + description: Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + operationId: getDeviceFirmwareSets + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/ips.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/ips.yaml new file mode 100644 index 00000000..af8637c0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/ips.yaml @@ -0,0 +1,83 @@ +get: + description: Returns all ip assignments for a device. + operationId: findIPAssignments + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAssignmentList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all ip assignments + tags: + - Devices +post: + description: Creates an ip assignment for a device. + operationId: createIPAssignment + parameters: + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAssignmentInput.yaml' + description: IPAssignment to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAssignment.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an ip assignment + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/metadata.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/metadata.yaml new file mode 100644 index 00000000..d3fce7cc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/metadata.yaml @@ -0,0 +1,39 @@ +get: + description: Retrieve device metadata + operationId: findDeviceMetadataByID + parameters: + - description: Device UUID + in: path + name: id + schema: + type: string + format: uuid + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Metadata.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Retrieve metadata + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/ssh-keys.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/ssh-keys.yaml new file mode 100644 index 00000000..73fb19d6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/ssh-keys.yaml @@ -0,0 +1,33 @@ +get: + description: Returns a collection of the device's ssh keys. + operationId: findDeviceSSHKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by key, label, or fingerprint + in: query + name: Search string + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKeyList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve a device's ssh keys + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/traffic.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/traffic.yaml new file mode 100644 index 00000000..8ac408d1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/traffic.yaml @@ -0,0 +1,87 @@ +get: + description: | + Returns the total amount of inbound or outbound traffic for a specific device. The default time period is 1 hour. + + Please note the results capture all network traffic for the server, but not all traffic may come from or be destined to the Internet and may be non-billable. Only Internet bound traffic is charged. + operationId: findTraffic + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Traffic direction + in: query + name: direction + required: true + schema: + enum: + - inbound + - outbound + type: string + - description: Traffic interval + in: query + name: interval + schema: + enum: + - minute + - hour + - day + - week + - month + - year + - hour_of_day + - day_of_week + - day_of_month + - month_of_year + type: string + - description: Traffic bucket + in: query + name: bucket + schema: + enum: + - internal + - external + type: string + - name: timeframe + in: query + schema: + properties: + ended_at: + format: date-time + type: string + started_at: + format: date-time + type: string + required: + - started_at + - ended_at + type: object + style: deepObject + explode: true + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve device traffic + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/usages.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/usages.yaml new file mode 100644 index 00000000..6ad450c9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/usages.yaml @@ -0,0 +1,45 @@ +get: + description: Returns all usages for a device. + operationId: findDeviceUsages + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter usages created after this date + in: query + name: created[after] + schema: + format: datetime + type: string + - description: Filter usages created before this date + in: query + name: created[before] + schema: + format: datetime + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceUsageList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all usages for device + tags: + - Usages diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/userdata.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/userdata.yaml new file mode 100644 index 00000000..63aedafe --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/userdata.yaml @@ -0,0 +1,39 @@ +get: + description: Retrieve device userdata + operationId: findDeviceUserdataByID + parameters: + - description: Device UUID + in: path + name: id + schema: + type: string + format: uuid + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Userdata.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Retrieve userdata + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/instance_id/ips/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/instance_id/ips/id/customdata.yaml new file mode 100644 index 00000000..080b675a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/instance_id/ips/id/customdata.yaml @@ -0,0 +1,43 @@ +get: + description: Provides the custom metadata stored for this IP Assignment in json + format + operationId: findIPAssignmentCustomdata + parameters: + - description: Instance UUID + in: path + name: instance_id + required: true + schema: + format: uuid + type: string + - description: Ip Assignment UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an IP Assignment + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/emails.yaml b/spec/services/metalv1/oas3.fetched/paths/emails.yaml new file mode 100644 index 00000000..b385aab6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/emails.yaml @@ -0,0 +1,33 @@ +post: + deprecated: true + description: Add a new email address to the current user. + operationId: createEmail + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/CreateEmailInput.yaml' + description: Email to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/Email.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an email + tags: + - Emails diff --git a/spec/services/metalv1/oas3.fetched/paths/emails/id.yaml b/spec/services/metalv1/oas3.fetched/paths/emails/id.yaml new file mode 100644 index 00000000..6c42e43b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/emails/id.yaml @@ -0,0 +1,126 @@ +delete: + description: Deletes the email. + operationId: deleteEmail + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the email + tags: + - Emails +get: + description: Provides one of the user’s emails. + operationId: findEmailById + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Email.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an email + tags: + - Emails +put: + description: Updates the email. + operationId: updateEmail + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/UpdateEmailInput.yaml' + description: email to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Email.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the email + tags: + - Emails diff --git a/spec/services/metalv1/oas3.fetched/paths/events.yaml b/spec/services/metalv1/oas3.fetched/paths/events.yaml new file mode 100644 index 00000000..6e5042d7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/events.yaml @@ -0,0 +1,24 @@ +get: + description: Returns a list of the current user’s events + operationId: findEvents + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve current user's events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/events/id.yaml b/spec/services/metalv1/oas3.fetched/paths/events/id.yaml new file mode 100644 index 00000000..f89b640e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/events/id.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a single event if the user has access + operationId: findEventById + parameters: + - description: Event UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an event + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/facilities.yaml b/spec/services/metalv1/oas3.fetched/paths/facilities.yaml new file mode 100644 index 00000000..871a4d40 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/facilities.yaml @@ -0,0 +1,50 @@ +get: + deprecated: true + description: Provides a listing of available datacenters where you can provision + Packet devices. + operationId: findFacilities + parameters: + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + enum: + - address + - labels + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only the + href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. + in: query + name: exclude + schema: + default: + - address + items: + enum: + - address + - labels + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/FacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all facilities + tags: + - Facilities diff --git a/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id.yaml b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id.yaml new file mode 100644 index 00000000..f060e73d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a single hardware reservation + operationId: findHardwareReservationById + parameters: + - description: HardwareReservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/HardwareReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a hardware reservation + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/activate.yaml b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/activate.yaml new file mode 100644 index 00000000..2a828934 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/activate.yaml @@ -0,0 +1,50 @@ +post: + description: Activate a spare hardware reservation + operationId: activateHardwareReservation + parameters: + - description: Hardware Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + properties: + description: + type: string + description: Note to attach to the reservation + required: false + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/HardwareReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Activate a spare hardware reservation + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/move.yaml b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/move.yaml new file mode 100644 index 00000000..53b7e969 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/move.yaml @@ -0,0 +1,51 @@ +post: + description: Move a hardware reservation to another project + operationId: moveHardwareReservation + parameters: + - description: Hardware Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + properties: + project_id: + format: uuid + type: string + description: Destination Project UUID + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/HardwareReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Move a hardware reservation + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/incidents.yaml b/spec/services/metalv1/oas3.fetched/paths/incidents.yaml new file mode 100644 index 00000000..f71ba426 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/incidents.yaml @@ -0,0 +1,18 @@ +get: + description: Retrieve the number of incidents. + operationId: findIncidents + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve the number of incidents + tags: + - Incidents diff --git a/spec/services/metalv1/oas3.fetched/paths/invitations.yaml b/spec/services/metalv1/oas3.fetched/paths/invitations.yaml new file mode 100644 index 00000000..31edf02d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/invitations.yaml @@ -0,0 +1,35 @@ +get: + description: Returns all invitations in current user. + operationId: findInvitations + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/InvitationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: not found + summary: Retrieve current user invitations + tags: + - Users diff --git a/spec/services/metalv1/oas3.fetched/paths/invitations/id.yaml b/spec/services/metalv1/oas3.fetched/paths/invitations/id.yaml new file mode 100644 index 00000000..675fb307 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/invitations/id.yaml @@ -0,0 +1,116 @@ +delete: + description: Decline an invitation. + operationId: declineInvitation + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Decline an invitation + tags: + - Invitations +get: + description: Returns a single invitation. (It include the `invitable` to maintain + backward compatibility but will be removed soon) + operationId: findInvitationById + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Invitation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: View an invitation + tags: + - Invitations +put: + description: Accept an invitation. + operationId: acceptInvitation + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Membership.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Accept an invitation + tags: + - Invitations diff --git a/spec/services/metalv1/oas3.fetched/paths/invoices/id.yaml b/spec/services/metalv1/oas3.fetched/paths/invoices/id.yaml new file mode 100644 index 00000000..78152311 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/invoices/id.yaml @@ -0,0 +1,33 @@ +get: + description: Returns the invoice identified by the provided id + operationId: getInvoiceById + parameters: + - description: Invoice UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Invoice.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an invoice + tags: + - Invoices diff --git a/spec/services/metalv1/oas3.fetched/paths/ips/id.yaml b/spec/services/metalv1/oas3.fetched/paths/ips/id.yaml new file mode 100644 index 00000000..db4cc052 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ips/id.yaml @@ -0,0 +1,137 @@ +delete: + description: | + This call can be used to un-assign an IP assignment or delete + an IP reservation. + + Un-assign an IP address record. + Use the assignment UUID you + get after attaching the IP. This will remove the relationship between an IP and the device or metal gateway and will make the IP address available to be assigned to another device, once the IP has been un-configured from the network. + + Delete an IP reservation. + Use the reservation UUID you get after adding the IP to the project. This will permanently delete the IP block reservation from the project. + operationId: deleteIPAddress + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Unassign an ip address + tags: + - IPAddresses +get: + description: Returns a single ip address if the user has access. + operationId: findIPAddressById + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/IPAssignment.yaml' + - $ref: '../../components/schemas/IPReservation.yaml' + - $ref: '../../components/schemas/VrfIpReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an ip address + tags: + - IPAddresses +patch: + description: Update details about an ip address + operationId: updateIPAddress + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/IPAssignmentUpdateInput.yaml' + responses: + "200": + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/IPAssignment.yaml' + - $ref: '../../components/schemas/IPReservation.yaml' + - $ref: '../../components/schemas/VrfIpReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Update an ip address + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.fetched/paths/ips/id/available.yaml b/spec/services/metalv1/oas3.fetched/paths/ips/id/available.yaml new file mode 100644 index 00000000..dcf4a6f0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ips/id/available.yaml @@ -0,0 +1,155 @@ +get: + description: Provides a list of IP resevations for a single project. + operationId: findIPAvailabilities + parameters: + - description: IP Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Size of subnets in bits + in: query + name: cidr + required: true + schema: + enum: + - "20" + - "21" + - "22" + - "23" + - "24" + - "25" + - "26" + - "27" + - "28" + - "29" + - "30" + - "31" + - "32" + - "33" + - "34" + - "35" + - "36" + - "37" + - "38" + - "39" + - "40" + - "41" + - "42" + - "43" + - "44" + - "45" + - "46" + - "47" + - "48" + - "49" + - "50" + - "51" + - "52" + - "53" + - "54" + - "55" + - "56" + - "57" + - "58" + - "59" + - "60" + - "61" + - "62" + - "63" + - "64" + - "65" + - "66" + - "67" + - "68" + - "69" + - "70" + - "71" + - "72" + - "73" + - "74" + - "75" + - "76" + - "77" + - "78" + - "79" + - "80" + - "81" + - "82" + - "83" + - "84" + - "85" + - "86" + - "87" + - "88" + - "89" + - "90" + - "91" + - "92" + - "93" + - "94" + - "95" + - "96" + - "97" + - "98" + - "99" + - "100" + - "101" + - "102" + - "103" + - "104" + - "105" + - "106" + - "107" + - "108" + - "109" + - "110" + - "111" + - "112" + - "113" + - "114" + - "115" + - "116" + - "117" + - "118" + - "119" + - "120" + - "121" + - "122" + - "123" + - "124" + - "125" + - "126" + - "127" + - "128" + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAvailabilitiesList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all available subnets of a particular reservation + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.fetched/paths/ips/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/ips/id/customdata.yaml new file mode 100644 index 00000000..f44ebd3a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ips/id/customdata.yaml @@ -0,0 +1,36 @@ +get: + description: Provides the custom metadata stored for this IP Reservation or IP Assignment + in json format + operationId: findIPAddressCustomdata + parameters: + - description: Ip Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an IP Reservation or IP Assignment + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.fetched/paths/licenses/id.yaml b/spec/services/metalv1/oas3.fetched/paths/licenses/id.yaml new file mode 100644 index 00000000..5ac742c9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/licenses/id.yaml @@ -0,0 +1,130 @@ +delete: + description: Deletes a license. + operationId: deleteLicense + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the license + tags: + - Licenses +get: + description: Returns a license + operationId: findLicenseById + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/License.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a license + tags: + - Licenses +put: + description: Updates the license. + operationId: updateLicense + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/LicenseUpdateInput.yaml' + description: License to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/License.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the license + tags: + - Licenses diff --git a/spec/services/metalv1/oas3.fetched/paths/locations/metros.yaml b/spec/services/metalv1/oas3.fetched/paths/locations/metros.yaml new file mode 100644 index 00000000..1e86e985 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/locations/metros.yaml @@ -0,0 +1,19 @@ +get: + description: Provides a listing of available metros + operationId: findMetros + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/MetroList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all metros + tags: + - Metros diff --git a/spec/services/metalv1/oas3.fetched/paths/locations/metros/id.yaml b/spec/services/metalv1/oas3.fetched/paths/locations/metros/id.yaml new file mode 100644 index 00000000..217cc637 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/locations/metros/id.yaml @@ -0,0 +1,27 @@ +get: + description: Show the details for a metro, including name, code, and country. + operationId: getMetro + parameters: + - description: Metro UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Metro.yaml' + description: ok + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a specific Metro's details + tags: + - Metros diff --git a/spec/services/metalv1/oas3.fetched/paths/market/spot/prices.yaml b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices.yaml new file mode 100644 index 00000000..94a2674c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices.yaml @@ -0,0 +1,36 @@ +get: + description: Get Equinix Metal current spot market prices. + operationId: findSpotMarketPrices + parameters: + - description: Facility to check spot market prices + in: query + name: facility + schema: + type: string + - description: Plan to check spot market prices + in: query + name: plan + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketPricesList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get current spot market prices + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/history.yaml b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/history.yaml new file mode 100644 index 00000000..a0702301 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/history.yaml @@ -0,0 +1,58 @@ +get: + description: |- + Get spot market prices for a given plan and facility in a fixed period of time + + *Note: In the `200` response, the property `datapoints` contains arrays of `[float, integer]`.* + operationId: findSpotMarketPricesHistory + parameters: + - description: Facility to check spot market prices + in: query + name: facility + required: true + schema: + type: string + - description: Plan to check spot market prices + in: query + name: plan + required: true + schema: + type: string + - description: Metro to check spot market price history + in: query + name: metro + schema: + type: string + - description: Timestamp from range + in: query + name: from + required: true + schema: + type: string + - description: Timestamp to range + in: query + name: until + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SpotPricesHistoryReport.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get spot market prices for a given period of time + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/metros.yaml b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/metros.yaml new file mode 100644 index 00000000..969f108e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/metros.yaml @@ -0,0 +1,36 @@ +get: + description: Get Equinix Metal current spot market prices for all metros. + operationId: findMetroSpotMarketPrices + parameters: + - description: Metro to filter spot market prices + in: query + name: metro + schema: + type: string + - description: Plan to filter spot market prices + in: query + name: plan + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SpotMarketPricesPerMetroList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get current spot market prices for metros + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.fetched/paths/memberships/id.yaml b/spec/services/metalv1/oas3.fetched/paths/memberships/id.yaml new file mode 100644 index 00000000..535bc738 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/memberships/id.yaml @@ -0,0 +1,128 @@ +delete: + description: Deletes the membership. + operationId: deleteMembership + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the membership + tags: + - Memberships +get: + description: Returns a single membership. + operationId: findMembershipById + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Membership.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a membership + tags: + - Memberships +put: + description: Updates the membership. + operationId: updateMembership + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/MembershipInput.yaml' + description: Membership to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Membership.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the membership + tags: + - Memberships diff --git a/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id.yaml b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id.yaml new file mode 100644 index 00000000..87fd86aa --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id.yaml @@ -0,0 +1,74 @@ +delete: + description: Deletes a metal gateway and any elastic IP assignments associated with this metal gateway. + operationId: deleteMetalGateway + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + description: accepted + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/MetalGateway.yaml' + - $ref: '../../components/schemas/VrfMetalGateway.yaml' + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Deletes the metal gateway + tags: + - MetalGateways +get: + description: Returns a specific metal gateway + operationId: findMetalGatewayById + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/MetalGateway.yaml' + - $ref: '../../components/schemas/VrfMetalGateway.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Returns the metal gateway + tags: + - MetalGateways diff --git a/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/bgp-dynamic-neighbors.yaml b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/bgp-dynamic-neighbors.yaml new file mode 100644 index 00000000..387fcf8a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/bgp-dynamic-neighbors.yaml @@ -0,0 +1,92 @@ +post: + summary: Create a VRF BGP Dynamic Neighbor range + description: | + Create a VRF BGP Dynamic Neighbor range. + + BGP Dynamic Neighbor records are limited to 2 per Virtual Network. + operationId: createBgpDynamicNeighbor + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: "../../../components/schemas/BgpDynamicNeighborCreateInput.yaml" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpDynamicNeighbor.yaml' + description: Created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unprocessable entity + tags: + - MetalGateways + +get: + description: Returns the list of VRF BGP Dynamic Neighbors for this Metal Gateway + operationId: getBgpDynamicNeighbors + summary: List BGP Dynamic Neighbors + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpDynamicNeighborList.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + tags: + - MetalGateways diff --git a/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/ips.yaml b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/ips.yaml new file mode 100644 index 00000000..78787aea --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/ips.yaml @@ -0,0 +1,94 @@ +post: + summary: Create a Metal Gateway Elastic IP + description: | + Create a new Elastic IP on this Metal Gateway. + + Assign an IPv4 range as an elastic IP to the Metal Gateway, with a specified next-hop address contained within the Metal Gateway. + + Notice: Elastic IPs on Metal Gateways are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + operationId: createMetalGatewayElasticIp + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: "../../../components/schemas/MetalGatewayElasticIpCreateInput.yaml" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "../../../components/schemas/IPAssignment.yaml" + description: Created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unprocessable entity + tags: + - MetalGateways + +get: + summary: List Metal Gateway Elastic IPs + description: Returns the list of Elastic IPs assigned to this Metal Gateway + operationId: getMetalGatewayElasticIps + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: "../../../components/schemas/IPAssignmentList.yaml" + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + tags: + - MetalGateways diff --git a/spec/services/metalv1/oas3.fetched/paths/operating-system-versions.yaml b/spec/services/metalv1/oas3.fetched/paths/operating-system-versions.yaml new file mode 100644 index 00000000..538b224f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/operating-system-versions.yaml @@ -0,0 +1,19 @@ +get: + description: Provides a listing of available operating system versions. + operationId: findOperatingSystemVersion + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/OperatingSystemList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all operating system versions + tags: + - OperatingSystems diff --git a/spec/services/metalv1/oas3.fetched/paths/operating-systems.yaml b/spec/services/metalv1/oas3.fetched/paths/operating-systems.yaml new file mode 100644 index 00000000..3afe2ed9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/operating-systems.yaml @@ -0,0 +1,20 @@ +get: + description: Provides a listing of available operating systems to provision your + new device with. + operationId: findOperatingSystems + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/OperatingSystemList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all operating systems + tags: + - OperatingSystems diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations.yaml new file mode 100644 index 00000000..0a21aaf9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations.yaml @@ -0,0 +1,84 @@ +get: + description: Returns a list of organizations that are accessible to the current + user. + operationId: findOrganizations + parameters: + - description: Include, exclude or show only personal organizations. + in: query + name: personal + schema: + enum: + - include + - exclude + - only + type: string + - description: Include, exclude or show only organizations that have no projects. + in: query + name: without_projects + schema: + enum: + - include + - exclude + - only + type: string + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/OrganizationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all organizations + tags: + - Organizations +post: + description: Creates an organization. + operationId: createOrganization + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/OrganizationInput.yaml' + description: Organization to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/Organization.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id.yaml new file mode 100644 index 00000000..98d59577 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id.yaml @@ -0,0 +1,125 @@ +delete: + description: Deletes the organization. + operationId: deleteOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the organization + tags: + - Organizations +get: + description: Returns a single organization's details, if the user is authorized + to view it. + operationId: findOrganizationById + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Organization.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an organization's details + tags: + - Organizations +put: + description: Updates the organization. + operationId: updateOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/OrganizationInput.yaml' + description: Organization to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Organization.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity.yaml new file mode 100644 index 00000000..87b47ea6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity.yaml @@ -0,0 +1,50 @@ +get: + description: Returns a list of facilities and plans with their current capacity. + operationId: findOrganizationCapacityPerFacility + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/CapacityList.yaml' + example: + capacity: + am6: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da11: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + sv15: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + summary: View available hardware plans per Facility for given organization + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity/metros.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity/metros.yaml new file mode 100644 index 00000000..76a114cb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity/metros.yaml @@ -0,0 +1,50 @@ +get: + description: Returns a list of metros and plans with their current capacity. + operationId: findOrganizationCapacityPerMetro + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/CapacityList.yaml' + example: + capacity: + am: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + dc: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + summary: View available hardware plans per Metro for given organization + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/customdata.yaml new file mode 100644 index 00000000..e0a0c2b0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this organization in json format + operationId: findOrganizationCustomdata + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/devices.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/devices.yaml new file mode 100644 index 00000000..b90f70ef --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/devices.yaml @@ -0,0 +1,93 @@ +get: + description: Provides a collection of devices for a given organization. + operationId: findOrganizationDevices + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/DeviceSearch.yaml' + - description: Filter by plan category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + - description: Filter by device facility + in: query + name: facility + schema: + type: string + - description: Filter by partial hostname + in: query + name: hostname + schema: + type: string + - description: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + in: query + name: reserved + schema: + type: boolean + - description: Filter by device tag + in: query + name: tag + schema: + type: string + - description: Filter by instance type (ondemand,spot,reserved) + in: query + name: type + schema: + type: string + - description: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + in: query + name: has_termination_time + schema: + type: boolean + - description: Filter by MAC address + in: query + name: mac_address + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all devices of an organization + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/events.yaml new file mode 100644 index 00000000..cd713da2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of events for a single organization + operationId: findOrganizationEvents + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve organization's events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/facilities.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/facilities.yaml new file mode 100644 index 00000000..cf47c1a4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/facilities.yaml @@ -0,0 +1,42 @@ +get: + deprecated: true + description: Returns a listing of available datacenters for the given organization + operationId: findFacilitiesByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/FacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all facilities visible by the organization + tags: + - Facilities diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/firmware-sets.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/firmware-sets.yaml new file mode 100644 index 00000000..264dcc28 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/firmware-sets.yaml @@ -0,0 +1,41 @@ +get: + tags: + - FirmwareSets + summary: Get Organization's Firmware Sets + description: Returns all firmware sets associated with the organization. + operationId: getOrganizationFirmwareSets + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - name: page + in: query + description: page number to return + schema: + type: integer + - name: per_page + in: query + description: items returned per page. + schema: + type: integer + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetListResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/invitations.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/invitations.yaml new file mode 100644 index 00000000..3897f3bd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/invitations.yaml @@ -0,0 +1,92 @@ +get: + description: Returns all invitations in an organization. + operationId: findOrganizationInvitations + parameters: + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InvitationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve organization invitations + tags: + - Organizations +post: + description: |- + In order to add a user to an organization, they must first be invited. + To invite to several projects the parameter `projects_ids:[a,b,c]` can be used + operationId: createOrganizationInvitation + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/InvitationInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Invitation.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an invitation for an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/invoices.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/invoices.yaml new file mode 100644 index 00000000..17cd9630 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/invoices.yaml @@ -0,0 +1,48 @@ +get: + description: Returns all invoices for an organization + operationId: findOrganizationInvoices + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: page number + in: query + name: page + schema: + type: integer + - description: per page + in: query + name: per_page + schema: + type: integer + - description: filter by status + in: query + name: status + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InvoiceList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all invoices for an organization + tags: + - Invoices diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/operating-systems.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/operating-systems.yaml new file mode 100644 index 00000000..edba6f62 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/operating-systems.yaml @@ -0,0 +1,40 @@ +get: + description: Returns a listing of available operating systems for the given organization + operationId: findOperatingSystemsByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/OperatingSystemList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all operating systems visible by the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/payment-methods.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/payment-methods.yaml new file mode 100644 index 00000000..029d3c61 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/payment-methods.yaml @@ -0,0 +1,83 @@ +get: + description: Returns all payment methods of an organization. + operationId: findOrganizationPaymentMethods + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PaymentMethodList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all payment methods of an organization + tags: + - Organizations +post: + description: Creates a payment method. + operationId: createPaymentMethod + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/PaymentMethodCreateInput.yaml' + description: Payment Method to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/PaymentMethod.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a payment method for the given organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/plans.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/plans.yaml new file mode 100644 index 00000000..12557edf --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/plans.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a listing of available plans for the given organization + operationId: findPlansByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PlanList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all plans visible by the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/projects.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/projects.yaml new file mode 100644 index 00000000..004a17e2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/projects.yaml @@ -0,0 +1,74 @@ +get: + description: Returns a collection of projects that belong to the organization. + operationId: findOrganizationProjects + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/ProjectName.yaml' + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/ProjectList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all projects of an organization + tags: + - Organizations +post: + description: Creates a new project for the organization + operationId: createOrganizationProject + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/ProjectCreateInput.yaml' + description: Project to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Project.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a project for the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/transfers.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/transfers.yaml new file mode 100644 index 00000000..a24b6af1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/transfers.yaml @@ -0,0 +1,34 @@ +get: + description: Provides a collection of project transfer requests from or to the organization. + operationId: findOrganizationTransfers + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/TransferRequestList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + summary: Retrieve all project transfer requests from or to an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/organization_id/connections.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/organization_id/connections.yaml new file mode 100644 index 00000000..2f266f80 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/organization_id/connections.yaml @@ -0,0 +1,79 @@ +get: + description: List the connections belonging to the organization + operationId: organizationListInterconnections + parameters: + - description: UUID of the organization + in: path + name: organization_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InterconnectionList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List organization connections + tags: + - Interconnections +post: + description: Creates a new interconnection request. A Project ID must be specified in + the request body for connections on shared ports. + operationId: createOrganizationInterconnection + parameters: + - description: UUID of the organization + in: path + name: organization_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + $ref: '../../../components/requestBodies/InterconnectionCreateInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Interconnection.yaml' + description: created + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Request a new interconnection for the organization + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/payment-methods/id.yaml b/spec/services/metalv1/oas3.fetched/paths/payment-methods/id.yaml new file mode 100644 index 00000000..dfd41e8d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/payment-methods/id.yaml @@ -0,0 +1,110 @@ +delete: + description: Deletes the payment method. + operationId: deletePaymentMethod + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the payment method + tags: + - PaymentMethods +get: + description: Returns a payment method + operationId: findPaymentMethodById + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/PaymentMethod.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a payment method + tags: + - PaymentMethods +put: + description: Updates the payment method. + operationId: updatePaymentMethod + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/PaymentMethodUpdateInput.yaml' + description: Payment Method to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/PaymentMethod.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the payment method + tags: + - PaymentMethods diff --git a/spec/services/metalv1/oas3.fetched/paths/plans.yaml b/spec/services/metalv1/oas3.fetched/paths/plans.yaml new file mode 100644 index 00000000..1f04891e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/plans.yaml @@ -0,0 +1,52 @@ +get: + description: Provides a listing of available plans to provision your device on. + operationId: findPlans + parameters: + - description: Filter plans by its category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + - description: Filter plans by its plan type + in: query + name: type + schema: + type: string + enum: + - standard + - workload_optimized + - custom + example: standard + - description: Filter plans by slug + in: query + name: slug + schema: + type: string + example: c3.small.x86 + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/PlanList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all plans + tags: + - Plans diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id.yaml new file mode 100644 index 00000000..d1785435 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id.yaml @@ -0,0 +1,34 @@ +get: + description: Returns a port + operationId: findPortById + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a port + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/assign.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/assign.yaml new file mode 100644 index 00000000..b24d19ed --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/assign.yaml @@ -0,0 +1,48 @@ +post: + description: Assign a hardware port to a virtual network. + operationId: assignPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/PortAssignInput.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Assign a port to virtual network + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/bond.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/bond.yaml new file mode 100644 index 00000000..2fa1326a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/bond.yaml @@ -0,0 +1,51 @@ +post: + description: Enabling bonding for one or all ports + operationId: bondPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: enable both ports + in: query + name: bulk_enable + schema: + type: boolean + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Enabling bonding + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-2.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-2.yaml new file mode 100644 index 00000000..f25e6845 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-2.yaml @@ -0,0 +1,49 @@ +post: + description: Converts a bond port to Layer 2. IP assignments of the port will be + removed. + operationId: convertLayer2 + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../../components/requestBodies/PortAssignInput.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Convert to Layer 2 + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-3.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-3.yaml new file mode 100644 index 00000000..681642bb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-3.yaml @@ -0,0 +1,52 @@ +post: + description: Converts a bond port to Layer 3. VLANs must first be unassigned. + operationId: convertLayer3 + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortConvertLayer3Input.yaml' + description: IPs to request + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Convert to Layer 3 + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/disbond.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/disbond.yaml new file mode 100644 index 00000000..c824d4c5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/disbond.yaml @@ -0,0 +1,51 @@ +post: + description: Disabling bonding for one or all ports + operationId: disbondPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: disable both ports + in: query + name: bulk_disable + schema: + type: boolean + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Disabling bonding + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/native-vlan.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/native-vlan.yaml new file mode 100644 index 00000000..a23eb6fd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/native-vlan.yaml @@ -0,0 +1,89 @@ +delete: + description: Removes the native VLAN from this port + operationId: deleteNativeVlan + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Remove native VLAN + tags: + - Ports +post: + description: Sets a virtual network on this port as a "native VLAN". The VLAN must + have already been assigned using the using the "Assign a port to a virtual network" + operation. + operationId: assignNativeVlan + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Virtual Network ID. May be the UUID of the Virtual Network record, + or the VLAN value itself (ex: ''1001'').' + in: query + name: vnid + required: true + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Assign a native VLAN + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/unassign.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/unassign.yaml new file mode 100644 index 00000000..f115290d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/unassign.yaml @@ -0,0 +1,48 @@ +post: + description: Unassign a port for a hardware. + operationId: unassignPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/PortAssignInput.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Unassign a port + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments.yaml new file mode 100644 index 00000000..fe5e8bec --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments.yaml @@ -0,0 +1,53 @@ +get: + description: Show the port's current VLAN assignments, including if this VLAN is + set as native, and the current state of the assignment (ex. 'assigned' or 'unassigning') + operationId: findPortVlanAssignments + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + default: + - port + - virtual_network + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PortVlanAssignmentList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List Current VLAN assignments for a port + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/assignment_id.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/assignment_id.yaml new file mode 100644 index 00000000..2c8acbce --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/assignment_id.yaml @@ -0,0 +1,60 @@ +get: + description: Show the details of a specific Port-VLAN assignment, including the + current state and if the VLAN is set as native. + operationId: findPortVlanAssignmentByPortIdAndAssignmentId + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Assignment ID + in: path + name: assignment_id + required: true + schema: + format: uuid + type: string + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + default: + - port + - virtual_network + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignment.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Show a particular Port VLAN assignment's details + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches.yaml new file mode 100644 index 00000000..2e4b864b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches.yaml @@ -0,0 +1,95 @@ +get: + description: Show all the VLAN assignment batches that have been created for managing + this port's VLAN assignments + operationId: findPortVlanAssignmentBatches + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignmentBatchList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: List the VLAN Assignment Batches for a port + tags: + - Ports +post: + description: Create a new asynchronous batch request which handles adding and/or + removing the VLANs to which the port is assigned. + operationId: createPortVlanAssignmentBatch + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignmentBatchCreateInput.yaml' + description: VLAN Assignment batch details + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignmentBatch.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a new Port-VLAN Assignment management batch + tags: + - Ports + diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches/batch_id.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches/batch_id.yaml new file mode 100644 index 00000000..30ba91c7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches/batch_id.yaml @@ -0,0 +1,48 @@ +get: + description: Returns the details of an existing Port-VLAN Assignment batch, including + the list of VLANs to assign or unassign, and the current state of the batch. + operationId: findPortVlanAssignmentBatchByPortIdAndBatchId + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Batch ID + in: path + name: batch_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/PortVlanAssignmentBatch.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a VLAN Assignment Batch's details + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/projects.yaml b/spec/services/metalv1/oas3.fetched/paths/projects.yaml new file mode 100644 index 00000000..7057af78 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects.yaml @@ -0,0 +1,65 @@ +get: + description: Returns a collection of projects that the current user is a member + of. + operationId: findProjects + parameters: + - $ref: '../components/parameters/ProjectName.yaml' + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/ProjectList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all projects + tags: + - Projects +post: + description: Creates a new project for the user's default organization. If the user + does not have a default organization, the API will look for a personal organization belonging to the user + with the name "{User's Full Name} Projects" to associate the project with. If that organization does not exist + a new organization named "{User's Full Name} Projects" will be created and the new project will be tied to that + organization. + operationId: createProject + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/ProjectCreateFromRootInput.yaml' + description: Project to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/Project.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id.yaml new file mode 100644 index 00000000..24a89814 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id.yaml @@ -0,0 +1,130 @@ +delete: + description: Deletes the project. + operationId: deleteProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the project + tags: + - Projects +get: + description: Returns a single project if the user has access + operationId: findProjectById + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Project.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a project + tags: + - Projects +put: + description: Updates the project. + operationId: updateProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/ProjectUpdateInput.yaml' + description: Project to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Project.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/api-keys.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/api-keys.yaml new file mode 100644 index 00000000..34630a7d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/api-keys.yaml @@ -0,0 +1,81 @@ +get: + description: Returns all API keys for a specific project. + operationId: findProjectAPIKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/AuthTokenList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all API keys for the project. + tags: + - Authentication +post: + description: Creates an API key for a project. + operationId: createProjectAPIKey + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/AuthTokenInput.yaml' + description: API Key to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/AuthToken.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an API key for a project. + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/batches.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/batches.yaml new file mode 100644 index 00000000..017ac903 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/batches.yaml @@ -0,0 +1,40 @@ +get: + description: Returns all batches for the given project + operationId: findBatchesByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BatchesList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all batches by project + tags: + - Batches diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-config.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-config.yaml new file mode 100644 index 00000000..1698a5b5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-config.yaml @@ -0,0 +1,47 @@ +get: + description: Returns a bgp config + operationId: findBgpConfigByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpConfig.yaml' + description: | + ok + + When BGP configuration is not enabled empty structure is returned. + When BGP configuration is disabled after being enabled BGP configuration data is returned with status disabled. + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: | + not found + + The project was not found. + summary: Retrieve a bgp config + tags: + - BGP diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-configs.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-configs.yaml new file mode 100644 index 00000000..38957771 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-configs.yaml @@ -0,0 +1,49 @@ +post: + description: Requests to enable bgp configuration for a project. + operationId: requestBgpConfig + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpConfigRequestInput.yaml' + description: BGP config Request to create + required: true + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Requesting bgp config + tags: + - BGP diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp/sessions.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp/sessions.yaml new file mode 100644 index 00000000..5a7e9bcb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp/sessions.yaml @@ -0,0 +1,33 @@ +get: + description: Provides a listing of available BGP sessions for the project. + operationId: findProjectBgpSessions + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSessionList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all BGP sessions for project + tags: + - BGP diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/customdata.yaml new file mode 100644 index 00000000..3c665d13 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this project in json format + operationId: findProjectCustomdata + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of a project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/devices.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/devices.yaml new file mode 100644 index 00000000..63e93d74 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/devices.yaml @@ -0,0 +1,157 @@ +get: + description: Provides a collection of devices for a given project. + operationId: findProjectDevices + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/DeviceSearch.yaml' + - description: Filter by plan category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + - description: Filter by device facility + in: query + name: facility + schema: + type: string + - description: Filter by device metro + in: query + name: metro + schema: + type: string + - description: Filter by partial hostname + in: query + name: hostname + schema: + type: string + - description: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + in: query + name: reserved + schema: + type: boolean + - description: Filter by device tag + in: query + name: tag + schema: + type: string + - description: Filter by instance type (ondemand,spot,reserved) + in: query + name: type + schema: + type: string + - description: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + in: query + name: has_termination_time + schema: + type: boolean + - description: Filter by MAC address + in: query + name: mac_address + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all devices of a project + tags: + - Devices +post: + description: |- + Creates a new device and provisions it in the specified location. + + Device type-specific options are accepted. For example, `baremetal` devices accept `operating_system`, `hostname`, and `plan`. These parameters may not be accepted for other device types. The default device type is `baremetal`. + operationId: createDevice + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/DeviceCreateInMetroInput.yaml' + - $ref: '../../../components/schemas/DeviceCreateInFacilityInput.yaml' + description: Device to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Device.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a device + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/devices/batch.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/devices/batch.yaml new file mode 100644 index 00000000..a0351123 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/devices/batch.yaml @@ -0,0 +1,53 @@ +post: + description: |- + Creates new devices in batch and provisions them in our datacenter. + operationId: createDeviceBatch + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/InstancesBatchCreateInput.yaml' + description: Batches to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BatchesList.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a devices batch + tags: + - Batches diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/events.yaml new file mode 100644 index 00000000..233f1f91 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of events for a single project + operationId: findProjectEvents + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve project's events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/facilities.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/facilities.yaml new file mode 100644 index 00000000..8c32b31b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/facilities.yaml @@ -0,0 +1,42 @@ +get: + deprecated: true + description: Returns a listing of available datacenters for the given project + operationId: findFacilitiesByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/FacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all facilities visible by the project + tags: + - Facilities diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/firmware-sets.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/firmware-sets.yaml new file mode 100644 index 00000000..b056f4e7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/firmware-sets.yaml @@ -0,0 +1,41 @@ +get: + tags: + - FirmwareSets + summary: Get Project's Firmware Sets + description: Returns all firmware sets associated with the project or organization. + operationId: getProjectFirmwareSets + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - name: page + in: query + description: page number to return + schema: + type: integer + - name: per_page + in: query + description: items returned per page. + schema: + type: integer + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetListResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/global-bgp-ranges.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/global-bgp-ranges.yaml new file mode 100644 index 00000000..1da5ddf5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/global-bgp-ranges.yaml @@ -0,0 +1,39 @@ +get: + description: Returns all global bgp ranges for a project + operationId: findGlobalBgpRanges + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/GlobalBgpRangeList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all global bgp ranges + tags: + - BGP diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/hardware-reservations.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/hardware-reservations.yaml new file mode 100644 index 00000000..5d95c144 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/hardware-reservations.yaml @@ -0,0 +1,64 @@ +get: + description: Provides a collection of hardware reservations for a given project. + operationId: findProjectHardwareReservations + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by facility code, plan name, project name, reservation short ID or device hostname + in: query + name: query + schema: + type: string + - description: Filter by hardware reservation state + in: query + name: state + schema: + enum: + - active + - spare + - need_of_service + type: string + - description: Filter hardware reservation that is provisionable + in: query + name: provisionable + schema: + enum: + - only + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/HardwareReservationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all hardware reservations for a given project + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/ips.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/ips.yaml new file mode 100644 index 00000000..93765eee --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/ips.yaml @@ -0,0 +1,128 @@ +get: + description: Provides a paginated list of IP reservations for a single project. + operationId: findIPReservations + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter project IP reservations by reservation type + in: query + name: types + schema: + items: + type: string + enum: + - global_ipv4 + - private_ipv4 + - public_ipv4 + - public_ipv6 + - vrf + type: array + style: form + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Items returned per page + in: query + name: per_page + schema: + default: 250 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPReservationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all ip reservations + tags: + - IPAddresses +post: + description: Request more IP space for a project in order to have additional IP + addresses to assign to devices. If the request is within the max quota, an IP + reservation will be created. If the project will exceed its IP quota, a request + will be submitted for review, and will return an IP Reservation with a `state` + of `pending`. You can automatically have the request fail with HTTP status 422 + instead of triggering the review process by providing the `fail_on_approval_required` + parameter set to `true` in the request. + operationId: requestIPReservation + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/IPReservationRequestInput.yaml' + - $ref: '../../../components/schemas/VrfIpReservationCreateInput.yaml' + description: IP Reservation Request to create + required: true + responses: + "201": + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/IPReservation.yaml' + - $ref: '../../../components/schemas/VrfIpReservation.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Requesting IP reservations + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/licenses.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/licenses.yaml new file mode 100644 index 00000000..d70c4d49 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/licenses.yaml @@ -0,0 +1,97 @@ +get: + description: Provides a collection of licenses for a given project. + operationId: findProjectLicenses + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/LicenseList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all licenses + tags: + - Licenses +post: + description: Creates a new license for the given project + operationId: createLicense + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/LicenseCreateInput.yaml' + description: License to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/License.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a License + tags: + - Licenses diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/plans.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/plans.yaml new file mode 100644 index 00000000..f7088cda --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/plans.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a listing of available plans for the given project + operationId: findPlansByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PlanList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all plans visible by the project + tags: + - Plans diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/spot-market-requests.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/spot-market-requests.yaml new file mode 100644 index 00000000..9452307b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/spot-market-requests.yaml @@ -0,0 +1,88 @@ +get: + description: View all spot market requests for a given project. + operationId: listSpotMarketRequests + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketRequestList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List spot market requests + tags: + - SpotMarket +post: + description: |- + Creates a new spot market request. + + Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan. + + The features attribute allows you to optionally specify what features your server should have. For example, if you require a server with a TPM chip, you may specify `{ "features": { "tpm": "required" } }` (or `{ "features": ["tpm"] }` in shorthand). + + The request will fail if there are no available servers matching your criteria. 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 (see the example request below). + + The request will not fail if we have no servers with that feature in our inventory. + operationId: createSpotMarketRequest + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketRequestCreateInput.yaml' + description: Spot Market Request to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketRequest.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a spot market request + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/ssh-keys.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/ssh-keys.yaml new file mode 100644 index 00000000..5aebe140 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/ssh-keys.yaml @@ -0,0 +1,74 @@ +get: + description: Returns a collection of the project's ssh keys. + operationId: findProjectSSHKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by key, label, or fingerprint + in: query + name: query + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKeyList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve a project's ssh keys + tags: + - SSHKeys +post: + description: Creates a ssh key. + operationId: createProjectSSHKey + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKeyCreateInput.yaml' + description: ssh key to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKey.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a ssh key for the given project + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/transfers.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/transfers.yaml new file mode 100644 index 00000000..cf38cf5b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/transfers.yaml @@ -0,0 +1,54 @@ +post: + deprecated: true + description: Organization owners can transfer their projects to other organizations. + operationId: createTransferRequest + parameters: + - description: UUID of the project to be transferred + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/TransferRequestInput.yaml' + description: Transfer Request to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/TransferRequest.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a transfer request + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/usages.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/usages.yaml new file mode 100644 index 00000000..53d02794 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/usages.yaml @@ -0,0 +1,45 @@ +get: + description: Returns all usages for a project. + operationId: findProjectUsage + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter usages created after this date + in: query + name: created[after] + schema: + format: datetime + type: string + - description: Filter usages created before this date + in: query + name: created[before] + schema: + format: datetime + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/ProjectUsageList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all usages for project + tags: + - Usages diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/virtual-networks.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/virtual-networks.yaml new file mode 100644 index 00000000..d6c86c5f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/virtual-networks.yaml @@ -0,0 +1,106 @@ +get: + description: Provides a list of virtual networks for a single project. + operationId: findVirtualNetworks + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Filter by Facility ID (uuid) or Facility Code + deprecated: true + in: query + name: facility + schema: + type: string + - description: Filter by Metro ID (uuid) or Metro Code + in: query + name: metro + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualNetworkList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all virtual networks + tags: + - VLANs +post: + description: Creates an virtual network. + operationId: createVirtualNetwork + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualNetworkCreateInput.yaml' + description: Virtual Network to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualNetwork.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a virtual network + tags: + - VLANs diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/vrfs.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/vrfs.yaml new file mode 100644 index 00000000..426dd045 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/vrfs.yaml @@ -0,0 +1,88 @@ +get: + description: Returns the list of VRFs for a single project. + operationId: findVrfs + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Filter by Metro ID (uuid) or Metro Code + in: query + name: metro + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all VRFs in the project + tags: + - VRFs +post: + description: Creates a new VRF in the specified project + operationId: createVrf + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfCreateInput.yaml' + description: VRF to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Vrf.yaml' + description: created + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a new VRF in the specified project + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/connections.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/connections.yaml new file mode 100644 index 00000000..f00ac06c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/connections.yaml @@ -0,0 +1,74 @@ +get: + description: List the connections belonging to the project + operationId: projectListInterconnections + parameters: + - description: UUID of the project + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InterconnectionList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List project connections + tags: + - Interconnections +post: + description: Creates a new interconnection request + operationId: createProjectInterconnection + parameters: + - description: UUID of the project + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + $ref: '../../../components/requestBodies/InterconnectionCreateInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Interconnection.yaml' + description: created + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Request a new interconnection for the project's organization + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/invitations.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/invitations.yaml new file mode 100644 index 00000000..f645e882 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/invitations.yaml @@ -0,0 +1,90 @@ +get: + description: Returns all invitations in a project. + operationId: findProjectInvitations + parameters: + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InvitationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve project invitations + tags: + - Projects +post: + description: In order to add a user to a project, they must first be invited. + operationId: createProjectInvitation + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/InvitationInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Invitation.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an invitation for a project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/ips/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/ips/id/customdata.yaml new file mode 100644 index 00000000..701d7695 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/ips/id/customdata.yaml @@ -0,0 +1,43 @@ +get: + description: Provides the custom metadata stored for this IP Reservation in json + format + operationId: findIPReservationCustomdata + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: Ip Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an IP Reservation + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/memberships.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/memberships.yaml new file mode 100644 index 00000000..79362fa3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/memberships.yaml @@ -0,0 +1,47 @@ +get: + description: Returns all memberships in a project. + operationId: findProjectMemberships + parameters: + - description: Search by member full name, id and email. + in: query + name: search + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/MembershipList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve project memberships + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/metal-gateways.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/metal-gateways.yaml new file mode 100644 index 00000000..3ab78d3a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/metal-gateways.yaml @@ -0,0 +1,91 @@ +get: + description: Return all metal gateways for a project + operationId: findMetalGatewaysByProject + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/MetalGatewayList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Returns all metal gateways for a project + tags: + - MetalGateways +post: + description: Create a metal gateway in a project + operationId: createMetalGateway + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/MetalGatewayCreateInput.yaml' + - $ref: '../../../components/schemas/VrfMetalGatewayCreateInput.yaml' + description: Metal Gateway to create + required: true + responses: + "201": + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/MetalGateway.yaml' + - $ref: '../../../components/schemas/VrfMetalGateway.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a metal gateway + tags: + - MetalGateways diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations.yaml new file mode 100644 index 00000000..f3e16aa1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations.yaml @@ -0,0 +1,83 @@ +get: + description: Returns all reservations. + operationId: findSelfServiceReservations + parameters: + - $ref: '../../../../components/parameters/Page.yaml' + - $ref: '../../../../components/parameters/PerPage.yaml' + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: Filter reservations by items category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SelfServiceReservationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all reservations + tags: + - SelfServiceReservations +post: + description: Creates a reservation. + operationId: createSelfServiceReservation + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/CreateSelfServiceReservationRequest.yaml' + description: reservation to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SelfServiceReservationResponse.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a reservation + tags: + - SelfServiceReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations/id.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations/id.yaml new file mode 100644 index 00000000..22fe23df --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations/id.yaml @@ -0,0 +1,40 @@ +get: + description: Returns a reservation + operationId: findSelfServiceReservation + parameters: + - description: Reservation short_id + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/SelfServiceReservationResponse.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a reservation + tags: + - SelfServiceReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/reset-password.yaml b/spec/services/metalv1/oas3.fetched/paths/reset-password.yaml new file mode 100644 index 00000000..524c11a7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/reset-password.yaml @@ -0,0 +1,53 @@ +delete: + description: Resets current user password. + operationId: resetPassword + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/NewPassword.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Reset current user password + tags: + - PasswordResetTokens +post: + description: Creates a password reset token + operationId: createPasswordResetToken + parameters: + - description: Email of user to create password reset token + in: query + name: email + required: true + schema: + type: string + responses: + "201": + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a password reset token + tags: + - PasswordResetTokens diff --git a/spec/services/metalv1/oas3.fetched/paths/routes/id.yaml b/spec/services/metalv1/oas3.fetched/paths/routes/id.yaml new file mode 100644 index 00000000..c817958a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/routes/id.yaml @@ -0,0 +1,137 @@ +delete: + summary: Delete a VRF Route + description: Trigger the deletion of a VRF Route resource. The status of the route will update to 'deleting', and the route resource will remain accessible while background operations remove the route from the network. Once the route has been removed from the network, the resource will be fully deleted. + operationId: deleteVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRoute.yaml' + description: Accepted + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs + +get: + summary: Retrieve a VRF Route + description: Returns a single VRF Route resource + operationId: findVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRoute.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs + +put: + summary: Update a VRF Route + description: Requests a VRF Route be redeployed across the network. Updating the prefix or next-hop address on a route is not currently supported. + operationId: updateVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRouteUpdateInput.yaml' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRoute.yaml' + description: Accepted + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unprocessable Entity + "429": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Too Many Requests + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/routes/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/routes/id/events.yaml new file mode 100644 index 00000000..566282b1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/routes/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of the VRF route events + operationId: findVrfRouteEvents + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve VRF route events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/spot-market-requests/id.yaml b/spec/services/metalv1/oas3.fetched/paths/spot-market-requests/id.yaml new file mode 100644 index 00000000..4ef048ff --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/spot-market-requests/id.yaml @@ -0,0 +1,80 @@ +delete: + description: Deletes the spot market request. + operationId: deleteSpotMarketRequest + parameters: + - description: SpotMarketRequest UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Terminate associated spot instances + in: query + name: force_termination + schema: + type: boolean + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the spot market request + tags: + - SpotMarket +get: + description: Returns a single spot market request + operationId: findSpotMarketRequestById + parameters: + - description: SpotMarketRequest UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/SpotMarketRequest.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a spot market request + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.fetched/paths/ssh-keys.yaml b/spec/services/metalv1/oas3.fetched/paths/ssh-keys.yaml new file mode 100644 index 00000000..e45af1b4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ssh-keys.yaml @@ -0,0 +1,55 @@ +get: + description: Returns a collection of the user’s ssh keys. + operationId: findSSHKeys + parameters: + - description: Search by key, label, or fingerprint + in: query + name: search + schema: + type: string + - $ref: '../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/SSHKeyList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all ssh keys + tags: + - SSHKeys +post: + description: Creates a ssh key. + operationId: createSSHKey + requestBody: + $ref: '../components/requestBodies/SSHKeyCreateInput.yaml' + parameters: + - $ref: '../components/parameters/Include.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/SSHKey.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a ssh key for the current user + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.fetched/paths/ssh-keys/id.yaml b/spec/services/metalv1/oas3.fetched/paths/ssh-keys/id.yaml new file mode 100644 index 00000000..5cc39162 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ssh-keys/id.yaml @@ -0,0 +1,128 @@ +delete: + description: Deletes the ssh key. + operationId: deleteSSHKey + parameters: + - description: ssh key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the ssh key + tags: + - SSHKeys +get: + description: Returns a single ssh key if the user has access + operationId: findSSHKeyById + parameters: + - description: SSH Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/SSHKey.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a ssh key + tags: + - SSHKeys +put: + description: Updates the ssh key. + operationId: updateSSHKey + parameters: + - description: SSH Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/SSHKeyInput.yaml' + description: ssh key to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/SSHKey.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the ssh key + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.fetched/paths/support-requests.yaml b/spec/services/metalv1/oas3.fetched/paths/support-requests.yaml new file mode 100644 index 00000000..080e4f0f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/support-requests.yaml @@ -0,0 +1,40 @@ +post: + description: Support Ticket. + operationId: requestSupport + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/SupportRequestInput.yaml' + description: Support Request to create + required: true + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a support ticket + tags: + - SupportRequest diff --git a/spec/services/metalv1/oas3.fetched/paths/transfers/id.yaml b/spec/services/metalv1/oas3.fetched/paths/transfers/id.yaml new file mode 100644 index 00000000..e9ea5bdb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/transfers/id.yaml @@ -0,0 +1,110 @@ +delete: + description: Decline a transfer request. + operationId: declineTransferRequest + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Decline a transfer request + tags: + - TransferRequests +get: + description: Returns a single transfer request. + operationId: findTransferRequestById + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/TransferRequest.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: View a transfer request + tags: + - TransferRequests +put: + description: Accept a transfer request. + operationId: acceptTransferRequest + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Accept a transfer request + tags: + - TransferRequests diff --git a/spec/services/metalv1/oas3.fetched/paths/user.yaml b/spec/services/metalv1/oas3.fetched/paths/user.yaml new file mode 100644 index 00000000..bb9f08d1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user.yaml @@ -0,0 +1,57 @@ +get: + description: Returns the user object for the currently logged-in user. + operationId: findCurrentUser + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/User.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve the current user + tags: + - Users +put: + description: Updates the currently logged-in user. + operationId: updateCurrentUser + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/UserUpdateInput.yaml' + description: User to update + required: true + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/User.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the current user + tags: + - Users diff --git a/spec/services/metalv1/oas3.fetched/paths/user/api-keys.yaml b/spec/services/metalv1/oas3.fetched/paths/user/api-keys.yaml new file mode 100644 index 00000000..06f1a274 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/api-keys.yaml @@ -0,0 +1,72 @@ +post: + description: Creates a API key for the current user. + operationId: createAPIKey + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/AuthTokenInput.yaml' + description: API key to create + required: true + parameters: + - $ref: '../../components/parameters/Include.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../components/schemas/AuthToken.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an API key + tags: + - Authentication +get: + description: Returns all API keys for the current user. + operationId: findAPIKeys + parameters: + - description: Search by description + in: query + name: search + schema: + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/AuthTokenList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all user API keys + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.fetched/paths/user/api-keys/id.yaml b/spec/services/metalv1/oas3.fetched/paths/user/api-keys/id.yaml new file mode 100644 index 00000000..59edb412 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/api-keys/id.yaml @@ -0,0 +1,29 @@ +delete: + description: Deletes the current user API key. + operationId: deleteUserAPIKey + parameters: + - description: API Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Delete the API key + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/app.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/app.yaml new file mode 100644 index 00000000..ac3f4be6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/otp/app.yaml @@ -0,0 +1,36 @@ +delete: + description: Disables two factor authentication. + operationId: disableTfaApp + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Disable two factor authentication + tags: + - TwoFactorAuth +post: + description: Enables two factor authentication using authenticator app. + operationId: enableTfaApp + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Enable two factor auth using app + tags: + - TwoFactorAuth diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/recovery-codes.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/recovery-codes.yaml new file mode 100644 index 00000000..b0f88de7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/otp/recovery-codes.yaml @@ -0,0 +1,62 @@ +get: + description: Returns my recovery codes. + operationId: findRecoveryCodes + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/RecoveryCodeList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Retrieve my recovery codes + tags: + - OTPs +post: + description: Generate a new set of recovery codes. + operationId: regenerateCodes + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/RecoveryCodeList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Generate new recovery codes + tags: + - OTPs diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/sms.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/sms.yaml new file mode 100644 index 00000000..d7b17f74 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/otp/sms.yaml @@ -0,0 +1,36 @@ +delete: + description: Disables two factor authentication. + operationId: disableTfaSms + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Disable two factor authentication + tags: + - TwoFactorAuth +post: + description: Enables two factor authentication with sms. + operationId: enableTfaSms + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Enable two factor auth using sms + tags: + - TwoFactorAuth diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/sms/receive.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/sms/receive.yaml new file mode 100644 index 00000000..c2bea8dc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/otp/sms/receive.yaml @@ -0,0 +1,33 @@ +post: + description: Sends an OTP to the user's mobile phone. + operationId: receiveCodes + responses: + "204": + description: no content + "400": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: bad request + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + "500": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: internal server error + summary: Receive an OTP per sms + tags: + - OTPs diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/verify/otp.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/verify/otp.yaml new file mode 100644 index 00000000..750dc153 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/otp/verify/otp.yaml @@ -0,0 +1,29 @@ +post: + description: It verifies the user once a valid OTP is provided. It gives back a + session token, essentially logging in the user. + operationId: findEnsureOtp + parameters: + - description: OTP + in: path + name: otp + required: true + schema: + type: string + responses: + "204": + description: no content + "400": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: bad request + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + summary: Verify user by providing an OTP + tags: + - OTPs diff --git a/spec/services/metalv1/oas3.fetched/paths/userdata/validate.yaml b/spec/services/metalv1/oas3.fetched/paths/userdata/validate.yaml new file mode 100644 index 00000000..6a952f3c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/userdata/validate.yaml @@ -0,0 +1,27 @@ +post: + description: Validates user data (Userdata) + operationId: validateUserdata + parameters: + - description: Userdata to validate + in: query + name: userdata + schema: + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Validate user data + tags: + - Userdata diff --git a/spec/services/metalv1/oas3.fetched/paths/users.yaml b/spec/services/metalv1/oas3.fetched/paths/users.yaml new file mode 100644 index 00000000..cc1df33c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/users.yaml @@ -0,0 +1,59 @@ +get: + description: Returns a list of users that the are accessible to the current user + (all users in the current user’s projects, essentially). + operationId: findUsers + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/UserList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all users + tags: + - Users +post: + description: Creates a user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/UserCreateInput.yaml' + description: User to create + required: true + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "202": + description: accepted + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + example: + errors: + - "username@example.com is not a valid email address" + description: unprocessable entity + summary: Create a user + tags: + - Users diff --git a/spec/services/metalv1/oas3.fetched/paths/users/id.yaml b/spec/services/metalv1/oas3.fetched/paths/users/id.yaml new file mode 100644 index 00000000..4e4c8a08 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/users/id.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a single user if the user has access + operationId: findUserById + parameters: + - description: User UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/User.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a user + tags: + - Users diff --git a/spec/services/metalv1/oas3.fetched/paths/users/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/users/id/customdata.yaml new file mode 100644 index 00000000..8ba9eabb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/users/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this user in json format + operationId: findUserCustomdata + parameters: + - description: User UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of a user + tags: + - Users diff --git a/spec/services/metalv1/oas3.fetched/paths/verify-email.yaml b/spec/services/metalv1/oas3.fetched/paths/verify-email.yaml new file mode 100644 index 00000000..a0d9e02c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/verify-email.yaml @@ -0,0 +1,60 @@ +post: + description: Creates an email verification request + operationId: createValidationRequest + parameters: + - description: Email for verification request + in: query + name: login + required: true + schema: + type: string + - $ref: '../components/parameters/Include.yaml' + responses: + "201": + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an email verification request + tags: + - UserVerificationTokens +put: + description: Consumes an email verification token and verifies the user associated + with it. + operationId: consumeVerificationRequest + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/VerifyEmail.yaml' + description: Email to create + required: true + parameters: + - $ref: '../components/parameters/Include.yaml' + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Verify a user using an email verification token + tags: + - UserVerificationTokens diff --git a/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id.yaml b/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id.yaml new file mode 100644 index 00000000..01a6b0a5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id.yaml @@ -0,0 +1,118 @@ +delete: + description: Delete a virtual circuit from a Dedicated Port. + operationId: deleteVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: accepted + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete a virtual circuit + tags: + - Interconnections +get: + description: Get the details of a virtual circuit + operationId: getVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Get a virtual circuit + tags: + - Interconnections +put: + description: Update the details of a virtual circuit. + operationId: updateVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuitUpdateInput.yaml' + description: Updated Virtual Circuit details + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: ok + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: accepted + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Update a virtual circuit + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id/events.yaml new file mode 100644 index 00000000..f255c449 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of the virtual circuit events + operationId: findVirtualCircuitEvents + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve virtual circuit events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/virtual-networks/id.yaml b/spec/services/metalv1/oas3.fetched/paths/virtual-networks/id.yaml new file mode 100644 index 00000000..4257105e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/virtual-networks/id.yaml @@ -0,0 +1,150 @@ +delete: + description: Deletes a virtual network. + operationId: deleteVirtualNetwork + parameters: + - description: Virtual Network UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Delete a virtual network + tags: + - VLANs +get: + description: Get a virtual network. + operationId: getVirtualNetwork + parameters: + - description: Virtual Network UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualNetwork.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get a virtual network + tags: + - VLANs +put: + description: Updates the virtual network. + operationId: updateVirtualNetwork + parameters: + - description: Virtual Network UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualNetworkUpdateInput.yaml' + description: Virtual network to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualNetwork.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + "429": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: too many requests + summary: Updates the virtual network + tags: + - VLANs diff --git a/spec/services/metalv1/oas3.fetched/paths/vrfs/id.yaml b/spec/services/metalv1/oas3.fetched/paths/vrfs/id.yaml new file mode 100644 index 00000000..98e76b4a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/vrfs/id.yaml @@ -0,0 +1,130 @@ +delete: + description: Deletes the VRF + operationId: deleteVrf + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the VRF + tags: + - VRFs +get: + description: Returns a single VRF resource + operationId: findVrfById + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Vrf.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a VRF + tags: + - VRFs +put: + description: Updates the VRF. + operationId: updateVrf + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/VrfUpdateInput.yaml' + description: VRF to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Vrf.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/vrfs/id/bgp-neighbors.yaml b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/bgp-neighbors.yaml new file mode 100644 index 00000000..803c208a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/bgp-neighbors.yaml @@ -0,0 +1,34 @@ +get: + description: Provides BGP peering information such as the IP and state + of the neighbor. + summary: Retrieve BGP neighbor states for the VRF + operationId: getVrfBGPNeighbors + tags: + - VRFs + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfBGPNeighborsList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found diff --git a/spec/services/metalv1/oas3.fetched/paths/vrfs/id/ips.yaml b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/ips.yaml new file mode 100644 index 00000000..1a36ebd9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/ips.yaml @@ -0,0 +1,53 @@ +get: + description: Returns the list of VRF IP Reservations for the VRF. + operationId: findVrfIpReservations + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only the + href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfIpReservationList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all VRF IP Reservations in the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/vrfs/id/learned-routes.yaml b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/learned-routes.yaml new file mode 100644 index 00000000..4ea0545f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/learned-routes.yaml @@ -0,0 +1,35 @@ +get: + description: Provides information about learned routes for the VRF. + The VRF builds this information dynamically though BGP from other + routers in the network. + summary: Retrieve learned L3 routes within the VRF + operationId: getVrfLearnedRoutes + tags: + - VRFs + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfLearnedRoutesList.yaml' + "403": + description: forbidden + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found diff --git a/spec/services/metalv1/oas3.fetched/paths/vrfs/id/routes.yaml b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/routes.yaml new file mode 100644 index 00000000..034a22a5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/routes.yaml @@ -0,0 +1,90 @@ +post: + description: | + Create a route in a VRF. Currently only static default routes are supported. + operationId: createVrfRoute + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfRouteCreateInput.yaml' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfRoute.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unprocessable entity + summary: Create a VRF route + tags: + - VRFs + +get: + description: Returns the list of routes for the VRF + operationId: getVrfRoutes + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfRouteList.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + summary: Retrieve all routes in the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/vrfs/vrf_id/ips/id.yaml b/spec/services/metalv1/oas3.fetched/paths/vrfs/vrf_id/ips/id.yaml new file mode 100644 index 00000000..715bcd03 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/vrfs/vrf_id/ips/id.yaml @@ -0,0 +1,60 @@ +get: + description: Returns the specified IP Reservation for the VRF. + operationId: findVrfIpReservation + parameters: + - description: VRF UUID + in: path + name: vrf_id + required: true + schema: + type: string + format: uuid + - description: IP UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only the + href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/VrfIpReservation.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the Specified VRF IP Reservation + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.patched/openapi3.yaml b/spec/services/metalv1/oas3.patched/openapi3.yaml new file mode 100644 index 00000000..65e120c7 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/openapi3.yaml @@ -0,0 +1,19920 @@ +components: + parameters: + DeviceSearch: + description: Search by hostname, description, short_id, reservation short_id, + tags, plan name, plan slug, facility code, facility name, operating system + name, operating system slug, IP addresses. + in: query + name: search + schema: + type: string + Exclude: + description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + Include: + description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + Page: + description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + PerPage: + description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + ProjectName: + description: Filter results by name. + in: query + name: name + schema: + type: string + requestBodies: + InterconnectionCreateInput: + content: + application/json: + schema: + $ref: '#/components/schemas/createOrganizationInterconnection_request' + description: 'Dedicated port or shared interconnection (also known as Fabric + VC) creation request. + + + Shared interconnections can be created with the following request types: + + * `VlanCSPConnectionCreateInput` creates a layer 2 interconnection directly + to your Cloud Service Provider. + + * `SharedPortVCVlanCreateInput` creates a layer 2 interconnection that you + can finish configuration in Fabric. For new connections, this type is preferred + to `VlanFabricVCCreateInput`. + + * `VlanFabricVCCreateInput` creates a layer 2 interconnection that you can + connect through Fabric with a service token. + + * `VrfFabricVCCreateInput` creates a layer 3 interconnection that you can + connect through Fabric with a service token. ' + required: true + InvitationInput: + content: + application/json: + schema: + $ref: '#/components/schemas/InvitationInput' + description: Invitation to create + required: true + PortAssignInput: + content: + application/json: + schema: + $ref: '#/components/schemas/PortAssignInput' + description: 'Virtual Network ID. May be the UUID of the Virtual Network record, + or the VLAN value itself (ex: ''1001'').' + required: true + SSHKeyCreateInput: + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKeyCreateInput' + description: ssh key to create + required: true + responses: + Error: + description: Error responses are included with 4xx and 5xx HTTP responses from + the API service. Either "error" or "errors" will be set. + schemas: + AWSFabricProvider: + properties: + account_id: + description: AWS Account ID + example: '123412341234' + pattern: ^\d{12}$ + type: string + href: + format: uri + type: string + location: + example: us-west-1 + type: string + type: + enum: + - CSP_AWS + type: string + required: + - account_id + - type + type: object + Address: + properties: + address: + type: string + address2: + type: string + city: + type: string + coordinates: + $ref: '#/components/schemas/Coordinates' + country: + type: string + href: + format: uri + type: string + state: + type: string + zip_code: + type: string + type: object + Attribute: + properties: + created_at: + description: Datetime when the block was created. + format: date-time + readOnly: true + type: string + data: + $ref: '#/components/schemas/AttributeData' + href: + format: uri + type: string + namespace: + description: Attribute namespace + readOnly: true + type: string + updated_at: + description: Datetime when the block was updated. + format: date-time + readOnly: true + type: string + type: object + AttributeData: + properties: + href: + format: uri + type: string + latest: + description: Boolean flag to know if the firmware set is the latest for + the model and vendor + readOnly: true + type: boolean + model: + description: Model on which this firmware set can be applied + readOnly: true + type: string + plan: + description: Plan where the firmware set can be applied + readOnly: true + type: string + vendor: + description: Vendor on which this firmware set can be applied + readOnly: true + type: string + type: object + AuthToken: + properties: + created_at: + format: date-time + type: string + description: + description: Available only for API keys + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + project: + $ref: '#/components/schemas/AuthToken_project' + read_only: + type: boolean + token: + type: string + updated_at: + format: date-time + type: string + user: + $ref: '#/components/schemas/AuthToken_user' + type: object + AuthTokenInput: + properties: + description: + type: string + href: + format: uri + type: string + read_only: + type: boolean + type: object + AuthTokenList: + properties: + api_keys: + items: + $ref: '#/components/schemas/AuthToken' + type: array + href: + format: uri + type: string + type: object + AuthToken_project: + allOf: + - $ref: '#/components/schemas/Project' + - description: Available only for project tokens + type: object + AuthToken_user: + allOf: + - $ref: '#/components/schemas/User' + - description: Available only for user tokens + type: object + BGPSessionInput: + properties: + address_family: + description: Address family for BGP session. + enum: + - ipv4 + - ipv6 + example: ipv4 + type: string + default_route: + default: false + description: Set the default route policy. + type: boolean + href: + format: uri + type: string + type: object + Batch: + properties: + created_at: + format: date-time + type: string + devices: + items: + $ref: '#/components/schemas/Href' + type: array + error_messages: + items: + type: string + type: array + href: + format: uri + type: string + id: + format: uuid + type: string + project: + $ref: '#/components/schemas/Href' + quantity: + type: integer + state: + type: string + updated_at: + format: date-time + type: string + type: object + BatchesList: + properties: + batches: + items: + $ref: '#/components/schemas/Batch' + type: array + href: + format: uri + type: string + type: object + BgpConfig: + properties: + asn: + description: Autonomous System Number. ASN is required with Global BGP. + With Local BGP the private ASN, 65000, is assigned. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + created_at: + format: date-time + type: string + deployment_type: + description: 'In a Local BGP deployment, a customer uses an internal ASN + to control routes within a single Equinix Metal datacenter. This means + that the routes are never advertised to the global Internet. Global BGP, + on the other hand, requires a customer to have a registered ASN and IP + space. + + ' + enum: + - global + - local + example: local + type: string + href: + type: string + id: + format: uuid + type: string + max_prefix: + default: 10 + description: The maximum number of route filters allowed per server + type: integer + md5: + description: (Optional) Password for BGP session in plaintext (not a checksum) + nullable: true + type: string + project: + $ref: '#/components/schemas/Href' + ranges: + description: The IP block ranges associated to the ASN (Populated in Global + BGP only) + items: + $ref: '#/components/schemas/GlobalBgpRange' + type: array + requested_at: + format: date-time + type: string + route_object: + description: Specifies AS-MACRO (aka AS-SET) to use when building client + route filters + type: string + sessions: + description: The direct connections between neighboring routers that want + to exchange routing information. + items: + $ref: '#/components/schemas/BgpSession' + type: array + status: + description: Status of the BGP Config. Status "requested" is valid only + with the "global" deployment_type. + enum: + - requested + - enabled + - disabled + type: string + type: object + BgpConfigRequestInput: + properties: + asn: + description: Autonomous System Number for local BGP deployment. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + deployment_type: + description: Wether the BGP deployment is local or global. Local deployments + are configured immediately. Global deployments will need to be reviewed + by Equinix Metal engineers. + enum: + - local + - global + example: local + type: string + href: + format: uri + type: string + md5: + description: 'The plaintext password to share between BGP neighbors as an + MD5 checksum: + + * must be 10-20 characters long + + * may not include punctuation + + * must be a combination of numbers and letters + + * must contain at least one lowercase, uppercase, and digit character + + ' + pattern: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$ + type: string + use_case: + description: A use case explanation (necessary for global BGP request review). + type: string + required: + - asn + - deployment_type + type: object + BgpDynamicNeighbor: + properties: + bgp_neighbor_asn: + description: The ASN of the dynamic BGP neighbor + example: 12345 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + bgp_neighbor_range: + description: Network range of the dynamic BGP neighbor in CIDR format + example: 192.168.1.0/25 + type: string + created_at: + format: date-time + readOnly: true + type: string + created_by: + $ref: '#/components/schemas/UserLimited' + href: + example: /bgp-dynamic-neighbors/aea82f16-57ec-412c-9523-b7f2b27635b2 + readOnly: true + type: string + id: + description: The unique identifier for the resource + example: aea82f16-57ec-412c-9523-b7f2b27635b2 + format: uuid + readOnly: true + type: string + metal_gateway: + $ref: '#/components/schemas/VrfMetalGateway' + state: + enum: + - active + - deleting + - pending + - ready + readOnly: true + type: string + tags: + items: + type: string + type: array + updated_at: + format: date-time + readOnly: true + type: string + type: object + BgpDynamicNeighborCreateInput: + properties: + bgp_neighbor_asn: + description: The ASN of the dynamic BGP neighbor + example: 12345 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + bgp_neighbor_range: + description: Network range of the dynamic BGP neighbor in CIDR format + example: 192.168.1.0/25 + type: string + href: + format: uri + type: string + tags: + items: + type: string + type: array + required: + - bgp_neighbor_asn + - bgp_neighbor_range + type: object + BgpDynamicNeighborList: + properties: + bgp_dynamic_neighbors: + items: + $ref: '#/components/schemas/BgpDynamicNeighbor' + type: array + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + type: object + BgpNeighborData: + properties: + address_family: + description: Address Family for IP Address. Accepted values are 4 or 6 + example: 4 + format: int32 + type: integer + customer_as: + description: The customer's ASN. In a local BGP deployment, this will be + an internal ASN used to route within the data center. For a global BGP + deployment, this will be the your own ASN, configured when you set up + BGP for your project. + example: 65000 + format: int32 + type: integer + customer_ip: + description: The device's IP address. For an IPv4 BGP session, this is typically + the private bond0 address for the device. + example: 10.32.16.1 (IPv4) or 2604:1380:4111:2700::1 (IPv6) + type: string + href: + format: uri + type: string + md5_enabled: + description: True if an MD5 password is configured for the project. + type: boolean + md5_password: + description: The MD5 password configured for the project, if set. + type: string + multihop: + description: True when the BGP session should be configured as multihop. + type: boolean + peer_as: + description: The Peer ASN to use when configuring BGP on your device. + example: 65530 + format: int32 + type: integer + peer_ips: + description: A list of one or more IP addresses to use for the Peer IP section + of your BGP configuration. For non-multihop sessions, this will typically + be a single gateway address for the device. For multihop sessions, it + will be a list of IPs. + example: + - 169.254.255.1 + - 169.254.255.2 + items: + type: string + type: array + routes_in: + description: A list of project subnets + example: + - exact: true + route: 10.32.16.0/31 + items: + $ref: '#/components/schemas/BgpRoute' + type: array + routes_out: + description: A list of outgoing routes. Only populated if the BGP session + has default route enabled. + example: + - exact: true + route: 0.0.0.0/0 + items: + $ref: '#/components/schemas/BgpRoute' + type: array + type: object + BgpRoute: + properties: + exact: + type: boolean + href: + format: uri + type: string + route: + example: 10.32.16.0/31 + type: string + type: object + BgpSession: + properties: + address_family: + enum: + - ipv4 + - ipv6 + type: string + created_at: + format: date-time + type: string + default_route: + type: boolean + device: + $ref: '#/components/schemas/Href' + href: + type: string + id: + format: uuid + type: string + learned_routes: + items: + description: IPv4 or IPv6 range + example: 10.32.16.0/31 + type: string + type: array + status: + description: ' The status of the BGP Session. Multiple status values may + be reported when the device is connected to multiple switches, one value + per switch. Each status will start with "unknown" and progress to "up" + or "down" depending on the connected device. Subsequent "unknown" values + indicate a problem acquiring status from the switch. ' + example: up,down + type: string + updated_at: + format: date-time + type: string + required: + - address_family + type: object + BgpSessionList: + properties: + bgp_sessions: + items: + $ref: '#/components/schemas/BgpSession' + type: array + href: + format: uri + type: string + type: object + BgpSessionNeighbors: + properties: + bgp_neighbors: + description: A list of BGP session neighbor data + items: + $ref: '#/components/schemas/BgpNeighborData' + type: array + href: + format: uri + type: string + type: object + BondPortData: + properties: + href: + format: uri + type: string + id: + description: ID of the bonding port + format: uuid + type: string + name: + description: Name of the port interface for the bond ("bond0") + type: string + type: object + CapacityCheckPerFacilityInfo: + properties: + available: + type: boolean + facility: + type: string + href: + format: uri + type: string + plan: + type: string + quantity: + type: string + type: object + CapacityCheckPerFacilityList: + properties: + href: + format: uri + type: string + servers: + items: + $ref: '#/components/schemas/CapacityCheckPerFacilityInfo' + type: array + type: object + CapacityCheckPerMetroInfo: + properties: + available: + description: Returns true if there is enough capacity in the metro to fulfill + the quantity set. Returns false if there is not enough. + type: boolean + href: + format: uri + type: string + metro: + description: The metro ID or code sent to check capacity. + type: string + plan: + description: The plan ID or slug sent to check capacity. + type: string + quantity: + description: The number of servers sent to check capacity. + type: string + type: object + CapacityCheckPerMetroList: + properties: + href: + format: uri + type: string + servers: + items: + $ref: '#/components/schemas/CapacityCheckPerMetroInfo' + type: array + type: object + CapacityInput: + properties: + href: + format: uri + type: string + servers: + items: + $ref: '#/components/schemas/ServerInfo' + type: array + type: object + CapacityLevelPerBaremetal: + properties: + href: + format: uri + type: string + level: + type: string + type: object + CapacityList: + properties: + capacity: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/CapacityLevelPerBaremetal' + type: object + type: object + href: + format: uri + type: string + type: object + CapacityReport: + additionalProperties: + additionalProperties: + $ref: '#/components/schemas/CapacityLevelPerBaremetal' + type: object + type: object + Component: + properties: + checksum: + description: File checksum + readOnly: true + type: string + component: + description: Component type + example: bmc + readOnly: true + type: string + created_at: + description: Datetime when the block was created. + format: date-time + readOnly: true + type: string + filename: + description: name of the file + readOnly: true + type: string + href: + format: uri + type: string + model: + description: List of models where this component version can be applied + items: + example: romed8hm3 + type: string + readOnly: true + type: array + repository_url: + description: Location of the file in the repository + readOnly: true + type: string + updated_at: + description: Datetime when the block was updated. + format: date-time + readOnly: true + type: string + upstream_url: + description: Location of the file + readOnly: true + type: string + uuid: + description: Component UUID + example: 0516463a-47ee-4809-9a66-ece8c740eed9 + format: uuid + readOnly: true + type: string + vendor: + description: Component vendor + example: equinix + readOnly: true + type: string + version: + description: Version of the component + example: 1.5.0 + readOnly: true + type: string + type: object + Coordinates: + properties: + href: + format: uri + type: string + latitude: + type: string + longitude: + type: string + type: object + CreateEmailInput: + properties: + address: + type: string + href: + format: uri + type: string + required: + - address + type: object + CreateSelfServiceReservationRequest: + properties: + href: + format: uri + type: string + item: + items: + $ref: '#/components/schemas/SelfServiceReservationItemRequest' + type: array + notes: + type: string + period: + $ref: '#/components/schemas/CreateSelfServiceReservationRequest_period' + start_date: + format: date-time + type: string + type: object + CreateSelfServiceReservationRequest_period: + properties: + count: + enum: + - 12 + - 36 + type: integer + href: + format: uri + type: string + unit: + enum: + - monthly + type: string + type: object + DedicatedPortCreateInput: + properties: + billing_account_name: + description: The billing account name of the Equinix Fabric account. + type: string + contact_email: + description: The preferred email used for communication and notifications + about the Equinix Fabric interconnection. Optional and defaults to the + primary user email address when using a User API key or the organization + owner email address when using a Project API key. + format: email + type: string + description: + type: string + facility_id: + type: string + x-deprecated: true + href: + format: uri + type: string + metro: + description: A Metro ID or code. For interconnections with Dedicated Ports, + this will be the location of the issued Dedicated Ports. + type: string + mode: + description: "The mode of the interconnection (only relevant to Dedicated\ + \ Ports). Fabric VCs won't have this field. Can be either 'standard' or\ + \ 'tunnel'.\n 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.\n In tunnel mode, an 802.1q\ + \ tunnel is added to a port to send/receive double tagged packets from\ + \ server instances." + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + speed: + description: A interconnection speed, in bps, mbps, or gbps. For Dedicated + Ports, this can be 10Gbps or 100Gbps. + example: '10000000000' + type: string + tags: + items: + type: string + type: array + type: + description: When requesting for a dedicated port, the value of this field + should be 'dedicated'. + enum: + - dedicated + type: string + use_case: + description: The intended use case of the dedicated port. + type: string + required: + - metro + - name + - redundancy + - type + type: object + Device: + properties: + actions: + description: Actions supported by the device instance. + items: + $ref: '#/components/schemas/Device_actions_inner' + type: array + always_pxe: + type: boolean + billing_cycle: + type: string + bonding_mode: + type: integer + created_at: + format: date-time + type: string + created_by: + $ref: '#/components/schemas/Device_created_by' + customdata: + additionalProperties: true + default: {} + type: object + description: + type: string + facility: + $ref: '#/components/schemas/Facility' + firmware_set_id: + description: The UUID of the firmware set to associate with the device. + format: uuid + type: string + hardware_reservation: + $ref: '#/components/schemas/HardwareReservation' + hostname: + type: string + href: + type: string + id: + format: uuid + type: string + image_url: + type: string + ip_addresses: + items: + $ref: '#/components/schemas/IPAssignment' + type: array + ipxe_script_url: + type: string + iqn: + type: string + locked: + description: Prevents accidental deletion of this resource when set to true. + type: boolean + metro: + $ref: '#/components/schemas/Device_metro' + network_frozen: + description: Whether network mode changes such as converting to/from Layer2 + or Layer3 networking, bonding or disbonding network interfaces are permitted + for the device. + type: boolean + network_ports: + description: "By default, servers at Equinix Metal are configured in a \u201C\ + bonded\u201D mode using LACP (Link Aggregation Control Protocol). Each\ + \ 2-NIC server is configured with a single bond (namely bond0) with both\ + \ interfaces eth0 and eth1 as members of the bond in a default Layer 3\ + \ mode. Some device plans may have a different number of ports and bonds\ + \ available." + items: + $ref: '#/components/schemas/Port' + type: array + operating_system: + $ref: '#/components/schemas/OperatingSystem' + plan: + $ref: '#/components/schemas/Plan' + project: + $ref: '#/components/schemas/Project' + project_lite: + $ref: '#/components/schemas/Device_project_lite' + provisioning_events: + items: + $ref: '#/components/schemas/Event' + type: array + provisioning_percentage: + description: Only visible while device provisioning + format: float + type: number + root_password: + description: Root password is automatically generated when server is provisioned + and it is removed after 24 hours + type: string + short_id: + type: string + sos: + description: Hostname used to connect to the instance via the SOS (Serial + over SSH) out-of-band console. + type: string + spot_instance: + description: Whether or not the device is a spot instance. + type: boolean + spot_price_max: + description: 'The maximum price per hour you are willing to pay to keep + this spot + + instance. If you are outbid, the termination will be set allowing two + + minutes before shutdown.' + format: float + type: number + ssh_keys: + items: + $ref: '#/components/schemas/Href' + type: array + state: + description: "The current state the instance is in.\n\n* When an instance\ + \ is initially created it will be in the `queued` state until it is picked\ + \ up by the provisioner.\n* Once provisioning has begun on the instance\ + \ it's state will move to `provisioning`.\n* When an instance is deleted,\ + \ it will move to `deprovisioning` state until the deprovision is completed\ + \ and the instance state moves to `deleted`.\n* If an instance fails to\ + \ provision or deprovision it will move to `failed` state.\n* Once an\ + \ instance has completed provisioning it will move to `active` state.\n\ + * If an instance is currently powering off or powering on it will move\ + \ to `powering_off` or `powering_on` states respectively. \n* When the\ + \ instance is powered off completely it will move to the `inactive` state.\n\ + * When an instance is powered on completely it will move to the `active`\ + \ state.\n* Using the reinstall action to install a new OS on the instance\ + \ will cause the instance state to change to `reinstalling`.\n* When the\ + \ reinstall action is complete the instance will move to `active` state." + enum: + - queued + - provisioning + - deprovisioning + - reinstalling + - active + - inactive + - failed + - powering_on + - powering_off + - deleted + type: string + storage: + $ref: '#/components/schemas/Storage' + switch_uuid: + description: 'Switch short id. This can be used to determine if two devices + are + + connected to the same switch, for example.' + type: string + tags: + items: + type: string + type: array + termination_time: + description: 'When the device will be terminated. If you don''t supply timezone + info, the timestamp is assumed to be in UTC. + + + This is commonly set in advance for + + ephemeral spot market instances but this field may also be set with + + on-demand and reservation instances to automatically delete the resource + + at a given time. The termination time can also be used to release a + + hardware reservation instance at a given time, keeping the reservation + + open for other uses. On a spot market device, the termination time will + + be set automatically when outbid.' + example: 2021-09-03 16:32:00+03:00 + format: date-time + type: string + updated_at: + format: date-time + type: string + user: + type: string + userdata: + type: string + volumes: + items: + $ref: '#/components/schemas/Href' + type: array + type: object + DeviceActionInput: + properties: + deprovision_fast: + description: When type is `reinstall`, enabling fast deprovisioning will + bypass full disk wiping. + type: boolean + force_delete: + description: May be required to perform actions under certain conditions + type: boolean + href: + format: uri + type: string + ipxe_script_url: + description: When type is `reinstall`, use this `ipxe_script_url` (`operating_system` + must be `custom_ipxe`, defaults to the current `ipxe_script_url`) + type: string + operating_system: + description: When type is `reinstall`, use this `operating_system` (defaults + to the current `operating system`) + example: ubuntu_22_04 + type: string + preserve_data: + description: When type is `reinstall`, preserve the existing data on all + disks except the operating-system disk. + type: boolean + type: + description: Action to perform. See Device.actions for possible actions. + enum: + - power_on + - power_off + - reboot + - rescue + - reinstall + type: string + required: + - type + type: object + DeviceCreateInFacilityInput: + allOf: + - $ref: '#/components/schemas/FacilityInput' + - $ref: '#/components/schemas/DeviceCreateInput' + DeviceCreateInMetroInput: + allOf: + - $ref: '#/components/schemas/MetroInput' + - $ref: '#/components/schemas/DeviceCreateInput' + DeviceCreateInput: + properties: + always_pxe: + 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.' + type: boolean + billing_cycle: + description: The billing cycle of the device. + enum: + - hourly + - daily + - monthly + - yearly + type: string + customdata: + additionalProperties: true + default: {} + description: 'Customdata is an arbitrary JSON value that can be accessed + via the + + metadata service.' + type: object + description: + description: 'Any description of the device or how it will be used. This + may be used + + to inform other API consumers with project access.' + type: string + features: + description: '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.' + items: + type: string + type: array + hardware_reservation_id: + description: '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.' + example: next-available + type: string + hostname: + description: The hostname to use within the operating system. The same hostname + may be used on multiple devices within a project. + type: string + href: + format: uri + type: string + ip_addresses: + default: + - address_family: 4 + public: true + - address_family: 4 + public: false + - address_family: 6 + public: true + description: '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.' + items: + $ref: '#/components/schemas/IPAddress' + type: array + ipxe_script_url: + description: '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.' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/operating-systems/custom-ipxe/ + type: string + locked: + default: false + description: Whether the device should be locked, preventing accidental + deletion. + type: boolean + network_frozen: + description: If true, this instance can not be converted to a different + network type. + type: boolean + no_ssh_keys: + default: false + description: Overrides default behaviour of attaching all of the organization + members ssh keys and project ssh keys to device if no specific keys specified + type: boolean + operating_system: + description: The slug of the operating system to provision. Check the Equinix + Metal operating system documentation for rules that may be imposed per + operating system, including restrictions on IP address options and device + plans. + type: string + plan: + description: The slug of the device plan to provision. + example: c3.large.x86 + type: string + private_ipv4_subnet_size: + description: Deprecated. Use ip_addresses. Subnet range for addresses allocated + to this device. + format: int32 + type: integer + x-deprecated: true + project_ssh_keys: + description: 'A list of UUIDs identifying the device parent project + + that should be authorized to access this device (typically + + via /root/.ssh/authorized_keys). These keys will also appear in the device + metadata. + + + If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and + `ssh_keys` are all empty lists or omitted), + + all parent project keys, parent project members keys and organization + members keys will be included. This behaviour can + + be changed with ''no_ssh_keys'' option to omit any SSH key being added. + + ' + items: + format: uuid + type: string + type: array + public_ipv4_subnet_size: + description: Deprecated. Use ip_addresses. Subnet range for addresses allocated + to this device. Your project must have addresses available for a non-default + request. + format: int32 + type: integer + x-deprecated: true + spot_instance: + description: Create a spot instance. Spot instances are created with a maximum + bid price. If the bid price is not met, the spot instance will be terminated + as indicated by the `termination_time` field. + type: boolean + spot_price_max: + description: The maximum amount to bid for a spot instance. + example: 1.23 + format: float + type: number + ssh_keys: + description: "A list of new or existing project ssh_keys\nthat should be\ + \ authorized to access this device (typically\nvia /root/.ssh/authorized_keys).\ + \ These keys will also\nappear in the device metadata.\n\nThese keys are\ + \ added in addition to any keys defined by\n `project_ssh_keys` and `user_ssh_keys`.\n" + items: + $ref: '#/components/schemas/SSHKeyInput' + type: array + storage: + $ref: '#/components/schemas/Storage' + tags: + items: + type: string + type: array + termination_time: + description: 'When the device will be terminated. If you don''t supply timezone + info, the timestamp is assumed to be in UTC. + + + This is commonly set in advance for + + ephemeral spot market instances but this field may also be set with + + on-demand and reservation instances to automatically delete the resource + + at a given time. The termination time can also be used to release a + + hardware reservation instance at a given time, keeping the reservation + + open for other uses. On a spot market device, the termination time will + + be set automatically when outbid. + + ' + example: 2021-09-03 16:32:00+03:00 + format: date-time + type: string + user_ssh_keys: + description: 'A list of UUIDs identifying the users + + that should be authorized to access this device (typically + + via /root/.ssh/authorized_keys). These keys will also + + appear in the device metadata. + + + The users must be members of the project or organization. + + + If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and + `ssh_keys` are all empty lists or omitted), + + all parent project keys, parent project members keys and organization + members keys will be included. This behaviour can + + be changed with ''no_ssh_keys'' option to omit any SSH key being added. + + ' + items: + format: uuid + type: string + type: array + userdata: + 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.' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/server-metadata/user-data/ + type: string + required: + - operating_system + - plan + type: object + DeviceHealthRollup: + description: Represents a Device Health Status + properties: + health_rollup: + description: Health Status + enum: + - ok + - warning + - critical + readOnly: true + type: string + href: + format: uri + type: string + updated_at: + description: Last update of health status. + format: date-time + readOnly: true + type: string + type: object + DeviceList: + properties: + devices: + items: + $ref: '#/components/schemas/Device' + type: array + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + type: object + DeviceUpdateInput: + properties: + always_pxe: + type: boolean + billing_cycle: + type: string + customdata: + additionalProperties: true + default: {} + type: object + description: + type: string + firmware_set_id: + type: string + hostname: + type: string + href: + format: uri + type: string + ipxe_script_url: + type: string + locked: + description: Whether the device should be locked, preventing accidental + deletion. + type: boolean + network_frozen: + description: If true, this instance can not be converted to a different + network type. + type: boolean + spot_instance: + description: Can be set to false to convert a spot-market instance to on-demand. + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/spot-market/#converting-a-spot-market-server-to-on-demand + type: boolean + tags: + items: + type: string + type: array + userdata: + type: string + type: object + DeviceUsage: + properties: + href: + format: uri + type: string + quantity: + type: string + total: + type: string + unit: + type: string + type: object + DeviceUsageList: + properties: + href: + format: uri + type: string + usages: + items: + $ref: '#/components/schemas/DeviceUsage' + type: array + type: object + Device_actions_inner: + properties: + href: + format: uri + type: string + name: + type: string + type: + type: string + type: object + Device_created_by: + allOf: + - $ref: '#/components/schemas/UserLite' + - description: The user that created the device. + type: object + Device_metro: + allOf: + - $ref: '#/components/schemas/Metro' + - description: The metro the facility is in + type: object + Device_project_lite: + allOf: + - $ref: '#/components/schemas/Href' + - description: Lite version of project object when included + type: object + Disk: + properties: + device: + type: string + href: + format: uri + type: string + partitions: + items: + $ref: '#/components/schemas/Partition' + type: array + wipeTable: + type: boolean + type: object + Email: + properties: + address: + type: string + default: + type: boolean + href: + type: string + id: + format: uuid + type: string + verified: + type: boolean + type: object + EmailInput: + properties: + address: + type: string + default: + type: boolean + href: + format: uri + type: string + required: + - address + type: object + Entitlement: + properties: + description: + type: string + feature_access: + type: object + href: + type: string + id: + format: uuid + type: string + instance_quota: + type: object + ip_quota: + type: object + name: + type: string + project_quota: + default: 0 + type: integer + slug: + type: string + volume_limits: + type: object + volume_quota: + type: object + weight: + type: integer + required: + - id + - slug + - weight + type: object + Error: + description: Error responses are included with 4xx and 5xx HTTP responses from + the API service. Either "error" or "errors" will be set. + properties: + error: + description: A description of the error that caused the request to fail. + type: string + errors: + description: A list of errors that contributed to the request failing. + items: + description: An error message that contributed to the request failing. + type: string + type: array + href: + format: uri + type: string + type: object + Event: + properties: + body: + type: string + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + interpolated: + type: string + ip: + type: string + modified_by: + type: object + relationships: + items: + $ref: '#/components/schemas/Href' + type: array + state: + type: string + type: + type: string + type: object + EventList: + properties: + events: + items: + $ref: '#/components/schemas/Event' + type: array + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + type: object + FabricServiceToken: + properties: + expires_at: + description: The expiration date and time of the Fabric service token. Once + a service token is expired, it is no longer redeemable. + format: date-time + type: string + href: + format: uri + type: string + id: + description: "The UUID that can be used on the Fabric Portal to redeem either\ + \ an A-Side or Z-Side Service Token.\nFor Fabric VCs (Metal Billed), this\ + \ UUID will represent an A-Side Service Token, which will allow interconnections\n\ + to be made from Equinix Metal to other Service Providers on Fabric. For\ + \ Fabric VCs (Fabric Billed), this UUID will\nrepresent a Z-Side Service\ + \ Token, which will allow interconnections to be made to connect an owned\ + \ Fabric Port or \nVirtual Device to Equinix Metal." + format: uuid + type: string + max_allowed_speed: + description: "The maximum speed that can be selected on the Fabric Portal\ + \ when configuring a interconnection with either \nan A-Side or Z-Side\ + \ Service Token. For Fabric VCs (Metal Billed), this is what the billing\ + \ is based off of, and can be one\nof the following options, '50mbps',\ + \ '200mbps', '500mbps', '1gbps', '2gbps', '5gbps' or '10gbps'. For Fabric\ + \ VCs\n(Fabric Billed), this will default to 10Gbps." + example: 10000000000 + format: int64 + type: integer + role: + description: Either primary or secondary, depending on which interconnection + the service token is associated to. + enum: + - primary + - secondary + type: string + service_token_type: + description: Either 'a_side' or 'z_side', depending on which type of Fabric + VC was requested. + enum: + - a_side + - z_side + type: string + state: + description: 'The state of the service token that corresponds with the service + + token state on Fabric. An ''inactive'' state refers to a token that has + not been + + redeemed yet on the Fabric side, an ''active'' state refers to a token + that has + + already been redeemed, and an ''expired'' state refers to a token that + has reached + + its expiry time.' + enum: + - inactive + - active + - expired + type: string + type: object + Facility: + properties: + address: + $ref: '#/components/schemas/Address' + code: + type: string + features: + example: + - baremetal + - backend_transfer + - global_ipv4 + items: + enum: + - baremetal + - backend_transfer + - layer_2 + - global_ipv4 + - ibx + type: string + type: array + href: + format: uri + type: string + id: + format: uuid + type: string + ip_ranges: + description: IP ranges registered in facility. Can be used for GeoIP location + example: + - 2604:1380::/36 + - 147.75.192.0/21 + items: + type: string + type: array + metro: + $ref: '#/components/schemas/Device_metro' + name: + type: string + type: object + FacilityInput: + properties: + facility: + $ref: '#/components/schemas/FacilityInput_facility' + href: + format: uri + type: string + required: + - facility + type: object + FacilityInput_facility: + anyOf: + - example: + - sv15 + items: + type: string + type: array + - example: any + type: string + deprecated: true + description: 'The datacenter where the device should be created. + + + Either metro or facility must be provided. + + + The API will accept either a single facility `{ "facility": "f1" }`, or it + can be instructed to create the device in the best available datacenter `{ + "facility": "any" }`. + + + Additionally it is possible to set a prioritized location selection. For example + `{ "facility": ["f3", "f2", "any"] }` can be used to prioritize `f3` and then + `f2` before accepting `any` facility. If none of the facilities provided have + availability for the requested device the request will fail.' + FacilityList: + properties: + facilities: + items: + $ref: '#/components/schemas/Facility' + type: array + href: + format: uri + type: string + type: object + Filesystem: + properties: + href: + format: uri + type: string + mount: + $ref: '#/components/schemas/Mount' + type: object + FirmwareSet: + description: Represents a Firmware Set + properties: + attributes: + description: Represents a list of attributes + items: + $ref: '#/components/schemas/Attribute' + type: array + component_firmware: + description: List of components versions + items: + $ref: '#/components/schemas/Component' + type: array + created_at: + description: Datetime when the block was created. + format: date-time + readOnly: true + type: string + href: + format: uri + type: string + name: + description: Firmware Set Name + readOnly: true + type: string + updated_at: + description: Datetime when the block was updated. + format: date-time + readOnly: true + type: string + uuid: + description: Firmware Set UUID + example: 0516463a-47ee-4809-9a66-ece8c740eed9 + format: uuid + readOnly: true + type: string + required: + - name + - uuid + type: object + FirmwareSetList: + description: Represents a list of FirmwareSets + items: + $ref: '#/components/schemas/FirmwareSet' + type: array + FirmwareSetListResponse: + description: Represents collection of Firmware Sets + properties: + href: + format: uri + type: string + page: + description: Page returned + type: integer + page_count: + description: Items returned in current page + type: integer + page_size: + description: Max number of items returned in a page + type: integer + records: + description: Represents a list of FirmwareSets + items: + $ref: '#/components/schemas/FirmwareSet' + type: array + total_pages: + description: Total count of pages + type: integer + total_record_count: + description: Total count of items + type: integer + type: object + FirmwareSetResponse: + description: Represents single Firmware set response + properties: + href: + format: uri + type: string + record: + $ref: '#/components/schemas/FirmwareSet' + type: object + GlobalBgpRange: + properties: + address_family: + type: integer + href: + type: string + id: + format: uuid + type: string + project: + $ref: '#/components/schemas/Href' + range: + type: string + type: object + GlobalBgpRangeList: + properties: + global_bgp_ranges: + items: + $ref: '#/components/schemas/GlobalBgpRange' + type: array + href: + format: uri + type: string + type: object + HardwareReservation: + properties: + created_at: + format: date-time + type: string + custom_rate: + description: Amount that will be charged for every billing_cycle. + example: 1050.5 + format: float + type: number + device: + $ref: '#/components/schemas/Device' + facility: + $ref: '#/components/schemas/Facility' + href: + type: string + id: + format: uuid + type: string + need_of_service: + description: Whether this Device requires assistance from Equinix Metal. + type: boolean + plan: + $ref: '#/components/schemas/Plan' + project: + $ref: '#/components/schemas/Project' + provisionable: + description: Whether the reserved server is provisionable or not. Spare + devices can't be provisioned unless they are activated first. + type: boolean + short_id: + description: Short version of the ID. + format: string + type: string + spare: + description: Whether the Hardware Reservation is a spare. Spare Hardware + Reservations are used when a Hardware Reservations requires service from + Equinix Metal + type: boolean + switch_uuid: + description: Switch short id. This can be used to determine if two devices + are connected to the same switch, for example. + type: string + termination_time: + description: Expiration date for the reservation. + format: date-time + type: string + type: object + HardwareReservationList: + properties: + hardware_reservations: + items: + $ref: '#/components/schemas/HardwareReservation' + type: array + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + type: object + Href: + properties: + href: + type: string + required: + - href + type: object + IPAddress: + properties: + address_family: + description: Address Family for IP Address + enum: + - 4 + - 6 + example: 4 + format: int32 + type: integer + cidr: + description: Cidr Size for the IP Block created. Valid values depends on + the operating system being provisioned. (28..32 for IPv4 addresses, 124..127 + for IPv6 addresses) + example: 28 + format: int32 + type: integer + href: + format: uri + type: string + ip_reservations: + description: UUIDs of any IP reservations to use when assigning IPs + items: + type: string + type: array + public: + default: true + description: Address Type for IP Address + example: false + type: boolean + type: object + IPAssignment: + properties: + address: + type: string + address_family: + type: integer + assigned_to: + $ref: '#/components/schemas/Href' + cidr: + type: integer + created_at: + format: date-time + type: string + enabled: + type: boolean + gateway: + type: string + global_ip: + type: boolean + href: + type: string + id: + format: uuid + type: string + manageable: + type: boolean + management: + type: boolean + metro: + $ref: '#/components/schemas/IPAssignment_metro' + netmask: + type: string + network: + type: string + next_hop: + description: 'Only set when this is a Metal Gateway Elastic IP Assignment. + + + The IP address within the Metal Gateway to which requests to the Elastic + IP are forwarded. + + ' + format: ipv4 + type: string + parent_block: + $ref: '#/components/schemas/ParentBlock' + public: + type: boolean + state: + description: 'Only set when this is a Metal Gateway Elastic IP Assignment. + + + Describes the current configuration state of this IP on the network. + + ' + enum: + - pending + - active + - deleting + type: string + required: + - assigned_to + type: object + IPAssignmentInput: + properties: + address: + type: string + customdata: + type: object + href: + format: uri + type: string + required: + - address + type: object + IPAssignmentList: + properties: + href: + format: uri + type: string + ip_addresses: + items: + $ref: '#/components/schemas/IPAssignment' + type: array + type: object + IPAssignmentUpdateInput: + properties: + customdata: + type: object + details: + type: string + href: + format: uri + type: string + tags: + items: + type: string + type: array + type: object + IPAssignment_metro: + allOf: + - $ref: '#/components/schemas/Metro' + - description: The metro the IP address is in + type: object + IPAvailabilitiesList: + properties: + available: + items: + type: string + type: array + href: + format: uri + type: string + type: object + IPReservation: + additionalProperties: false + properties: + addon: + type: boolean + address: + type: string + address_family: + type: integer + assignments: + items: + $ref: '#/components/schemas/Href' + type: array + available: + type: string + bill: + type: boolean + cidr: + type: integer + created_at: + format: date-time + type: string + customdata: + type: object + details: + type: string + enabled: + type: boolean + facility: + $ref: '#/components/schemas/IPReservation_facility' + gateway: + type: string + global_ip: + type: boolean + href: + type: string + id: + format: uuid + type: string + manageable: + type: boolean + management: + type: boolean + metal_gateway: + $ref: '#/components/schemas/MetalGatewayLite' + metro: + $ref: '#/components/schemas/IPReservation_metro' + netmask: + type: string + network: + type: string + project: + $ref: '#/components/schemas/Project' + project_lite: + $ref: '#/components/schemas/Href' + public: + type: boolean + requested_by: + $ref: '#/components/schemas/Href' + state: + type: string + tags: + items: + type: string + type: array + type: + enum: + - global_ipv4 + - public_ipv4 + - private_ipv4 + - public_ipv6 + type: string + required: + - type + type: object + IPReservationList: + properties: + href: + format: uri + type: string + ip_addresses: + items: + $ref: '#/components/schemas/IPReservationList_ip_addresses_inner' + type: array + meta: + $ref: '#/components/schemas/Meta' + type: object + IPReservationList_ip_addresses_inner: + anyOf: + - $ref: '#/components/schemas/IPReservation' + - $ref: '#/components/schemas/VrfIpReservation' + IPReservationRequestInput: + properties: + comments: + type: string + customdata: + type: object + details: + type: string + facility: + type: string + fail_on_approval_required: + type: boolean + href: + format: uri + type: string + metro: + description: The code of the metro you are requesting the IP reservation + in. + example: SV + type: string + quantity: + type: integer + tags: + items: + type: string + type: array + type: + type: string + required: + - quantity + - type + type: object + IPReservation_facility: + allOf: + - $ref: '#/components/schemas/Facility' + - description: The facility the IP reservation is in. If the facility the IP + reservation was requested in is in a metro, a metro value will also be set, + and the subsequent IP reservation can be used on a metro level. Can be null + if requesting an IP reservation in a metro. + type: object + IPReservation_metro: + allOf: + - $ref: '#/components/schemas/Metro' + - description: The metro the IP reservation is in. As long as the IP reservation + has a metro, it can be used on a metro level. Can be null if requesting + an IP reservation in a facility that is not in a metro. + type: object + InstancesBatchCreateInput: + properties: + batches: + items: + $ref: '#/components/schemas/InstancesBatchCreateInput_batches_inner' + type: array + href: + format: uri + type: string + type: object + InstancesBatchCreateInput_batches_inner: + allOf: + - properties: + hostnames: + items: + type: string + type: array + quantity: + 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. + type: integer + type: object + - oneOf: + - $ref: '#/components/schemas/DeviceCreateInMetroInput' + - $ref: '#/components/schemas/DeviceCreateInFacilityInput' + Interconnection: + properties: + authorization_code: + description: For Fabric VCs (Metal Billed), this allows Fabric to connect + the Metal network to any connection Fabric facilitates. Fabric uses this + token to be able to give more detailed information about the Metal end + of the network, when viewing resources from within Fabric. + type: string + contact_email: + type: string + created_at: + format: date-time + type: string + description: + type: string + fabric_provider: + $ref: '#/components/schemas/Interconnection_fabric_provider' + facility: + $ref: '#/components/schemas/Facility' + href: + format: uri + type: string + id: + format: uuid + type: string + metro: + allOf: + - $ref: '#/components/schemas/Metro' + description: "The location of where the shared or Dedicated Port is located.\ + \ For interconnections with Dedicated Ports,\n 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\n 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), \n 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: + description: "The mode of the interconnection (only relevant to Dedicated\ + \ Ports). Shared connections won't have this field. Can be either 'standard'\ + \ or 'tunnel'.\n 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.\n In tunnel mode, an 802.1q\ + \ tunnel is added to a port to send/receive double tagged packets from\ + \ server instances." + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + organization: + $ref: '#/components/schemas/Organization' + ports: + description: For Fabric VCs, these represent Virtual Port(s) created for + the interconnection. For dedicated interconnections, these represent the + Dedicated Port(s). + items: + $ref: '#/components/schemas/InterconnectionPort' + type: array + project: + $ref: '#/components/schemas/Project' + redundancy: + description: Either 'primary', meaning a single interconnection, or 'redundant', + meaning a redundant interconnection. + enum: + - primary + - redundant + type: string + requested_by: + $ref: '#/components/schemas/Href' + service_tokens: + description: For Fabric VCs (Metal Billed), this will show details of the + A-Side service tokens issued for the interconnection. For Fabric VCs (Fabric + Billed), this will show the details of the Z-Side service tokens issued + for the interconnection. Dedicated interconnections will not have any + service tokens issued. There will be one per interconnection, so for redundant + interconnections, there should be two service tokens issued. + items: + $ref: '#/components/schemas/FabricServiceToken' + type: array + speed: + description: For interconnections on Dedicated Ports and shared connections, + this represents the interconnection's speed in bps. For Fabric VCs, this + field refers to the maximum speed of the interconnection in bps. This + value will default to 10Gbps for Fabric VCs (Fabric Billed). + example: 10000000000 + format: int64 + type: integer + status: + type: string + tags: + items: + type: string + type: array + token: + description: This token is used for shared interconnections to be used as + the Fabric Token. This field is entirely deprecated. + format: uuid + type: string + type: + description: The 'shared' type of interconnection refers to shared connections, + or later also known as Fabric Virtual Connections (or Fabric VCs). The + 'dedicated' type of interconnection refers to interconnections created + with Dedicated Ports. The 'shared_port_vlan' type of interconnection refers + to shared connections created without service tokens. The 'shared_port_vlan_to_csp' + type of interconnection refers to connections created directly to a supported + cloud service provider. + enum: + - shared + - dedicated + - shared_port_vlan + - shared_port_vlan_to_csp + type: string + updated_at: + format: date-time + type: string + type: object + InterconnectionList: + properties: + href: + format: uri + type: string + interconnections: + items: + $ref: '#/components/schemas/Interconnection' + type: array + meta: + $ref: '#/components/schemas/Meta' + type: object + InterconnectionMetroList: + properties: + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + metros: + items: + $ref: '#/components/schemas/InterconnectionMetroList_metros_inner' + type: array + type: object + InterconnectionMetroList_metros_inner: + allOf: + - $ref: '#/components/schemas/Metro' + - properties: + providers: + description: A list of providers and their equivalent regions available + for connecting to the provider network. + items: + $ref: '#/components/schemas/InterconnectionMetroList_metros_inner_allOf_providers_inner' + type: array + type: object + InterconnectionMetroList_metros_inner_allOf_providers_inner: + properties: + bandwidths: + items: + description: Supported bandwidths in Mbps + example: 50 + type: integer + type: array + features: + items: + description: Additional features available in this profile. + example: high capacity + type: string + type: array + href: + format: uri + type: string + locations: + items: + description: The provider's network region name that is equivalent to + the Equinix Metro. + example: us-east-1 + type: string + type: array + name: + example: AWS Direct Connect + type: string + type: + example: CSP_AWS + type: string + type: object + InterconnectionPort: + properties: + href: + type: string + id: + format: uuid + type: string + link_status: + type: string + name: + type: string + organization: + $ref: '#/components/schemas/Href' + role: + description: Either 'primary' or 'secondary'. + enum: + - primary + - secondary + type: string + speed: + format: int64 + type: integer + status: + description: For both Fabric VCs and Dedicated Ports, this will be 'requested' + on creation and 'deleting' on deletion. Once the Fabric VC has found its + corresponding Fabric connection, this will turn to 'active'. For Dedicated + Ports, once the dedicated port is associated, this will also turn to 'active'. + For Fabric VCs, this can turn into an 'expired' state if the service token + associated is expired. + enum: + - requested + - active + - deleting + - expired + - delete_failed + type: string + switch_id: + description: A switch 'short ID' + type: string + virtual_circuits: + items: + $ref: '#/components/schemas/VirtualCircuit' + type: array + type: object + InterconnectionPortList: + properties: + href: + format: uri + type: string + ports: + items: + $ref: '#/components/schemas/InterconnectionPort' + type: array + type: object + InterconnectionPricingList: + properties: + href: + format: uri + type: string + provider_pricing: + description: Pricing information per connection provider. + items: + $ref: '#/components/schemas/InterconnectionPricingList_provider_pricing_inner' + type: array + type: object + InterconnectionPricingList_provider_pricing_inner: + properties: + href: + format: uri + type: string + provider: + example: CSP_AWS + type: string + tiers: + items: + $ref: '#/components/schemas/InterconnectionPricingList_provider_pricing_inner_tiers_inner' + type: array + type: object + InterconnectionPricingList_provider_pricing_inner_tiers_inner: + properties: + bandwidth: + description: Bandwidth tier in Mbps + example: 500 + type: integer + billing_cycle: + example: monthly + type: string + href: + format: uri + type: string + price: + example: 10.04 + format: float + type: number + type: object + InterconnectionUpdateInput: + properties: + contact_email: + type: string + description: + type: string + href: + format: uri + type: string + mode: + description: "The mode of the interconnection (only relevant to Dedicated\ + \ Ports). Shared connections won't have this field. Can be either 'standard'\ + \ or 'tunnel'.\n 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.\n In tunnel mode, an 802.1q\ + \ tunnel is added to a port to send/receive double tagged packets from\ + \ server instances." + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + tags: + items: + type: string + type: array + type: object + Interconnection_fabric_provider: + description: Configuration information for connecting to external cloud service + provider. Only available if the fabric_provider param was used when creating + the interconnection. + oneOf: + - $ref: '#/components/schemas/AWSFabricProvider' + Invitation: + properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + invitation: + $ref: '#/components/schemas/Href' + invited_by: + $ref: '#/components/schemas/Href' + invitee: + format: email + type: string + nonce: + type: string + organization: + $ref: '#/components/schemas/Href' + projects: + items: + $ref: '#/components/schemas/Href' + type: array + roles: + items: + enum: + - admin + - billing + - collaborator + - limited_collaborator + type: string + type: array + updated_at: + format: date-time + type: string + type: object + InvitationInput: + properties: + href: + format: uri + type: string + invitee: + format: email + type: string + message: + type: string + organization_id: + format: uuid + type: string + projects_ids: + items: + format: uuid + type: string + type: array + roles: + items: + enum: + - admin + - billing + - collaborator + - limited_collaborator + type: string + type: array + required: + - invitee + type: object + InvitationList: + properties: + href: + format: uri + type: string + invitations: + items: + $ref: '#/components/schemas/Membership' + type: array + type: object + Invoice: + properties: + amount: + format: float + type: number + balance: + format: float + type: number + created_on: + format: date + type: string + credit_amount: + format: float + type: number + credits_applied: + format: float + type: number + currency: + example: USD + type: string + due_on: + format: date + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + items: + items: + $ref: '#/components/schemas/LineItem' + type: array + number: + type: string + project: + $ref: '#/components/schemas/ProjectIdName' + reference_number: + type: string + status: + type: string + target_date: + format: date + type: string + type: object + InvoiceList: + properties: + href: + format: uri + type: string + invoices: + items: + $ref: '#/components/schemas/Invoice' + type: array + type: object + License: + properties: + description: + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + license_key: + type: string + licensee_product: + $ref: '#/components/schemas/Href' + project: + $ref: '#/components/schemas/Href' + size: + type: number + type: object + LicenseCreateInput: + properties: + description: + type: string + href: + format: uri + type: string + licensee_product_id: + type: string + size: + type: number + type: object + LicenseList: + properties: + href: + format: uri + type: string + licenses: + items: + $ref: '#/components/schemas/License' + type: array + type: object + LicenseUpdateInput: + properties: + description: + type: string + href: + format: uri + type: string + size: + type: number + type: object + LineItem: + properties: + adjustments: + description: Adjustments for the line item + items: + $ref: '#/components/schemas/LineItemAdjustment' + type: array + amount: + format: float + type: number + currency: + type: string + description: + type: string + details: + type: string + end_date: + format: date + type: string + hostname: + type: string + href: + format: uri + type: string + item_type: + type: string + location: + type: string + plan: + $ref: '#/components/schemas/PlanIdName' + plan_id: + format: uuid + type: string + project: + $ref: '#/components/schemas/ProjectIdName' + project_id: + format: uuid + type: string + service_id: + format: uuid + type: string + start_date: + format: date + type: string + unit: + type: string + unit_price: + format: float + type: number + type: object + LineItemAdjustment: + properties: + amount: + format: float + type: number + description: + type: string + href: + format: uri + type: string + type: object + Membership: + properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + project: + $ref: '#/components/schemas/Href' + roles: + items: + type: string + type: array + updated_at: + format: date-time + type: string + user: + $ref: '#/components/schemas/Href' + type: object + MembershipInput: + properties: + href: + format: uri + type: string + role: + items: + type: string + type: array + type: object + MembershipList: + properties: + href: + format: uri + type: string + memberships: + items: + $ref: '#/components/schemas/Membership' + type: array + type: object + Meta: + properties: + current_page: + type: integer + first: + $ref: '#/components/schemas/Href' + href: + format: uri + type: string + last: + $ref: '#/components/schemas/Href' + last_page: + type: integer + next: + $ref: '#/components/schemas/Href' + previous: + $ref: '#/components/schemas/Href' + self: + $ref: '#/components/schemas/Href' + total: + type: integer + type: object + Metadata: + properties: + class: + type: string + customdata: + additionalProperties: true + default: {} + type: object + facility: + description: The facility code of the instance + type: string + hostname: + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + iqn: + type: string + metro: + description: The metro code of the instance + type: string + network: + $ref: '#/components/schemas/Metadata_network' + operating_system: + type: object + plan: + description: The plan slug of the instance + type: string + private_subnets: + description: An array of the private subnets + items: + type: string + type: array + reserved: + type: boolean + specs: + description: The specs of the plan version of the instance + type: object + ssh_keys: + items: + type: string + type: array + state: + description: "The current state the instance is in.\n\n* When an instance\ + \ is initially created it will be in the `queued` state until it is picked\ + \ up by the provisioner.\n* Once provisioning has begun on the instance\ + \ it's state will move to `provisioning`.\n* When an instance is deleted,\ + \ it will move to `deprovisioning` state until the deprovision is completed\ + \ and the instance state moves to `deleted`.\n* If an instance fails to\ + \ provision or deprovision it will move to `failed` state.\n* Once an\ + \ instance has completed provisioning it will move to `active` state.\n\ + * If an instance is currently powering off or powering on it will move\ + \ to `powering_off` or `powering_on` states respectively. \n* When the\ + \ instance is powered off completely it will move to the `inactive` state.\n\ + * When an instance is powered on completely it will move to the `active`\ + \ state.\n* Using the reinstall action to install a new OS on the instance\ + \ will cause the instance state to change to `reinstalling`.\n* When the\ + \ reinstall action is complete the instance will move to `active` state." + enum: + - queued + - provisioning + - deprovisioning + - reinstalling + - active + - inactive + - failed + - powering_on + - powering_off + - deleted + type: string + switch_short_id: + type: string + tags: + items: + type: string + type: array + volumes: + items: + type: string + type: array + type: object + Metadata_network: + properties: + addresses: + items: + type: string + type: array + href: + format: uri + type: string + interfaces: + items: + type: object + type: array + network: + $ref: '#/components/schemas/Metadata_network_network' + type: object + Metadata_network_network: + properties: + bonding: + $ref: '#/components/schemas/Metadata_network_network_bonding' + href: + format: uri + type: string + type: object + Metadata_network_network_bonding: + properties: + href: + format: uri + type: string + link_aggregation: + type: string + mac: + type: string + mode: + type: integer + type: object + MetalGateway: + properties: + created_at: + format: date-time + type: string + created_by: + $ref: '#/components/schemas/Href' + href: + type: string + id: + format: uuid + type: string + ip_reservation: + $ref: '#/components/schemas/IPReservation' + project: + $ref: '#/components/schemas/Project' + state: + description: The current state of the Metal Gateway. 'Ready' indicates the + gateway record has been configured, but is currently not active on the + network. 'Active' indicates the gateway has been configured on the network. + 'Deleting' is a temporary state used to indicate that the gateway is in + the process of being un-configured from the network, after which the gateway + record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: '#/components/schemas/VirtualNetwork' + type: object + MetalGatewayCreateInput: + properties: + href: + format: uri + type: string + ip_reservation_id: + description: The UUID of an IP reservation that belongs to the same project + as where the metal gateway will be created in. This field is required + unless the private IPv4 subnet size is specified. + format: uuid + type: string + private_ipv4_subnet_size: + description: "The subnet size (8, 16, 32, 64, or 128) of the private IPv4\ + \ reservation that will be created for the metal gateway. This field is\ + \ required unless a project IP reservation was specified.\n Please\ + \ keep in mind that the number of private metal gateway ranges are limited\ + \ per project. If you would like to increase the limit per project, please\ + \ contact support for assistance." + type: integer + virtual_network_id: + description: The UUID of a metro virtual network that belongs to the same + project as where the metal gateway will be created in. + format: uuid + type: string + required: + - virtual_network_id + type: object + MetalGatewayElasticIpCreateInput: + properties: + address: + description: An IP address (or IP Address range) contained within one of + the project's IP Reservations + example: 147.75.234.8/31 + type: string + customdata: + additionalProperties: true + description: Optional User-defined JSON object value. + type: object + href: + format: uri + type: string + next_hop: + description: An IP address contained within the Metal Gateways' IP Reservation + range. + example: 192.168.12.13 + format: ipv4 + type: string + tags: + description: Optional list of User-defined tags. Can be used by users to + provide additional details or context regarding the purpose or usage of + this resource. + example: + - NY + - prod + - public + items: + type: string + type: array + required: + - address + - next_hop + type: object + MetalGatewayList: + properties: + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + metal_gateways: + items: + $ref: '#/components/schemas/MetalGatewayList_metal_gateways_inner' + type: array + type: object + MetalGatewayList_metal_gateways_inner: + anyOf: + - $ref: '#/components/schemas/MetalGateway' + - $ref: '#/components/schemas/VrfMetalGateway' + MetalGatewayLite: + properties: + created_at: + format: date-time + type: string + gateway_address: + description: The gateway address with subnet CIDR value for this Metal Gateway. + For example, a Metal Gateway using an IP reservation with block 10.1.2.0/27 + would have a gateway address of 10.1.2.1/27. + example: 10.1.2.1/27 + type: string + href: + type: string + id: + format: uuid + type: string + state: + description: The current state of the Metal Gateway. 'Ready' indicates the + gateway record has been configured, but is currently not active on the + network. 'Active' indicates the gateway has been configured on the network. + 'Deleting' is a temporary state used to indicate that the gateway is in + the process of being un-configured from the network, after which the gateway + record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + vlan: + description: The VLAN id of the Virtual Network record associated to this + Metal Gateway. + example: 1001 + type: integer + type: object + Metro: + properties: + code: + type: string + country: + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + name: + type: string + type: object + MetroInput: + properties: + href: + format: uri + type: string + metro: + 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.' + example: sv + type: string + required: + - metro + type: object + MetroList: + properties: + href: + format: uri + type: string + metros: + items: + $ref: '#/components/schemas/Metro' + type: array + type: object + Mount: + properties: + device: + type: string + format: + type: string + href: + format: uri + type: string + options: + items: + type: string + type: array + point: + type: string + type: object + NewPassword: + properties: + href: + format: uri + type: string + new_password: + type: string + type: object + OperatingSystem: + properties: + build_date: + description: The date on which the current OS image was build and released + format: date + type: string + default_operating_system: + description: Default operating system for the distro. + readOnly: true + type: boolean + deprecation_date: + description: The date when the OS is deprecated + format: date + type: string + distro: + type: string + distro_label: + type: string + end_of_life_date: + description: The OS no longer receives any updates and may be disabled at + any time + format: date + type: string + end_of_service_date: + description: When the OS is nearing end of life, typically 30 days before + end of life + format: date + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + licensed: + description: Licenced OS is priced according to pricing property + type: boolean + lifecycle_state: + description: Where in the support lifecycle the OS is + type: string + name: + type: string + preinstallable: + description: Servers can be already preinstalled with OS in order to shorten + provision time. + type: boolean + pricing: + description: This object contains price per time unit and optional multiplier + value if licence price depends on hardware plan or components (e.g. number + of cores) + type: object + provisionable_on: + items: + type: string + type: array + release_date: + description: The date when the OS was released + format: date + type: string + release_notes: + description: The current release notes for this OS image, typically in Markdown + format + type: string + slug: + type: string + version: + type: string + type: object + OperatingSystemList: + properties: + href: + format: uri + type: string + operating_systems: + items: + $ref: '#/components/schemas/OperatingSystem' + type: array + type: object + Organization: + properties: + address: + $ref: '#/components/schemas/Address' + billing_address: + $ref: '#/components/schemas/Address' + created_at: + format: date-time + type: string + credit_amount: + format: float + type: number + customdata: + type: object + description: + type: string + enforce_2fa_at: + description: Force to all members to have enabled the two factor authentication + after that date, unless the value is null + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + logo: + type: string + members: + items: + $ref: '#/components/schemas/Href' + type: array + memberships: + items: + $ref: '#/components/schemas/Href' + type: array + name: + type: string + projects: + items: + $ref: '#/components/schemas/Href' + type: array + terms: + type: integer + twitter: + type: string + updated_at: + format: date-time + type: string + website: + type: string + type: object + OrganizationInput: + properties: + address: + $ref: '#/components/schemas/Address' + billing_address: + $ref: '#/components/schemas/Address' + customdata: + type: object + description: + type: string + enforce_2fa_at: + description: Force to all members to have enabled the two factor authentication + after that date, unless the value is null + format: date-time + type: string + href: + format: uri + type: string + name: + type: string + twitter: + type: string + website: + type: string + type: object + OrganizationList: + properties: + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + organizations: + items: + $ref: '#/components/schemas/Organization' + type: array + type: object + ParentBlock: + properties: + cidr: + type: integer + href: + type: string + netmask: + type: string + network: + type: string + type: object + Partition: + properties: + href: + format: uri + type: string + label: + type: string + number: + format: int32 + type: integer + size: + type: string + type: object + PaymentMethod: + properties: + billing_address: + $ref: '#/components/schemas/PaymentMethodBillingAddress' + card_type: + type: string + cardholder_name: + type: string + created_at: + format: date-time + type: string + created_by_user: + $ref: '#/components/schemas/Href' + default: + type: boolean + email: + type: string + expiration_month: + type: string + expiration_year: + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + name: + type: string + organization: + $ref: '#/components/schemas/Href' + projects: + items: + $ref: '#/components/schemas/Href' + type: array + type: + type: string + updated_at: + format: date-time + type: string + type: object + PaymentMethodBillingAddress: + properties: + country_code_alpha2: + type: string + href: + format: uri + type: string + postal_code: + type: string + street_address: + type: string + type: object + PaymentMethodCreateInput: + properties: + default: + type: boolean + href: + format: uri + type: string + name: + type: string + nonce: + type: string + required: + - name + - nonce + type: object + PaymentMethodList: + properties: + href: + format: uri + type: string + payment_methods: + items: + $ref: '#/components/schemas/PaymentMethod' + type: array + type: object + PaymentMethodUpdateInput: + properties: + billing_address: + type: object + cardholder_name: + type: string + default: + type: boolean + expiration_month: + type: string + expiration_year: + type: integer + href: + format: uri + type: string + name: + type: string + type: object + Plan: + properties: + available_in: + description: Shows which facilities the plan is available in, and the facility-based + price if it is different from the default price. + items: + $ref: '#/components/schemas/Plan_available_in_inner' + type: array + available_in_metros: + description: Shows which metros the plan is available in, and the metro-based + price if it is different from the default price. + items: + $ref: '#/components/schemas/Plan_available_in_metros_inner' + type: array + categories: + description: Categories of the plan, like compute or storage. A Plan can + belong to multiple categories. + items: + type: string + type: array + class: + example: m3.large.x86 + type: string + deployment_types: + items: + enum: + - on_demand + - spot_market + type: string + minItems: 0 + type: array + uniqueItems: true + description: + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + legacy: + description: Deprecated. Always return false + type: boolean + x-deprecated: true + line: + type: string + name: + type: string + pricing: + type: object + slug: + example: m3.large.x86 + type: string + specs: + $ref: '#/components/schemas/Plan_specs' + type: + description: The plan type + enum: + - standard + - workload_optimized + - custom + type: string + type: object + PlanIdName: + properties: + href: + format: uri + type: string + id: + format: uuid + type: string + name: + type: string + type: object + PlanList: + properties: + href: + format: uri + type: string + plans: + items: + $ref: '#/components/schemas/Plan' + type: array + type: object + Plan_available_in_inner: + properties: + href: + description: href to the Facility + type: string + price: + $ref: '#/components/schemas/Plan_available_in_inner_price' + type: object + Plan_available_in_inner_price: + properties: + hour: + example: 1.23 + format: double + type: number + href: + format: uri + type: string + type: object + Plan_available_in_metros_inner: + properties: + href: + description: href to the Metro + type: string + price: + $ref: '#/components/schemas/Plan_available_in_inner_price' + type: object + Plan_specs: + properties: + cpus: + items: + $ref: '#/components/schemas/Plan_specs_cpus_inner' + type: array + drives: + items: + $ref: '#/components/schemas/Plan_specs_drives_inner' + type: array + features: + $ref: '#/components/schemas/Plan_specs_features' + href: + format: uri + type: string + memory: + $ref: '#/components/schemas/Plan_specs_memory' + nics: + items: + $ref: '#/components/schemas/Plan_specs_nics_inner' + type: array + type: object + Plan_specs_cpus_inner: + properties: + count: + type: integer + href: + format: uri + type: string + type: + type: string + type: object + Plan_specs_drives_inner: + properties: + category: + description: Values may include 'boot', 'cache', 'storage' + type: string + count: + type: integer + href: + format: uri + type: string + size: + example: 3.84TB + type: string + type: + description: Values may include 'HDD', 'SSD', 'NVME' + type: string + type: object + Plan_specs_features: + properties: + href: + format: uri + type: string + raid: + type: boolean + txt: + type: boolean + uefi: + type: boolean + type: object + Plan_specs_memory: + properties: + href: + format: uri + type: string + total: + type: string + type: object + Plan_specs_nics_inner: + properties: + count: + example: 2 + type: integer + href: + format: uri + type: string + type: + description: Values may include '1Gbps', '10Gbps', '25Gbps' + type: string + type: object + Port: + description: Port is a hardware port associated with a reserved or instantiated + hardware device. + properties: + bond: + $ref: '#/components/schemas/BondPortData' + data: + $ref: '#/components/schemas/PortData' + disbond_operation_supported: + description: Indicates whether or not the bond can be broken on the port + (when applicable). + type: boolean + href: + type: string + id: + format: uuid + type: string + name: + example: bond0 + type: string + native_virtual_network: + $ref: '#/components/schemas/VirtualNetwork' + network_type: + description: Composite network type of the bond + enum: + - layer2-bonded + - layer2-individual + - layer3 + - hybrid + - hybrid-bonded + type: string + type: + description: Type is either "NetworkBondPort" for bond ports or "NetworkPort" + for bondable ethernet ports + enum: + - NetworkPort + - NetworkBondPort + type: string + virtual_networks: + items: + $ref: '#/components/schemas/VirtualNetwork' + type: array + type: object + PortAssignInput: + properties: + href: + format: uri + type: string + vnid: + description: 'Virtual Network ID. May be the UUID of the Virtual Network + record, or the VLAN value itself. + + ' + example: '1001' + type: string + type: object + PortConvertLayer3Input: + properties: + href: + format: uri + type: string + request_ips: + items: + $ref: '#/components/schemas/PortConvertLayer3Input_request_ips_inner' + type: array + type: object + PortConvertLayer3Input_request_ips_inner: + properties: + address_family: + type: integer + href: + format: uri + type: string + public: + type: boolean + type: object + PortData: + properties: + bonded: + description: Bonded is true for NetworkPort ports in a bond and NetworkBondPort + ports that are active + type: boolean + href: + format: uri + type: string + mac: + description: MAC address is set for NetworkPort ports + type: string + type: object + PortVlanAssignment: + properties: + created_at: + format: date-time + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + native: + type: boolean + port: + $ref: '#/components/schemas/Href' + state: + enum: + - assigned + - unassigning + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: '#/components/schemas/Href' + vlan: + type: integer + type: object + PortVlanAssignmentBatch: + properties: + created_at: + format: date-time + type: string + error_messages: + items: + type: string + type: array + href: + format: uri + type: string + id: + format: uuid + type: string + port: + $ref: '#/components/schemas/Port' + project: + $ref: '#/components/schemas/Href' + quantity: + type: integer + state: + enum: + - queued + - in_progress + - completed + - failed + type: string + updated_at: + format: date-time + type: string + vlan_assignments: + items: + $ref: '#/components/schemas/PortVlanAssignmentBatch_vlan_assignments_inner' + type: array + type: object + PortVlanAssignmentBatchCreateInput: + properties: + href: + format: uri + type: string + vlan_assignments: + items: + $ref: '#/components/schemas/PortVlanAssignmentBatchCreateInput_vlan_assignments_inner' + type: array + type: object + PortVlanAssignmentBatchCreateInput_vlan_assignments_inner: + properties: + href: + format: uri + type: string + native: + type: boolean + state: + enum: + - assigned + - unassigned + type: string + vlan: + type: string + type: object + PortVlanAssignmentBatchList: + properties: + batches: + items: + $ref: '#/components/schemas/PortVlanAssignmentBatch' + type: array + href: + format: uri + type: string + type: object + PortVlanAssignmentBatch_vlan_assignments_inner: + properties: + href: + format: uri + type: string + id: + format: uuid + type: string + native: + type: boolean + state: + enum: + - assigned + - unassigned + type: string + vlan: + type: integer + type: object + PortVlanAssignmentList: + properties: + href: + format: uri + type: string + vlan_assignments: + items: + $ref: '#/components/schemas/PortVlanAssignment' + type: array + type: object + Project: + properties: + backend_transfer_enabled: + type: boolean + bgp_config: + $ref: '#/components/schemas/Href' + created_at: + format: date-time + type: string + customdata: + type: object + devices: + items: + $ref: '#/components/schemas/Href' + type: array + href: + type: string + id: + format: uuid + type: string + invitations: + items: + $ref: '#/components/schemas/Href' + type: array + max_devices: + type: object + members: + items: + $ref: '#/components/schemas/Href' + type: array + memberships: + items: + $ref: '#/components/schemas/Href' + type: array + name: + description: The name of the project. Cannot contain characters encoded + in greater than 3 bytes such as emojis. + maxLength: 80 + minLength: 1 + type: string + network_status: + type: object + organization: + $ref: '#/components/schemas/Href' + payment_method: + $ref: '#/components/schemas/Href' + ssh_keys: + items: + $ref: '#/components/schemas/Href' + type: array + tags: + items: + type: string + type: array + type: + description: The type of the project. Projects of type `vmce` are part of + an in development feature and not available to all customers. + enum: + - default + - vmce + type: string + updated_at: + format: date-time + type: string + url: + type: string + volumes: + items: + $ref: '#/components/schemas/Href' + type: array + type: object + ProjectCreateFromRootInput: + properties: + customdata: + type: object + href: + format: uri + type: string + name: + description: The name of the project. Cannot contain characters encoded + in greater than 3 bytes such as emojis. + maxLength: 80 + minLength: 1 + type: string + organization_id: + format: uuid + type: string + payment_method_id: + format: uuid + type: string + tags: + items: + type: string + type: array + type: + description: The type of the project. If no type is specified the project + type will automatically be `default` Projects of type 'vmce' are part + of an in development feature and not available to all customers. + enum: + - default + - vmce + type: string + required: + - name + type: object + ProjectCreateInput: + properties: + customdata: + type: object + href: + format: uri + type: string + name: + description: The name of the project. Cannot contain characters encoded + in greater than 3 bytes such as emojis. + maxLength: 80 + minLength: 1 + type: string + payment_method_id: + format: uuid + type: string + tags: + items: + type: string + type: array + type: + description: The type of the project. If no type is specified the project + type will automatically be `default` Projects of type 'vmce' are part + of an in development feature and not available to all customers. + enum: + - default + - vmce + type: string + required: + - name + type: object + ProjectIdName: + properties: + href: + format: uri + type: string + id: + format: uuid + type: string + name: + type: string + type: object + ProjectList: + properties: + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + projects: + items: + $ref: '#/components/schemas/Project' + type: array + type: object + ProjectUpdateInput: + properties: + backend_transfer_enabled: + type: boolean + customdata: + type: object + href: + format: uri + type: string + name: + description: The name of the project. Cannot contain characters encoded + in greater than 3 bytes such as emojis. + maxLength: 80 + minLength: 1 + type: string + payment_method_id: + format: uuid + type: string + tags: + items: + type: string + type: array + type: object + ProjectUsage: + properties: + facility: + type: string + href: + format: uri + type: string + name: + type: string + plan: + type: string + plan_version: + type: string + price: + type: string + quantity: + type: string + total: + type: string + type: + type: string + unit: + type: string + type: object + ProjectUsageList: + properties: + href: + format: uri + type: string + usages: + items: + $ref: '#/components/schemas/ProjectUsage' + type: array + type: object + Raid: + properties: + devices: + items: + type: string + type: array + href: + format: uri + type: string + level: + type: string + name: + type: string + type: object + RecoveryCodeList: + properties: + href: + format: uri + type: string + recovery_codes: + items: + type: string + type: array + type: object + SSHKey: + properties: + created_at: + format: date-time + type: string + entity: + $ref: '#/components/schemas/Href' + fingerprint: + type: string + href: + type: string + id: + format: uuid + type: string + key: + type: string + label: + type: string + tags: + items: + type: string + type: array + updated_at: + format: date-time + type: string + type: object + SSHKeyCreateInput: + properties: + href: + format: uri + type: string + instances_ids: + description: "List of instance UUIDs to associate SSH key with, when empty\ + \ array is sent all instances belonging\n to entity will be included" + items: + format: uuid + type: string + type: array + key: + type: string + label: + type: string + tags: + items: + type: string + type: array + type: object + SSHKeyInput: + properties: + href: + format: uri + type: string + key: + type: string + label: + type: string + tags: + items: + type: string + type: array + type: object + SSHKeyList: + properties: + href: + format: uri + type: string + ssh_keys: + items: + $ref: '#/components/schemas/SSHKey' + type: array + type: object + SelfServiceReservationItemRequest: + properties: + href: + format: uri + type: string + metro_id: + description: Metro ID of the item. + format: uuid + type: string + plan_id: + description: Plan ID of the item. + format: uuid + type: string + quantity: + description: Number of items. + type: integer + term: + description: Contract term of the item. + type: string + type: object + SelfServiceReservationItemResponse: + properties: + amount: + format: float + type: number + href: + format: uri + type: string + id: + type: string + metro_code: + type: string + metro_id: + format: uuid + type: string + metro_name: + type: string + plan: + $ref: '#/components/schemas/Plan' + plan_categories: + items: + type: string + type: array + x-deprecated: true + plan_id: + format: uuid + type: string + x-deprecated: true + plan_name: + type: string + x-deprecated: true + plan_slug: + type: string + x-deprecated: true + quantity: + type: integer + term: + type: string + type: object + SelfServiceReservationList: + properties: + href: + format: uri + type: string + reservations: + items: + $ref: '#/components/schemas/SelfServiceReservationResponse' + type: array + type: object + SelfServiceReservationResponse: + properties: + created_at: + format: date-time + type: string + href: + format: uri + type: string + item: + items: + $ref: '#/components/schemas/SelfServiceReservationItemResponse' + type: array + notes: + type: string + organization: + type: string + organization_id: + format: uuid + type: string + period: + $ref: '#/components/schemas/CreateSelfServiceReservationRequest_period' + project: + type: string + project_id: + format: uuid + type: string + start_date: + format: date-time + type: string + status: + type: string + total_cost: + type: integer + type: object + ServerInfo: + properties: + facility: + deprecated: true + type: string + href: + format: uri + type: string + metro: + description: The metro ID or code to check the capacity in. + type: string + plan: + description: The plan ID or slug to check the capacity of. + type: string + quantity: + description: The number of servers to check the capacity of. + type: string + type: object + SharedPortVCVlanCreateInput: + properties: + contact_email: + description: The preferred email used for communication and notifications + about the Equinix Fabric interconnection. Optional and defaults to the + primary user email address when using a User API key or the organization + owner email address when using a Project API key. + format: email + type: string + description: + type: string + href: + format: uri + type: string + metro: + description: A Metro ID or code. When creating 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), or shared connections, 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. + type: string + name: + type: string + project: + type: string + speed: + description: 'A interconnection speed, in bps, mbps, or gbps. For Fabric + VCs, this represents the maximum speed of the interconnection. For Fabric + VCs (Metal Billed), this can only be one of the following: + + ''''50mbps'''', ''''200mbps'''', ''''500mbps'''', ''''1gbps'''', ''''2gbps'''', + ''''5gbps'''' or ''''10gbps'''', and is required for creation. For Fabric + VCs (Fabric Billed), this field will always default to ''''10gbps'''' + even if it is not provided. + + For example, ''''500000000'''', ''''50m'''', or'' ''''500mbps'''' will + all work as valid inputs.' + example: '10000000000' + type: string + tags: + items: + type: string + type: array + type: + enum: + - shared_port_vlan + type: string + vlans: + description: A list of one or two metro-based VLANs that will be set on + the virtual circuits of primary and/or secondary interconnections respectively + when creating Fabric VCs. VLANs can also be set after the interconnection + is created, but are required to fully activate the virtual circuits. + example: + - 1000 + - 1001 + items: + type: integer + type: array + required: + - metro + - name + - project + - type + - vlans + type: object + SpotMarketPricesList: + properties: + href: + format: uri + type: string + spot_market_prices: + $ref: '#/components/schemas/SpotPricesReport' + type: object + SpotMarketPricesPerMetroList: + properties: + href: + format: uri + type: string + spot_market_prices: + $ref: '#/components/schemas/SpotMarketPricesPerMetroReport' + type: object + SpotMarketPricesPerMetroReport: + properties: + am: + $ref: '#/components/schemas/SpotPricesPerFacility' + ch: + $ref: '#/components/schemas/SpotPricesPerFacility' + da: + $ref: '#/components/schemas/SpotPricesPerFacility' + href: + format: uri + type: string + la: + $ref: '#/components/schemas/SpotPricesPerFacility' + ny: + $ref: '#/components/schemas/SpotPricesPerFacility' + sg: + $ref: '#/components/schemas/SpotPricesPerFacility' + sv: + $ref: '#/components/schemas/SpotPricesPerFacility' + type: object + SpotMarketRequest: + properties: + created_at: + format: date-time + type: string + devices_max: + type: integer + devices_min: + type: integer + end_at: + format: date-time + type: string + facilities: + $ref: '#/components/schemas/Href' + href: + type: string + id: + format: uuid + type: string + instances: + $ref: '#/components/schemas/Href' + max_bid_price: + format: float + type: number + metro: + $ref: '#/components/schemas/SpotMarketRequest_metro' + project: + $ref: '#/components/schemas/Href' + type: object + SpotMarketRequestCreateInput: + properties: + devices_max: + type: integer + devices_min: + type: integer + end_at: + format: date-time + type: string + facilities: + deprecated: true + items: + format: uuid + type: string + type: array + href: + format: uri + type: string + instance_parameters: + $ref: '#/components/schemas/SpotMarketRequestCreateInput_instance_parameters' + max_bid_price: + format: float + type: number + metro: + description: The metro ID or code the spot market request will be created + in. + type: string + type: object + SpotMarketRequestCreateInput_instance_parameters: + properties: + always_pxe: + type: boolean + billing_cycle: + type: string + customdata: + type: object + description: + type: string + features: + items: + type: string + type: array + hostname: + type: string + hostnames: + items: + type: string + type: array + href: + format: uri + type: string + locked: + description: Whether the device should be locked, preventing accidental + deletion. + type: boolean + no_ssh_keys: + type: boolean + operating_system: + type: string + plan: + type: string + private_ipv4_subnet_size: + type: integer + project_ssh_keys: + items: + format: uuid + type: string + type: array + public_ipv4_subnet_size: + type: integer + tags: + items: + type: string + type: array + termination_time: + format: date-time + type: string + user_ssh_keys: + description: The UUIDs of users whose SSH keys should be included on the + provisioned device. + items: + format: uuid + type: string + type: array + userdata: + type: string + type: object + SpotMarketRequestList: + properties: + href: + format: uri + type: string + spot_market_requests: + items: + $ref: '#/components/schemas/SpotMarketRequest' + type: array + type: object + SpotMarketRequest_metro: + allOf: + - $ref: '#/components/schemas/Metro' + - description: The metro the spot market request was created in + type: object + SpotPricesDatapoints: + properties: + datapoints: + items: + $ref: '#/components/schemas/SpotPricesDatapointsList' + type: array + href: + format: uri + type: string + type: object + SpotPricesDatapointsList: + items: + type: number + type: array + SpotPricesHistoryReport: + properties: + href: + format: uri + type: string + prices_history: + $ref: '#/components/schemas/SpotPricesDatapoints' + type: object + SpotPricesPerBaremetal: + properties: + href: + format: uri + type: string + price: + format: float + type: number + type: object + SpotPricesPerFacility: + properties: + baremetal_0: + $ref: '#/components/schemas/SpotPricesPerBaremetal' + baremetal_1: + $ref: '#/components/schemas/SpotPricesPerBaremetal' + baremetal_2: + $ref: '#/components/schemas/SpotPricesPerBaremetal' + baremetal_2a: + $ref: '#/components/schemas/SpotPricesPerBaremetal' + baremetal_2a2: + $ref: '#/components/schemas/SpotPricesPerBaremetal' + baremetal_3: + $ref: '#/components/schemas/SpotPricesPerBaremetal' + baremetal_s: + $ref: '#/components/schemas/SpotPricesPerBaremetal' + c2.medium.x86: + $ref: '#/components/schemas/SpotPricesPerBaremetal' + href: + format: uri + type: string + m2.xlarge.x86: + $ref: '#/components/schemas/SpotPricesPerBaremetal' + type: object + SpotPricesPerNewFacility: + properties: + baremetal_1e: + $ref: '#/components/schemas/SpotPricesPerBaremetal' + href: + format: uri + type: string + type: object + SpotPricesReport: + properties: + ams1: + $ref: '#/components/schemas/SpotPricesPerFacility' + atl1: + $ref: '#/components/schemas/SpotPricesPerNewFacility' + dfw1: + $ref: '#/components/schemas/SpotPricesPerNewFacility' + ewr1: + $ref: '#/components/schemas/SpotPricesPerFacility' + fra1: + $ref: '#/components/schemas/SpotPricesPerNewFacility' + href: + format: uri + type: string + iad1: + $ref: '#/components/schemas/SpotPricesPerNewFacility' + lax1: + $ref: '#/components/schemas/SpotPricesPerNewFacility' + nrt1: + $ref: '#/components/schemas/SpotPricesPerFacility' + ord1: + $ref: '#/components/schemas/SpotPricesPerNewFacility' + sea1: + $ref: '#/components/schemas/SpotPricesPerNewFacility' + sin1: + $ref: '#/components/schemas/SpotPricesPerNewFacility' + sjc1: + $ref: '#/components/schemas/SpotPricesPerFacility' + syd1: + $ref: '#/components/schemas/SpotPricesPerNewFacility' + yyz1: + $ref: '#/components/schemas/SpotPricesPerNewFacility' + type: object + Storage: + properties: + disks: + items: + $ref: '#/components/schemas/Disk' + type: array + filesystems: + items: + $ref: '#/components/schemas/Filesystem' + type: array + href: + format: uri + type: string + raid: + items: + $ref: '#/components/schemas/Raid' + type: array + type: object + SupportRequestInput: + properties: + device_id: + type: string + href: + format: uri + type: string + message: + type: string + priority: + enum: + - urgent + - high + - medium + - low + type: string + project_id: + type: string + subject: + type: string + required: + - message + - subject + type: object + TransferRequest: + properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + project: + $ref: '#/components/schemas/Href' + target_organization: + $ref: '#/components/schemas/Href' + updated_at: + format: date-time + type: string + type: object + TransferRequestInput: + properties: + href: + format: uri + type: string + target_organization_id: + format: uuid + type: string + type: object + TransferRequestList: + properties: + href: + format: uri + type: string + transfers: + items: + $ref: '#/components/schemas/TransferRequest' + type: array + type: object + UpdateEmailInput: + properties: + default: + type: boolean + href: + format: uri + type: string + type: object + User: + properties: + avatar_thumb_url: + type: string + avatar_url: + type: string + created_at: + format: date-time + type: string + customdata: + type: object + default_organization_id: + format: uuid + type: string + default_project_id: + format: uuid + type: string + email: + type: string + emails: + items: + $ref: '#/components/schemas/Href' + type: array + first_name: + type: string + fraud_score: + type: string + full_name: + type: string + href: + type: string + id: + format: uuid + type: string + last_login_at: + format: date-time + type: string + last_name: + type: string + max_organizations: + type: integer + max_projects: + type: integer + phone_number: + type: string + short_id: + type: string + timezone: + type: string + two_factor_auth: + type: string + updated_at: + format: date-time + type: string + type: object + UserCreateInput: + properties: + company_name: + type: string + company_url: + type: string + customdata: + type: object + emails: + items: + $ref: '#/components/schemas/EmailInput' + type: array + first_name: + type: string + href: + format: uri + type: string + invitation_id: + format: uuid + type: string + last_name: + type: string + level: + type: string + nonce: + type: string + password: + type: string + phone_number: + type: string + social_accounts: + type: object + timezone: + type: string + title: + type: string + two_factor_auth: + type: string + verified_at: + format: date-time + type: string + required: + - emails + - first_name + - last_name + type: object + UserLimited: + properties: + avatar_thumb_url: + description: Avatar thumbnail URL of the User + type: string + avatar_url: + description: Avatar URL of the User + type: string + full_name: + description: Full name of the User + type: string + href: + description: API URL uniquely representing the User + type: string + id: + description: ID of the User + format: uuid + type: string + required: + - id + type: object + UserList: + properties: + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + users: + items: + $ref: '#/components/schemas/User' + type: array + type: object + UserLite: + properties: + avatar_thumb_url: + description: Avatar thumbnail URL of the User + type: string + created_at: + description: When the user was created + format: date-time + type: string + email: + description: Primary email address of the User + type: string + first_name: + description: First name of the User + type: string + full_name: + description: Full name of the User + type: string + href: + description: API URL uniquely representing the User + type: string + id: + description: ID of the User + format: uuid + type: string + last_name: + description: Last name of the User + type: string + short_id: + description: Short ID of the User + type: string + updated_at: + description: When the user details were last updated + format: date-time + type: string + required: + - id + - short_id + type: object + UserUpdateInput: + properties: + customdata: + type: object + first_name: + type: string + href: + format: uri + type: string + last_name: + type: string + password: + type: string + phone_number: + type: string + timezone: + type: string + type: object + Userdata: + properties: + href: + format: uri + type: string + userdata: + type: string + type: object + VerifyEmail: + properties: + href: + format: uri + type: string + user_token: + description: User verification token + type: string + writeOnly: true + required: + - user_token + type: object + VirtualCircuit: + oneOf: + - $ref: '#/components/schemas/VlanVirtualCircuit' + - $ref: '#/components/schemas/VrfVirtualCircuit' + VirtualCircuitCreateInput: + oneOf: + - $ref: '#/components/schemas/VlanVirtualCircuitCreateInput' + - $ref: '#/components/schemas/VrfVirtualCircuitCreateInput' + VirtualCircuitList: + properties: + href: + format: uri + type: string + virtual_circuits: + items: + $ref: '#/components/schemas/VirtualCircuit' + type: array + type: object + VirtualCircuitUpdateInput: + oneOf: + - $ref: '#/components/schemas/VlanVirtualCircuitUpdateInput' + - $ref: '#/components/schemas/VrfVirtualCircuitUpdateInput' + VirtualNetwork: + properties: + assigned_to: + $ref: '#/components/schemas/Project' + assigned_to_virtual_circuit: + description: True if the virtual network is attached to a virtual circuit. + False if not. + type: boolean + created_at: + format: date-time + type: string + description: + type: string + facility: + $ref: '#/components/schemas/Href' + href: + type: string + id: + format: uuid + type: string + instances: + description: A list of instances with ports currently associated to this + Virtual Network. + items: + $ref: '#/components/schemas/Device' + type: array + metal_gateways: + description: A list of metal gateways currently associated to this Virtual + Network. + items: + $ref: '#/components/schemas/MetalGatewayLite' + type: array + metro: + $ref: '#/components/schemas/Metro' + metro_code: + description: The Metro code of the metro in which this Virtual Network is + defined. + type: string + tags: + items: + type: string + type: array + vxlan: + type: integer + type: object + VirtualNetworkCreateInput: + properties: + description: + type: string + facility: + deprecated: true + description: The UUID (or facility code) for the Facility in which to create + this Virtual network. + type: string + href: + format: uri + type: string + metro: + description: The UUID (or metro code) for the Metro in which to create this + Virtual Network. + type: string + tags: + items: + type: string + type: array + vxlan: + description: VLAN ID between 2-3999. Must be unique for the project within + the Metro in which this Virtual Network is being created. If no value + is specified, the next-available VLAN ID in the range 1000-1999 will be + automatically selected. + example: 1099 + type: integer + type: object + VirtualNetworkList: + properties: + href: + format: uri + type: string + virtual_networks: + items: + $ref: '#/components/schemas/VirtualNetwork' + type: array + type: object + VirtualNetworkUpdateInput: + properties: + description: + type: string + href: + format: uri + type: string + tags: + items: + type: string + type: array + type: object + VlanCSPConnectionCreateInput: + properties: + contact_email: + description: The preferred email used for communication and notifications + about the Equinix Fabric interconnection. Optional and defaults to the + primary user email address when using a User API key or the organization + owner email address when using a Project API key. + format: email + type: string + description: + type: string + fabric_provider: + $ref: '#/components/schemas/VlanCSPConnectionCreateInput_fabric_provider' + href: + format: uri + type: string + metro: + description: A Metro ID or code. When creating 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), or shared connections, 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. + type: string + name: + type: string + project: + type: string + speed: + description: 'A interconnection speed, in bps, mbps, or gbps. For Fabric + VCs, this represents the maximum speed of the interconnection. For Fabric + VCs (Metal Billed), this can only be one of the following: + + ''''50mbps'''', ''''200mbps'''', ''''500mbps'''', ''''1gbps'''', ''''2gbps'''', + ''''5gbps'''' or ''''10gbps'''', and is required for creation. For Fabric + VCs (Fabric Billed), this field will always default to ''''10gbps'''' + even if it is not provided. + + For example, ''''500000000'''', ''''50m'''', or'' ''''500mbps'''' will + all work as valid inputs.' + example: '10000000000' + type: string + tags: + items: + type: string + type: array + type: + enum: + - shared_port_vlan_to_csp + type: string + vlans: + description: A list of one or two metro-based VLANs that will be set on + the virtual circuits of primary and/or secondary interconnections respectively + when creating Fabric VCs. VLANs can also be set after the interconnection + is created, but are required to fully activate the virtual circuits. + example: + - 1000 + - 1001 + items: + type: integer + type: array + required: + - fabric_provider + - metro + - name + - project + - type + - vlans + type: object + VlanCSPConnectionCreateInput_fabric_provider: + description: Configuration information for connecting to external cloud service + provider. + oneOf: + - $ref: '#/components/schemas/AWSFabricProvider' + VlanFabricVcCreateInput: + properties: + contact_email: + description: The preferred email used for communication and notifications + about the Equinix Fabric interconnection. Optional and defaults to the + primary user email address when using a User API key or the organization + owner email address when using a Project API key. + format: email + type: string + description: + type: string + facility_id: + type: string + x-deprecated: true + href: + format: uri + type: string + metro: + description: A Metro ID or code. When creating 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), or shared connections, 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. + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + service_token_type: + description: Either 'a_side' or 'z_side'. Setting this field to 'a_side' + will create an interconnection with Fabric VCs (Metal Billed). Setting + this field to 'z_side' will create an interconnection with Fabric VCs + (Fabric Billed). This is required when the 'type' is 'shared', but this + is not applicable when the 'type' is 'dedicated'. This parameter is included + in the specification as a developer preview and is generally unavailable. + Please contact our Support team for more details. + enum: + - a_side + - z_side + example: a_side + type: string + speed: + description: "A interconnection speed, in bps, mbps, or gbps. For Fabric\ + \ VCs, this represents the maximum speed of the interconnection. For Fabric\ + \ VCs (Metal Billed), this can only be one of the following: \n''50mbps'',\ + \ ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'',\ + \ and is required for creation. For Fabric VCs (Fabric Billed), this field\ + \ will always default to ''10gbps'' even if it is not provided.\nFor example,\ + \ ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs." + example: '10000000000' + type: string + tags: + items: + type: string + type: array + type: + description: When requesting for a Fabric VC, the value of this field should + be 'shared'. + enum: + - shared + type: string + vlans: + description: A list of one or two metro-based VLANs that will be set on + the virtual circuits of primary and/or secondary (if redundant) interconnections + respectively when creating Fabric VCs. VLANs can also be set after the + interconnection is created, but are required to fully activate the virtual + circuits. + example: + - 1000 + - 1001 + items: + type: integer + type: array + required: + - metro + - name + - redundancy + - service_token_type + - type + - vlans + type: object + VlanVirtualCircuit: + properties: + bill: + default: false + description: True if the Virtual Circuit is being billed. Currently, only + Virtual Circuits of Fabric VCs (Metal Billed) will be billed. Usage will + start the first time the Virtual Circuit becomes active, and will not + stop until it is deleted from Metal. + type: boolean + bill_type: + description: Fabric Billed if the Virtual Circuit is billed by Fabric. Metal + Billed if the Virtual Circuit is billed by Metal. Legacy Virtual Circuits + will have a value of nil. + enum: + - metal_billed + - fabric_billed + nullable: true + type: string + created_at: + format: date-time + type: string + description: + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + name: + type: string + nni_vlan: + type: integer + port: + $ref: '#/components/schemas/InterconnectionPort' + project: + $ref: '#/components/schemas/Project' + provider_connection_id: + description: This field is relevant if using the `shared_port_vlan_to_csp` + interconnection type. Once activated on the CSP, this field should contain + the resource name that the virtual circuit is connected to on the provider's + end. + example: dxcon-fggxx63k + type: string + speed: + description: For Virtual Circuits on shared and dedicated connections, this + speed should match the one set on their Interconnection Ports. For Virtual + Circuits on Fabric VCs (both Metal and Fabric Billed) that have found + their corresponding Fabric connection, this is the actual speed of the + interconnection that was configured when setting up the interconnection + on the Fabric Portal. Details on Fabric VCs are included in the specification + as a developer preview and is generally unavailable. Please contact our + Support team for more details. + format: int64 + type: integer + status: + description: The status of a Virtual Circuit is always 'pending' on creation. + The status can turn to 'Waiting on Customer VLAN' if a Metro VLAN was + not set yet on the Virtual Circuit and is the last step needed for full + activation. For Dedicated interconnections, as long as the Dedicated Port + has been associated to the Virtual Circuit and a NNI VNID has been set, + it will turn to 'waiting_on_customer_vlan'. For Fabric VCs, it will only + change to 'waiting_on_customer_vlan' once the corresponding Fabric connection + has been found on the Fabric side. If the Fabric service token associated + with the Virtual Circuit hasn't been redeemed on Fabric within the expiry + time, it will change to an `expired` status. Once a Metro VLAN is set + on the Virtual Circuit (which for Fabric VCs, can be set on creation of + a Fabric VC) and the necessary set up is done, it will turn into 'Activating' + status as it tries to activate the Virtual Circuit. Once the Virtual Circuit + fully activates and is configured on the switch, it will turn to staus + 'active'. For Fabric VCs (Metal Billed), we will start billing the moment + the status of the Virtual Circuit turns to 'active'. If there are any + changes to the VLAN after the Virtual Circuit is in an 'active' status, + the status will show 'changing_vlan' if a new VLAN has been provided, + or 'deactivating' if we are removing the VLAN. When a deletion request + is issued for the Virtual Circuit, it will move to a 'deleting' status, + and we will immediately unconfigure the switch for the Virtual Circuit + and issue a deletion on any associated Fabric connections. Any associated + Metro VLANs on the virtual circuit will also be unassociated after the + switch has been successfully unconfigured. If there are any associated + Fabric connections, we will only fully delete the Virtual Circuit once + we have checked that the Fabric connection was fully deprovisioned on + Fabric. + enum: + - pending + - waiting_on_customer_vlan + - activating + - changing_vlan + - deactivating + - deleting + - active + - expired + - activation_failed + - changing_vlan_failed + - deactivation_failed + - delete_failed + - configure_fabric_routing_protocols + type: string + tags: + items: + type: string + type: array + type: + enum: + - vlan + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: '#/components/schemas/Href' + vnid: + type: integer + type: object + VlanVirtualCircuitCreateInput: + properties: + description: + type: string + href: + format: uri + type: string + name: + type: string + nni_vlan: + maximum: 4094 + minimum: 2 + type: integer + project_id: + format: uuid + type: string + speed: + description: speed can be passed as integer number representing bps speed + or string (e.g. '52m' or '100g' or '4 gbps') + type: string + tags: + items: + type: string + type: array + vnid: + description: A Virtual Network record UUID or the VNID of a Metro Virtual + Network in your project (sent as integer). + format: uuid + type: string + required: + - project_id + type: object + VlanVirtualCircuitUpdateInput: + properties: + description: + type: string + href: + format: uri + type: string + name: + type: string + speed: + description: Speed can be changed only if it is an interconnection on a + Dedicated Port + type: string + tags: + items: + type: string + type: array + vnid: + description: A Virtual Network record UUID or the VNID of a Metro Virtual + Network in your project. + type: string + type: object + Vrf: + properties: + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + bill: + default: false + description: True if the VRF is being billed. Usage will start when the + first VRF Virtual Circuit is active, and will only stop when the VRF has + been deleted. + type: boolean + created_at: + format: date-time + type: string + created_by: + $ref: '#/components/schemas/User' + description: + description: Optional field that can be set to describe the VRF + type: string + href: + type: string + id: + format: uuid + type: string + ip_ranges: + description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/59"]. + items: + type: string + type: array + local_asn: + description: A 4-byte ASN associated with the VRF. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + metro: + $ref: '#/components/schemas/Metro' + name: + type: string + project: + $ref: '#/components/schemas/Project' + tags: + items: + type: string + type: array + updated_at: + format: date-time + type: string + virtual_circuits: + description: Virtual circuits that are in the VRF + items: + $ref: '#/components/schemas/VrfVirtualCircuit' + type: array + type: object + VrfBGPNeighbors: + properties: + href: + format: uri + type: string + peer_as: + description: The ASN of the peer that advertised the prefix. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + peer_ip: + example: 8.8.8.8 + type: string + state: + description: The current status of the connection to the BGP peer. State + is either up or down. + example: up + type: string + type: object + VrfBGPNeighborsList: + properties: + bgp_neighbors: + items: + $ref: '#/components/schemas/VrfBGPNeighbors' + type: array + href: + format: uri + type: string + type: object + VrfCreateInput: + properties: + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + description: + type: string + href: + format: uri + type: string + ip_ranges: + description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/59"]. + IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between + /59 and /64. A VRF\'s IP ranges must be defined in order to create VRF + IP Reservations, which can then be used for Metal Gateways or Virtual + Circuits. + items: + type: string + type: array + local_asn: + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + metro: + description: The UUID (or metro code) for the Metro in which to create this + VRF. + type: string + name: + type: string + tags: + items: + type: string + type: array + required: + - metro + - name + type: object + VrfFabricVcCreateInput: + properties: + contact_email: + description: The preferred email used for communication and notifications + about the Equinix Fabric interconnection. Optional and defaults to the + primary user email address when using a User API key or the organization + owner email address when using a Project API key. + format: email + type: string + description: + type: string + facility_id: + type: string + x-deprecated: true + href: + format: uri + type: string + metro: + description: A Metro ID or code. When creating 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), or shared connections, 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. + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + service_token_type: + description: Either 'a_side' or 'z_side'. Setting this field to 'a_side' + will create an interconnection with Fabric VCs (Metal Billed). Setting + this field to 'z_side' will create an interconnection with Fabric VCs + (Fabric Billed). This is required when the 'type' is 'shared', but this + is not applicable when the 'type' is 'dedicated'. This parameter is included + in the specification as a developer preview and is generally unavailable. + Please contact our Support team for more details. + enum: + - a_side + - z_side + example: a_side + type: string + speed: + description: "A interconnection speed, in bps, mbps, or gbps. For Fabric\ + \ VCs, this represents the maximum speed of the interconnection. For Fabric\ + \ VCs (Metal Billed), this can only be one of the following: \n''50mbps'',\ + \ ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'',\ + \ and is required for creation. For Fabric VCs (Fabric Billed), this field\ + \ will always default to ''10gbps'' even if it is not provided.\nFor example,\ + \ ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs." + example: '10000000000' + type: string + tags: + items: + type: string + type: array + type: + description: When requesting for a Fabric VC, the value of this field should + be 'shared'. + enum: + - shared + type: string + vrfs: + description: This field holds a list of VRF UUIDs that will be set automatically + on the virtual circuits of Fabric VCs on creation, and can hold up to + two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. + The first UUID will be set on the primary virtual circuit, while the second + UUID will be set on the secondary. The two UUIDs can be the same if both + the primary and secondary virtual circuits will be in the same VRF. This + parameter is included in the specification as a developer preview and + is generally unavailable. Please contact our Support team for more details. + items: + format: uuid + type: string + type: array + required: + - metro + - name + - redundancy + - service_token_type + - type + - vrfs + type: object + VrfIpRangeCreateInput: + description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/59"]. + IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between + /59 and /64. A VRF\'s IP ranges must be defined in order to create VRF IP + Reservations, which can then be used for Metal Gateways or Virtual Circuits. + items: + type: string + type: array + VrfIpRangeList: + description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/59"]. + items: + type: string + type: array + VrfIpRangeUpdateInput: + description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/59"]. + IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between + /59 and /64. A VRF\'s IP ranges must be defined in order to create VRF IP + Reservations, which can then be used for Metal Gateways or Virtual Circuits. + Adding a new CIDR address to the list will result in the creation of a new + IP Range for this VRF. Removal of an existing CIDR address from the list will + result in the deletion of an existing IP Range for this VRF. Deleting an IP + Range will result in the deletion of any VRF IP Reservations contained within + the IP Range, as well as the VRF IP Reservation\'s associated Metal Gateways + or Virtual Circuits. If you do not wish to add or remove IP Ranges, either + include the full existing list of IP Ranges in the update request, or do not + specify the `ip_ranges` field in the update request. Specifying a value of + `[]` will remove all existing IP Ranges from the VRF. + items: + type: string + type: array + VrfIpReservation: + properties: + address: + type: string + address_family: + type: integer + bill: + type: boolean + cidr: + type: integer + created_at: + format: date-time + type: string + created_by: + $ref: '#/components/schemas/Href' + customdata: + type: object + details: + type: string + gateway: + type: string + href: + type: string + id: + format: uuid + type: string + manageable: + type: boolean + management: + type: boolean + metal_gateway: + $ref: '#/components/schemas/MetalGatewayLite' + metro: + $ref: '#/components/schemas/Metro' + netmask: + type: string + network: + type: string + project: + $ref: '#/components/schemas/Project' + project_lite: + $ref: '#/components/schemas/Project' + public: + type: boolean + state: + type: string + tags: + items: + type: string + type: array + type: + enum: + - vrf + type: string + vrf: + $ref: '#/components/schemas/Vrf' + required: + - type + - vrf + type: object + VrfIpReservationCreateInput: + properties: + cidr: + description: 'The size of the VRF IP Reservation''s subnet. The following + subnet sizes are supported: + + - IPv4: between 22 - 29 inclusive + + - IPv6: exactly 64 + + ' + example: 22 + type: integer + customdata: + type: object + details: + type: string + href: + format: uri + type: string + network: + description: The starting address for this VRF IP Reservation's subnet. + Both IPv4 and IPv6 are supported. + example: 10.1.2.0 + type: string + tags: + items: + type: string + type: array + type: + description: Must be set to 'vrf' + example: vrf + type: string + vrf_id: + description: The ID of the VRF in which this VRF IP Reservation is created. + The VRF must have an existing IP Range that contains the requested subnet. + This field may be aliased as just 'vrf'. + format: uuid + type: string + required: + - cidr + - network + - type + - vrf_id + type: object + VrfIpReservationList: + properties: + href: + format: uri + type: string + ip_addresses: + items: + $ref: '#/components/schemas/VrfIpReservation' + type: array + type: object + VrfLearnedRoutes: + properties: + href: + format: uri + type: string + origin_as: + description: The ASN of the peer that advertised the prefix. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + prefix: + example: 8.8.8.0/24 + type: string + type: object + VrfLearnedRoutesList: + properties: + href: + format: uri + type: string + learned_routes: + items: + $ref: '#/components/schemas/VrfLearnedRoutes' + type: array + type: object + VrfList: + properties: + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + vrfs: + items: + $ref: '#/components/schemas/Vrf' + type: array + type: object + VrfMetalGateway: + properties: + created_at: + format: date-time + type: string + created_by: + $ref: '#/components/schemas/Href' + href: + type: string + id: + format: uuid + type: string + ip_reservation: + $ref: '#/components/schemas/VrfIpReservation' + project: + $ref: '#/components/schemas/Project' + state: + description: The current state of the Metal Gateway. 'Ready' indicates the + gateway record has been configured, but is currently not active on the + network. 'Active' indicates the gateway has been configured on the network. + 'Deleting' is a temporary state used to indicate that the gateway is in + the process of being un-configured from the network, after which the gateway + record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: '#/components/schemas/VirtualNetwork' + vrf: + $ref: '#/components/schemas/Vrf' + type: object + VrfMetalGatewayCreateInput: + properties: + href: + format: uri + type: string + ip_reservation_id: + description: The UUID an a VRF IP Reservation that belongs to the same project + as the one in which the Metal Gateway is to be created. Additionally, + the VRF IP Reservation and the Virtual Network must reside in the same + Metro. + format: uuid + type: string + virtual_network_id: + description: The UUID of a Metro Virtual Network that belongs to the same + project as the one in which the Metal Gateway is to be created. Additionally, + the Virtual Network and the VRF IP Reservation must reside in the same + metro. In the case of the IP reservation being an IPv6 based VRF IP Reservation, + the Virtual Network must not already have an associated IPv6 based VRF + IP Reservation. There can be exactly one IPv6 based VRF IP Reservation + associated to a Virtual Network. + format: uuid + type: string + required: + - ip_reservation_id + - virtual_network_id + type: object + VrfRoute: + properties: + created_at: + format: date-time + readOnly: true + type: string + href: + example: /routes/e1ff9c2b-051a-4688-965f-153e274f77e0 + readOnly: true + type: string + id: + description: The unique identifier for the newly-created resource + example: e1ff9c2b-051a-4688-965f-153e274f77e0 + format: uuid + readOnly: true + type: string + metal_gateway: + $ref: '#/components/schemas/VrfMetalGateway' + next_hop: + description: The next-hop IPv4 address for the route + example: 192.168.1.254 + format: ipv4 + type: string + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation + example: 0.0.0.0/0 + type: string + status: + description: The status of the route. Potential values are "pending", "active", + "deleting", and "error", representing various lifecycle states of the + route and whether or not it has been successfully configured on the network + enum: + - pending + - active + - deleting + - error + example: active + readOnly: true + type: string + tags: + items: + type: string + type: array + type: + description: VRF route type, like 'bgp', 'connected', and 'static'. Currently, + only static routes are supported + enum: + - static + example: static + readOnly: true + type: string + updated_at: + format: date-time + readOnly: true + type: string + virtual_network: + $ref: '#/components/schemas/VirtualNetwork' + vrf: + $ref: '#/components/schemas/Vrf' + type: object + VrfRouteCreateInput: + properties: + href: + format: uri + type: string + next_hop: + description: The IPv4 address within the VRF of the host that will handle + this route + example: 192.168.1.254 + format: ipv4 + type: string + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation. For + a static default route, this will always be "0.0.0.0/0" + example: 0.0.0.0/0 + type: string + tags: + items: + type: string + type: array + required: + - next_hop + - prefix + type: object + VrfRouteList: + properties: + href: + format: uri + type: string + meta: + $ref: '#/components/schemas/Meta' + routes: + items: + $ref: '#/components/schemas/VrfRoute' + type: array + type: object + VrfRouteUpdateInput: + properties: + href: + format: uri + type: string + next_hop: + description: The IPv4 address within the VRF of the host that will handle + this route + example: 192.168.1.254 + format: ipv4 + type: string + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation. For + a static default route, this will always be "0.0.0.0/0" + example: 0.0.0.0/0 + type: string + tags: + items: + type: string + type: array + type: object + VrfUpdateInput: + properties: + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + description: + type: string + href: + format: uri + type: string + ip_ranges: + description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/59"]. + IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between + /59 and /64. A VRF\'s IP ranges must be defined in order to create VRF + IP Reservations, which can then be used for Metal Gateways or Virtual + Circuits. Adding a new CIDR address to the list will result in the creation + of a new IP Range for this VRF. Removal of an existing CIDR address from + the list will result in the deletion of an existing IP Range for this + VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations + contained within the IP Range, as well as the VRF IP Reservation\'s associated + Metal Gateways or Virtual Circuits. If you do not wish to add or remove + IP Ranges, either include the full existing list of IP Ranges in the update + request, or do not specify the `ip_ranges` field in the update request. + Specifying a value of `[]` will remove all existing IP Ranges from the + VRF. + items: + type: string + type: array + local_asn: + description: The new `local_asn` value for the VRF. This field cannot be + updated when there are active Interconnection Virtual Circuits associated + to the VRF, or if any of the VLANs of the VRF's metal gateway has been + assigned on an instance. + format: int32 + type: integer + name: + type: string + tags: + items: + type: string + type: array + type: object + VrfVirtualCircuit: + properties: + created_at: + format: date-time + type: string + customer_ip: + description: An IPv4 address from the subnet that will be used on the Customer + side. This parameter is optional, but if supplied, we will use the other + usable IP address in the subnet as the Metal IP. By default, the last + usable IP address in the subnet will be used. + example: 12.0.0.2 + type: string + customer_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the + Customer side. This parameter is optional, but if supplied, we will use + the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, + the last usable IP address in the subnet IPv6 will be used. + example: 2604:1380:4641:a00::6 + type: string + description: + type: string + href: + format: uri + type: string + id: + format: uuid + type: string + md5: + description: The MD5 password for the BGP peering in plaintext (not a checksum). + type: string + metal_ip: + description: An IPv4 address from the subnet that will be used on the Metal + side. This parameter is optional, but if supplied, we will use the other + usable IP address in the subnet as the Customer IP. By default, the first + usable IP address in the subnet will be used. + example: 12.0.0.1 + type: string + metal_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the + Metal side. This parameter is optional, but if supplied, we will use the + other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, + the first usable IPv6 address in the subnet IPv6 will be used. + example: 2604:1380:4641:a00::6 + type: string + name: + type: string + nni_vlan: + type: integer + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual + Circuit. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + port: + $ref: '#/components/schemas/InterconnectionPort' + project: + $ref: '#/components/schemas/Project' + speed: + description: integer representing bps speed + format: int64 + type: integer + status: + description: The status changes of a VRF virtual circuit are generally the + same as Virtual Circuits that aren't in a VRF. However, for VRF Virtual + Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' + once the Fabric service token associated with the virtual circuit has + been redeemed on Fabric, and Metal has found the associated Fabric connection. + At this point, users can update the subnet, MD5 password, customer IP + and/or metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, + we require all peering details to be set on creation of a VRF Virtual + Circuit. The status will change to `changing_peering_details` whenever + an active VRF Virtual Circuit has any of its peering details updated. + enum: + - pending + - waiting_on_peering_details + - activating + - changing_peering_details + - deactivating + - deleting + - active + - expired + - activation_failed + - changing_peering_details_failed + - deactivation_failed + - delete_failed + type: string + subnet: + description: The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that + will be used with the VRF for the Virtual Circuit. This subnet does not + have to be an existing VRF IP reservation, as we will create the VRF IP + reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast + IPs cannot be used as the Metal or Customer IP. + example: 12.0.0.0/30 + type: string + subnet_ipv6: + description: The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that + will be used with the VRF for the Virtual Circuit. This subnet does not + have to be an existing VRF IP reservation, as we will create the VRF IP + reservation on creation if it does not exist. The Metal IPv6 and Customer + IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast + IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified + must be contained within an already-defined IP Range for the VRF. + example: 2604:1380:4641:a00::4/126 + type: string + tags: + items: + type: string + type: array + type: + enum: + - vrf + type: string + updated_at: + format: date-time + type: string + vrf: + $ref: '#/components/schemas/Vrf' + required: + - vrf + type: object + VrfVirtualCircuitCreateInput: + properties: + customer_ip: + description: An IPv4 address from the subnet that will be used on the Customer + side. This parameter is optional, but if supplied, we will use the other + usable IP address in the subnet as the Metal IP. By default, the last + usable IP address in the subnet will be used. + example: 12.0.0.2 + type: string + customer_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the + Customer side. This parameter is optional, but if supplied, we will use + the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, + the last usable IP address in the subnet IPv6 will be used. + example: 2604:1380:4641:a00::6 + type: string + description: + type: string + href: + format: uri + type: string + md5: + description: 'The plaintext BGP peering password shared by neighbors as + an MD5 checksum: + + * must be 10-20 characters long + + * may not include punctuation + + * must be a combination of numbers and letters + + * must contain at least one lowercase, uppercase, and digit character + + ' + nullable: true + pattern: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$ + type: string + metal_ip: + description: An IPv4 address from the subnet that will be used on the Metal + side. This parameter is optional, but if supplied, we will use the other + usable IP address in the subnet as the Customer IP. By default, the first + usable IP address in the subnet will be used. + example: 12.0.0.1 + type: string + metal_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the + Metal side. This parameter is optional, but if supplied, we will use the + other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, + the first usable IPv6 address in the subnet IPv6 will be used. + example: 2604:1380:4641:a00::6 + type: string + name: + type: string + nni_vlan: + maximum: 4094 + minimum: 2 + type: integer + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual + Circuit. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + project_id: + format: uuid + type: string + speed: + description: speed can be passed as integer number representing bps speed + or string (e.g. '52m' or '100g' or '4 gbps') + type: string + subnet: + description: The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that + will be used with the VRF for the Virtual Circuit. This subnet does not + have to be an existing VRF IP reservation, as we will create the VRF IP + reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast + IPs cannot be used as the Metal or Customer IP. The subnet specified must + be contained within an already-defined IP Range for the VRF. + example: 12.0.0.0/30 + type: string + subnet_ipv6: + description: The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that + will be used with the VRF for the Virtual Circuit. This subnet does not + have to be an existing VRF IP reservation, as we will create the VRF IP + reservation on creation if it does not exist. The Metal IPv6 and Customer + IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast + IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified + must be contained within an already-defined IP Range for the VRF. + example: 2604:1380:4641:a00::4/126 + type: string + tags: + items: + type: string + type: array + vrf: + description: The UUID of the VRF that will be associated with the Virtual + Circuit. + format: uuid + type: string + required: + - nni_vlan + - peer_asn + - project_id + - subnet + - vrf + type: object + VrfVirtualCircuitUpdateInput: + properties: + customer_ip: + description: An IPv4 address from the subnet that will be used on the Customer + side. This parameter is optional, but if supplied, we will use the other + usable IP address in the subnet as the Metal IP. By default, the last + usable IP address in the subnet will be used. + example: 12.0.0.2 + type: string + customer_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the + Customer side. This parameter is optional, but if supplied, we will use + the other usable IP address in the subnet IPv6 as the Metal IPv6. By default, + the last usable IP address in the subnet IPv6 will be used. + example: 2604:1380:4641:a00::6 + type: string + description: + type: string + href: + format: uri + type: string + md5: + description: 'The plaintext BGP peering password shared by neighbors as + an MD5 checksum: + + * must be 10-20 characters long + + * may not include punctuation + + * must be a combination of numbers and letters + + * must contain at least one lowercase, uppercase, and digit character + + ' + pattern: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$ + type: string + metal_ip: + description: An IPv4 address from the subnet that will be used on the Metal + side. This parameter is optional, but if supplied, we will use the other + usable IP address in the subnet as the Customer IP. By default, the first + usable IP address in the subnet will be used. + example: 12.0.0.1 + type: string + metal_ipv6: + description: An IPv6 address from the subnet IPv6 that will be used on the + Metal side. This parameter is optional, but if supplied, we will use the + other usable IPv6 address in the subnet IPv6 as the Customer IP. By default, + the first usable IPv6 address in the subnet IPv6 will be used. + example: 2604:1380:4641:a00::6 + type: string + name: + type: string + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual + Circuit. + example: 65000 + format: int64 + maximum: 4294967295 + minimum: 0 + type: integer + speed: + description: Speed can be changed only if it is an interconnection on a + Dedicated Port + type: string + subnet: + description: The /30 or /31 IPv4 subnet of one of the VRF IP Blocks that + will be used with the VRF for the Virtual Circuit. This subnet does not + have to be an existing VRF IP reservation, as we will create the VRF IP + reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast + IPs cannot be used as the Metal or Customer IP. + example: 12.0.0.0/30 + type: string + subnet_ipv6: + description: The /126 or /127 IPv6 subnet of one of the VRF IP Blocks that + will be used with the VRF for the Virtual Circuit. This subnet does not + have to be an existing VRF IP reservation, as we will create the VRF IP + reservation on creation if it does not exist. The Metal IPv6 and Customer + IPv6 must be IPs from this subnet. For /126 subnets, the network and broadcast + IPs cannot be used as the Metal IPv6 or Customer IPv6. The subnet specified + must be contained within an already-defined IP Range for the VRF. + example: 2604:1380:4641:a00::4/126 + type: string + tags: + items: + type: string + type: array + type: object + activateHardwareReservation_request: + properties: + description: + type: string + href: + format: uri + type: string + type: object + createDevice_request: + oneOf: + - $ref: '#/components/schemas/DeviceCreateInMetroInput' + - $ref: '#/components/schemas/DeviceCreateInFacilityInput' + createMetalGateway_request: + oneOf: + - $ref: '#/components/schemas/MetalGatewayCreateInput' + - $ref: '#/components/schemas/VrfMetalGatewayCreateInput' + createOrganizationInterconnection_request: + oneOf: + - $ref: '#/components/schemas/DedicatedPortCreateInput' + - $ref: '#/components/schemas/VlanFabricVcCreateInput' + - $ref: '#/components/schemas/VrfFabricVcCreateInput' + - $ref: '#/components/schemas/SharedPortVCVlanCreateInput' + - $ref: '#/components/schemas/VlanCSPConnectionCreateInput' + findIPAddressById_200_response: + oneOf: + - $ref: '#/components/schemas/IPAssignment' + - $ref: '#/components/schemas/IPReservation' + - $ref: '#/components/schemas/VrfIpReservation' + findMetalGatewayById_200_response: + oneOf: + - $ref: '#/components/schemas/MetalGateway' + - $ref: '#/components/schemas/VrfMetalGateway' + findTraffic_timeframe_parameter: + properties: + ended_at: + format: date-time + type: string + href: + format: uri + type: string + started_at: + format: date-time + type: string + required: + - ended_at + - started_at + type: object + moveHardwareReservation_request: + properties: + href: + format: uri + type: string + project_id: + format: uuid + type: string + type: object + requestIPReservation_201_response: + oneOf: + - $ref: '#/components/schemas/IPReservation' + - $ref: '#/components/schemas/VrfIpReservation' + requestIPReservation_request: + oneOf: + - $ref: '#/components/schemas/IPReservationRequestInput' + - $ref: '#/components/schemas/VrfIpReservationCreateInput' + securitySchemes: + x_auth_token: + description: 'HTTP header containing the User or Project API key that will be + used to authenticate the request. + + ' + in: header + name: X-Auth-Token + type: apiKey + x-displayName: X-Auth-Token +info: + contact: + email: support@equinixmetal.com + name: Equinix Metal API Team + description: "# Introduction\nEquinix Metal provides a RESTful HTTP API which can\ + \ be reached at . This document describes the\ + \ API and how to use it.\n\nThe API allows you to programmatically interact with\ + \ all\nof your Equinix Metal resources, including devices, networks, addresses,\ + \ organizations,\nprojects, and your user account. Every feature of the Equinix\ + \ Metal web interface is accessible through the API.\n\nThe API docs are generated\ + \ from the Equinix Metal OpenAPI specification and are officially hosted at .\n\ + \n# Common Parameters\n\nThe 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.\n\ + \n## Pagination\n\nPagination 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.\n\nThe `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.\n\n\ + ## Sorting\n\nWhere 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).\n\n\ + ## Filtering\n\nFiltering 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.\n\nFor example, to filter the IP\ + \ list to only return public IPv4 addresses, you can filter by the `type` field,\ + \ as in the following request:\n\n```sh\ncurl -H 'X-Auth-Token: my_authentication_token'\ + \ \\\n https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4\n```\n\ + \nOnly IP addresses with the `type` field set to `public_ipv4` will be returned.\n\ + \n## Searching\n\nSearching 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.\n\nTo search resources you can use the `search`\ + \ query parameter.\n\n## Include and Exclude\n\nFor 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.\n\n```json\n{\n ...\n \"project\": {\n \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\"\ + \n }\n}\n```\n\nIf 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.\n\ + \nFor example:\n\n```sh\ncurl -H 'X-Auth-Token: my_authentication_token' \\\n\ + \ https://api.equinix.com/metal/v1/user?include=projects\n```\n\nThe `include`\ + \ parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests\ + \ where `href` resources are presented.\n\nTo have multiple resources include,\ + \ use a comma-separated list (e.g. `?include=emails,projects,memberships`).\n\n\ + ```sh\ncurl -H 'X-Auth-Token: my_authentication_token' \\\n https://api.equinix.com/metal/v1/user?include=emails,projects,memberships\n\ + ```\n\nYou may also include nested associations up to three levels deep using\ + \ dot notation (`?include=memberships.projects`):\n\n```sh\ncurl -H 'X-Auth-Token:\ + \ my_authentication_token' \\\n https://api.equinix.com/metal/v1/user?include=memberships.projects\n\ + ```\n\nTo 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.\n" + license: + name: Equinix Metal + url: https://www.equinix.com/about/legal/terms + termsOfService: https://www.equinix.com/about/legal/privacy + title: Metal API + version: 1.0.0 +openapi: 3.0.0 +paths: + /api-keys/{id}: + delete: + description: Deletes the API key. + operationId: deleteAPIKey + parameters: + - description: API Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the API key + tags: + - Authentication + /batches/{id}: + delete: + description: Deletes the Batch. + operationId: deleteBatch + parameters: + - description: Batch UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Delete all instances created from this batch + in: query + name: remove_associated_instances + schema: + default: false + type: boolean + responses: + '204': + description: no content + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the Batch + tags: + - Batches + get: + description: Returns a Batch + operationId: findBatchById + parameters: + - description: Batch UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Batch' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a Batch + tags: + - Batches + /bgp-dynamic-neighbors/{id}: + delete: + description: Trigger the removal of a BGP Neighbor range from a VRF + operationId: deleteBgpDynamicNeighborById + parameters: + - description: BGP Dynamic Neighbor UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/BgpDynamicNeighbor' + description: Accepted + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + summary: Delete a VRF BGP Dynamic Neighbor + tags: + - VRFs + get: + description: Return a single BGP Dynamic Neighbor resource + parameters: + - description: BGP Dynamic Neighbor UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BgpDynamicNeighbor' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + summary: Retrieve a BGP Dynamic Neighbor + tags: + - VRFs + /bgp/sessions/{id}: + delete: + description: Deletes the BGP session. + operationId: deleteBgpSession + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the BGP session + tags: + - BGP + get: + description: Returns a BGP session + operationId: findBgpSessionById + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BgpSession' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a BGP session + tags: + - BGP + put: + description: Updates the BGP session by either enabling or disabling the default + route functionality. + operationId: updateBgpSession + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + type: boolean + description: Default route + required: true + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the BGP session + tags: + - BGP + /capacity: + get: + description: Returns a list of facilities and plans with their current capacity. + operationId: findCapacityForFacility + responses: + '200': + content: + application/json: + example: + capacity: + am6: + c2.medium.x86: + level: string + m2.xlarge.x86: + level: string + da11: + c2.medium.x86: + level: string + m2.xlarge.x86: + level: string + sv15: + c2.medium.x86: + level: string + m2.xlarge.x86: + level: string + schema: + $ref: '#/components/schemas/CapacityList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: View capacity + tags: + - Capacity + post: + deprecated: true + description: Validates if a deploy can be fulfilled. + operationId: checkCapacityForFacility + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CapacityInput' + description: Facility to check capacity in + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CapacityCheckPerFacilityList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Check capacity + tags: + - Capacity + /capacity/metros: + get: + description: Returns a list of metros and plans with their current capacity. + operationId: findCapacityForMetro + responses: + '200': + content: + application/json: + example: + capacity: + am: + c2.medium.x86: + available_servers: 25 + level: string + m2.xlarge.x86: + available_servers: 15 + level: string + da: + c2.medium.x86: + available_servers: 26 + level: string + m2.xlarge.x86: + available_servers: 11 + level: string + dc: + c2.medium.x86: + available_servers: 14 + level: string + m2.xlarge.x86: + available_servers: 10 + level: string + schema: + $ref: '#/components/schemas/CapacityList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: View capacity for metros + tags: + - Capacity + post: + description: Validates if a deploy can be fulfilled in a metro. + operationId: checkCapacityForMetro + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CapacityInput' + description: Metro to check capacity in + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CapacityCheckPerMetroList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Check capacity for a metro + tags: + - Capacity + /connections/metros: + get: + description: Displays which providers you can connect to directly from Equinix + Metal Metros. + operationId: getInterconnectionMetros + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InterconnectionMetroList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Get connectivity to network provider by metro + tags: + - Interconnections + /connections/prices: + get: + description: Displays pricing information for connecting to networks outside + of Equinix. + operationId: getInterconnectionPricing + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InterconnectionPricingList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Get Interconnection Pricing + tags: + - Interconnections + /connections/{connection_id}: + delete: + description: Delete a interconnection, its associated ports and virtual circuits. + operationId: deleteInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/Interconnection' + description: accepted + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete interconnection + tags: + - Interconnections + get: + description: Get the details of a interconnection + operationId: getInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Interconnection' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Get interconnection + tags: + - Interconnections + put: + description: Update the details of a interconnection + operationId: updateInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InterconnectionUpdateInput' + description: Updated interconnection details + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Interconnection' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Update interconnection + tags: + - Interconnections + /connections/{connection_id}/events: + get: + description: Returns a list of the interconnection events + operationId: findInterconnectionEvents + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve interconnection events + tags: + - Events + x-equinix-metal-paginated-property: events + /connections/{connection_id}/ports: + get: + description: List the ports associated to an interconnection. + operationId: listInterconnectionPorts + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InterconnectionPortList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: List a interconnection's ports + tags: + - Interconnections + /connections/{connection_id}/ports/{id}: + get: + description: Get the details of an interconnection port. + operationId: getInterconnectionPort + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InterconnectionPort' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Get a interconnection port + tags: + - Interconnections + /connections/{connection_id}/ports/{id}/events: + get: + description: Returns a list of the interconnection port events + operationId: findInterconnectionPortEvents + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: Interconnection Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Event' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve interconnection port events + tags: + - Events + /connections/{connection_id}/ports/{port_id}/virtual-circuits: + get: + description: List the virtual circuit record(s) associatiated with a particular + interconnection port. + operationId: listInterconnectionPortVirtualCircuits + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: UUID of the interconnection port + in: path + name: port_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualCircuitList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: List a interconnection port's virtual circuits + tags: + - Interconnections + post: + description: Create a new Virtual Circuit on a Dedicated Port. To create a regular + Virtual Circuit, specify a Virtual Network record and an NNI VLAN value. To + create a VRF-based Virtual Circuit, specify the VRF ID and subnet, along with + the NNI VLAN value. + operationId: createInterconnectionPortVirtualCircuit + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: UUID of the interconnection port + in: path + name: port_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualCircuitCreateInput' + description: Virtual Circuit details + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualCircuit' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Create a new Virtual Circuit + tags: + - Interconnections + /connections/{connection_id}/virtual-circuits: + get: + description: List the virtual circuit record(s) associated with a particular + interconnection id. + operationId: listInterconnectionVirtualCircuits + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualCircuitList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: List a interconnection's virtual circuits + tags: + - Interconnections + /devices/{id}: + delete: + description: Deletes a device and deprovisions it in our datacenter. + operationId: deleteDevice + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Force the deletion of the device, by detaching any storage volume + still active. + in: query + name: force_delete + schema: + type: boolean + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Delete the device + tags: + - Devices + get: + description: "Type-specific options (such as facility for baremetal devices)\ + \ will be included as part of the main data structure.\n \ + \ State value can be one of: active inactive queued or provisioning" + operationId: findDeviceById + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a device + tags: + - Devices + put: + description: Updates the device. + operationId: updateDevice + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceUpdateInput' + description: Device to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the device + tags: + - Devices + /devices/{id}/actions: + post: + description: 'Performs an action for the given device. Possible actions include: + power_on, power_off, reboot, reinstall, and rescue (reboot the device into + rescue OS.)' + operationId: performAction + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceActionInput' + description: Action to perform + required: true + responses: + '202': + description: accepted + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Perform an action + tags: + - Devices + /devices/{id}/bandwidth: + get: + description: Retrieve an instance bandwidth for a given period of time. + operationId: findInstanceBandwidth + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Timestamp from range + in: query + name: from + required: true + schema: + type: string + - description: Timestamp to range + in: query + name: until + required: true + schema: + type: string + responses: + '200': + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve an instance bandwidth + tags: + - Devices + /devices/{id}/bgp/neighbors: + get: + description: Provides a summary of the BGP neighbor data associated to the BGP + sessions for this device. + operationId: getBgpNeighborData + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BgpSessionNeighbors' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve BGP neighbor data for this device + tags: + - Devices + /devices/{id}/bgp/sessions: + get: + description: Provides a listing of available BGP sessions for the device. + operationId: findBgpSessions + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BgpSessionList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + summary: Retrieve all BGP sessions + tags: + - Devices + post: + description: Creates a BGP session. + operationId: createBgpSession + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BGPSessionInput' + description: BGP session to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/BgpSession' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a BGP session + tags: + - Devices + /devices/{id}/customdata: + get: + description: Provides the custom metadata stored for this instance in json format + operationId: findDeviceCustomdata + parameters: + - description: Instance UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve the custom metadata of an instance + tags: + - Devices + /devices/{id}/diagnostics/health/rollup: + get: + description: Returns the health rollup status of the device. + operationId: getDeviceHealthRollup + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceHealthRollup' + description: Successful operation + '401': + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + '404': + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Get Device's Health Status + tags: + - Devices + /devices/{id}/diagnostics/screenshot: + get: + description: Capture a screenshot from the device, if supported, via the BMC. + operationId: captureScreenshot + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/jpeg: + schema: + format: binary + type: string + description: An image file + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '501': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not implemented for device + tags: + - ConsoleLogDetails + /devices/{id}/events: + get: + description: Returns a list of events pertaining to a specific device + operationId: findDeviceEvents + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve device's events + tags: + - Events + x-equinix-metal-paginated-property: events + /devices/{id}/firmware-sets: + get: + description: Returns the firmware set associated with the device. If a custom + firmware set is associated with the device, then it is returned. Otherwise, + if a default firmware set is available it is returned. + operationId: getDeviceFirmwareSets + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FirmwareSetResponse' + description: Successful operation + '401': + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + '404': + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Get Device's associated Firmware Set + tags: + - Devices + /devices/{id}/ips: + get: + description: Returns all ip assignments for a device. + operationId: findIPAssignments + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IPAssignmentList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all ip assignments + tags: + - Devices + post: + description: Creates an ip assignment for a device. + operationId: createIPAssignment + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IPAssignmentInput' + description: IPAssignment to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/IPAssignment' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create an ip assignment + tags: + - Devices + /devices/{id}/metadata: + get: + description: Retrieve device metadata + operationId: findDeviceMetadataByID + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Metadata' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Retrieve metadata + tags: + - Devices + /devices/{id}/ssh-keys: + get: + description: Returns a collection of the device's ssh keys. + operationId: findDeviceSSHKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by key, label, or fingerprint + in: query + name: Search string + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKeyList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve a device's ssh keys + tags: + - SSHKeys + /devices/{id}/traffic: + get: + description: 'Returns the total amount of inbound or outbound traffic for a + specific device. The default time period is 1 hour. + + + Please note the results capture all network traffic for the server, but not + all traffic may come from or be destined to the Internet and may be non-billable. + Only Internet bound traffic is charged. + + ' + operationId: findTraffic + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Traffic direction + in: query + name: direction + required: true + schema: + enum: + - inbound + - outbound + type: string + - description: Traffic interval + in: query + name: interval + schema: + enum: + - minute + - hour + - day + - week + - month + - year + - hour_of_day + - day_of_week + - day_of_month + - month_of_year + type: string + - description: Traffic bucket + in: query + name: bucket + schema: + enum: + - internal + - external + type: string + - explode: true + in: query + name: timeframe + schema: + $ref: '#/components/schemas/findTraffic_timeframe_parameter' + style: deepObject + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve device traffic + tags: + - Devices + /devices/{id}/usages: + get: + description: Returns all usages for a device. + operationId: findDeviceUsages + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter usages created after this date + in: query + name: created[after] + schema: + format: datetime + type: string + - description: Filter usages created before this date + in: query + name: created[before] + schema: + format: datetime + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceUsageList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all usages for device + tags: + - Usages + /devices/{id}/userdata: + get: + description: Retrieve device userdata + operationId: findDeviceUserdataByID + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Userdata' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Retrieve userdata + tags: + - Devices + /devices/{instance_id}/ips/{id}/customdata: + get: + description: Provides the custom metadata stored for this IP Assignment in json + format + operationId: findIPAssignmentCustomdata + parameters: + - description: Instance UUID + in: path + name: instance_id + required: true + schema: + format: uuid + type: string + - description: Ip Assignment UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve the custom metadata of an IP Assignment + tags: + - Devices + /emails: + post: + deprecated: true + description: Add a new email address to the current user. + operationId: createEmail + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEmailInput' + description: Email to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Email' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create an email + tags: + - Emails + /emails/{id}: + delete: + description: Deletes the email. + operationId: deleteEmail + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the email + tags: + - Emails + get: + description: "Provides one of the user\u2019s emails." + operationId: findEmailById + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Email' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve an email + tags: + - Emails + put: + description: Updates the email. + operationId: updateEmail + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateEmailInput' + description: email to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Email' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the email + tags: + - Emails + /events: + get: + description: "Returns a list of the current user\u2019s events" + operationId: findEvents + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve current user's events + tags: + - Events + x-equinix-metal-paginated-property: events + /events/{id}: + get: + description: Returns a single event if the user has access + operationId: findEventById + parameters: + - description: Event UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Event' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve an event + tags: + - Events + /facilities: + get: + deprecated: true + description: Provides a listing of available datacenters where you can provision + Packet devices. + operationId: findFacilities + parameters: + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + enum: + - address + - labels + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only + the href attribute. Attribute names can be dotted (up to 3 levels) to exclude + deeply nested objects. + in: query + name: exclude + schema: + default: + - address + items: + enum: + - address + - labels + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FacilityList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all facilities + tags: + - Facilities + /hardware-reservations/{id}: + get: + description: Returns a single hardware reservation + operationId: findHardwareReservationById + parameters: + - description: HardwareReservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HardwareReservation' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a hardware reservation + tags: + - HardwareReservations + /hardware-reservations/{id}/activate: + post: + description: Activate a spare hardware reservation + operationId: activateHardwareReservation + parameters: + - description: Hardware Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/activateHardwareReservation_request' + description: Note to attach to the reservation + required: false + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/HardwareReservation' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Activate a spare hardware reservation + tags: + - HardwareReservations + /hardware-reservations/{id}/move: + post: + description: Move a hardware reservation to another project + operationId: moveHardwareReservation + parameters: + - description: Hardware Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/moveHardwareReservation_request' + description: Destination Project UUID + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/HardwareReservation' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Move a hardware reservation + tags: + - HardwareReservations + /incidents: + get: + description: Retrieve the number of incidents. + operationId: findIncidents + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve the number of incidents + tags: + - Incidents + /invitations: + get: + description: Returns all invitations in current user. + operationId: findInvitations + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InvitationList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve current user invitations + tags: + - Users + /invitations/{id}: + delete: + description: Decline an invitation. + operationId: declineInvitation + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Decline an invitation + tags: + - Invitations + get: + description: Returns a single invitation. (It include the `invitable` to maintain + backward compatibility but will be removed soon) + operationId: findInvitationById + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Invitation' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: View an invitation + tags: + - Invitations + put: + description: Accept an invitation. + operationId: acceptInvitation + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Membership' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Accept an invitation + tags: + - Invitations + /invoices/{id}: + get: + description: Returns the invoice identified by the provided id + operationId: getInvoiceById + parameters: + - description: Invoice UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Invoice' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve an invoice + tags: + - Invoices + /ips/{id}: + delete: + description: 'This call can be used to un-assign an IP assignment or delete + + an IP reservation. + + + Un-assign an IP address record. + + Use the assignment UUID you + + get after attaching the IP. This will remove the relationship between an IP + and the device or metal gateway and will make the IP address available to + be assigned to another device, once the IP has been un-configured from the + network. + + + Delete an IP reservation. + + Use the reservation UUID you get after adding the IP to the project. This + will permanently delete the IP block reservation from the project. + + ' + operationId: deleteIPAddress + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Unassign an ip address + tags: + - IPAddresses + get: + description: Returns a single ip address if the user has access. + operationId: findIPAddressById + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/findIPAddressById_200_response' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve an ip address + tags: + - IPAddresses + patch: + description: Update details about an ip address + operationId: updateIPAddress + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IPAssignmentUpdateInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/findIPAddressById_200_response' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Update an ip address + tags: + - IPAddresses + /ips/{id}/available: + get: + description: Provides a list of IP resevations for a single project. + operationId: findIPAvailabilities + parameters: + - description: IP Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Size of subnets in bits + in: query + name: cidr + required: true + schema: + enum: + - '20' + - '21' + - '22' + - '23' + - '24' + - '25' + - '26' + - '27' + - '28' + - '29' + - '30' + - '31' + - '32' + - '33' + - '34' + - '35' + - '36' + - '37' + - '38' + - '39' + - '40' + - '41' + - '42' + - '43' + - '44' + - '45' + - '46' + - '47' + - '48' + - '49' + - '50' + - '51' + - '52' + - '53' + - '54' + - '55' + - '56' + - '57' + - '58' + - '59' + - '60' + - '61' + - '62' + - '63' + - '64' + - '65' + - '66' + - '67' + - '68' + - '69' + - '70' + - '71' + - '72' + - '73' + - '74' + - '75' + - '76' + - '77' + - '78' + - '79' + - '80' + - '81' + - '82' + - '83' + - '84' + - '85' + - '86' + - '87' + - '88' + - '89' + - '90' + - '91' + - '92' + - '93' + - '94' + - '95' + - '96' + - '97' + - '98' + - '99' + - '100' + - '101' + - '102' + - '103' + - '104' + - '105' + - '106' + - '107' + - '108' + - '109' + - '110' + - '111' + - '112' + - '113' + - '114' + - '115' + - '116' + - '117' + - '118' + - '119' + - '120' + - '121' + - '122' + - '123' + - '124' + - '125' + - '126' + - '127' + - '128' + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IPAvailabilitiesList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all available subnets of a particular reservation + tags: + - IPAddresses + /ips/{id}/customdata: + get: + description: Provides the custom metadata stored for this IP Reservation or + IP Assignment in json format + operationId: findIPAddressCustomdata + parameters: + - description: Ip Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve the custom metadata of an IP Reservation or IP Assignment + tags: + - IPAddresses + /licenses/{id}: + delete: + description: Deletes a license. + operationId: deleteLicense + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the license + tags: + - Licenses + get: + description: Returns a license + operationId: findLicenseById + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/License' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a license + tags: + - Licenses + put: + description: Updates the license. + operationId: updateLicense + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LicenseUpdateInput' + description: License to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/License' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the license + tags: + - Licenses + /locations/metros: + get: + description: Provides a listing of available metros + operationId: findMetros + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MetroList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all metros + tags: + - Metros + /locations/metros/{id}: + get: + description: Show the details for a metro, including name, code, and country. + operationId: getMetro + parameters: + - description: Metro UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Metro' + description: ok + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a specific Metro's details + tags: + - Metros + /market/spot/prices: + get: + description: Get Equinix Metal current spot market prices. + operationId: findSpotMarketPrices + parameters: + - description: Facility to check spot market prices + in: query + name: facility + schema: + type: string + - description: Plan to check spot market prices + in: query + name: plan + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SpotMarketPricesList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Get current spot market prices + tags: + - SpotMarket + /market/spot/prices/history: + get: + description: 'Get spot market prices for a given plan and facility in a fixed + period of time + + + *Note: In the `200` response, the property `datapoints` contains arrays of + `[float, integer]`.*' + operationId: findSpotMarketPricesHistory + parameters: + - description: Facility to check spot market prices + in: query + name: facility + required: true + schema: + type: string + - description: Plan to check spot market prices + in: query + name: plan + required: true + schema: + type: string + - description: Metro to check spot market price history + in: query + name: metro + schema: + type: string + - description: Timestamp from range + in: query + name: from + required: true + schema: + type: string + - description: Timestamp to range + in: query + name: until + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SpotPricesHistoryReport' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Get spot market prices for a given period of time + tags: + - SpotMarket + /market/spot/prices/metros: + get: + description: Get Equinix Metal current spot market prices for all metros. + operationId: findMetroSpotMarketPrices + parameters: + - description: Metro to filter spot market prices + in: query + name: metro + schema: + type: string + - description: Plan to filter spot market prices + in: query + name: plan + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SpotMarketPricesPerMetroList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Get current spot market prices for metros + tags: + - SpotMarket + /memberships/{id}: + delete: + description: Deletes the membership. + operationId: deleteMembership + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the membership + tags: + - Memberships + get: + description: Returns a single membership. + operationId: findMembershipById + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Membership' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a membership + tags: + - Memberships + put: + description: Updates the membership. + operationId: updateMembership + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MembershipInput' + description: Membership to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Membership' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the membership + tags: + - Memberships + /metal-gateways/{id}: + delete: + description: Deletes a metal gateway and any elastic IP assignments associated + with this metal gateway. + operationId: deleteMetalGateway + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/findMetalGatewayById_200_response' + description: accepted + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Deletes the metal gateway + tags: + - MetalGateways + get: + description: Returns a specific metal gateway + operationId: findMetalGatewayById + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/findMetalGatewayById_200_response' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Returns the metal gateway + tags: + - MetalGateways + /metal-gateways/{id}/bgp-dynamic-neighbors: + get: + description: Returns the list of VRF BGP Dynamic Neighbors for this Metal Gateway + operationId: getBgpDynamicNeighbors + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BgpDynamicNeighborList' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + summary: List BGP Dynamic Neighbors + tags: + - MetalGateways + post: + description: 'Create a VRF BGP Dynamic Neighbor range. + + + BGP Dynamic Neighbor records are limited to 2 per Virtual Network. + + ' + operationId: createBgpDynamicNeighbor + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BgpDynamicNeighborCreateInput' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/BgpDynamicNeighbor' + description: Created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unprocessable entity + summary: Create a VRF BGP Dynamic Neighbor range + tags: + - MetalGateways + /metal-gateways/{id}/ips: + get: + description: Returns the list of Elastic IPs assigned to this Metal Gateway + operationId: getMetalGatewayElasticIps + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IPAssignmentList' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + summary: List Metal Gateway Elastic IPs + tags: + - MetalGateways + post: + description: 'Create a new Elastic IP on this Metal Gateway. + + + Assign an IPv4 range as an elastic IP to the Metal Gateway, with a specified + next-hop address contained within the Metal Gateway. + + + Notice: Elastic IPs on Metal Gateways are a test feature currently under active + development, and only available to certain users. Please contact Customer + Success for more information. + + ' + operationId: createMetalGatewayElasticIp + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MetalGatewayElasticIpCreateInput' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/IPAssignment' + description: Created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unprocessable entity + summary: Create a Metal Gateway Elastic IP + tags: + - MetalGateways + /operating-system-versions: + get: + description: Provides a listing of available operating system versions. + operationId: findOperatingSystemVersion + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OperatingSystemList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all operating system versions + tags: + - OperatingSystems + /operating-systems: + get: + description: Provides a listing of available operating systems to provision + your new device with. + operationId: findOperatingSystems + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OperatingSystemList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all operating systems + tags: + - OperatingSystems + /organizations: + get: + description: Returns a list of organizations that are accessible to the current + user. + operationId: findOrganizations + parameters: + - description: Include, exclude or show only personal organizations. + in: query + name: personal + schema: + enum: + - include + - exclude + - only + type: string + - description: Include, exclude or show only organizations that have no projects. + in: query + name: without_projects + schema: + enum: + - include + - exclude + - only + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all organizations + tags: + - Organizations + x-equinix-metal-paginated-property: organizations + post: + description: Creates an organization. + operationId: createOrganization + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationInput' + description: Organization to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Organization' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create an organization + tags: + - Organizations + /organizations/{id}: + delete: + description: Deletes the organization. + operationId: deleteOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the organization + tags: + - Organizations + get: + description: Returns a single organization's details, if the user is authorized + to view it. + operationId: findOrganizationById + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Organization' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve an organization's details + tags: + - Organizations + put: + description: Updates the organization. + operationId: updateOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationInput' + description: Organization to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Organization' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the organization + tags: + - Organizations + /organizations/{id}/capacity: + get: + description: Returns a list of facilities and plans with their current capacity. + operationId: findOrganizationCapacityPerFacility + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + example: + capacity: + am6: + c2.medium.x86: + level: string + m2.xlarge.x86: + level: string + da11: + c2.medium.x86: + level: string + m2.xlarge.x86: + level: string + sv15: + c2.medium.x86: + level: string + m2.xlarge.x86: + level: string + schema: + $ref: '#/components/schemas/CapacityList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + summary: View available hardware plans per Facility for given organization + tags: + - Capacity + /organizations/{id}/capacity/metros: + get: + description: Returns a list of metros and plans with their current capacity. + operationId: findOrganizationCapacityPerMetro + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + example: + capacity: + am: + c2.medium.x86: + level: string + m2.xlarge.x86: + level: string + da: + c2.medium.x86: + level: string + m2.xlarge.x86: + level: string + dc: + c2.medium.x86: + level: string + m2.xlarge.x86: + level: string + schema: + $ref: '#/components/schemas/CapacityList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + summary: View available hardware plans per Metro for given organization + tags: + - Capacity + /organizations/{id}/customdata: + get: + description: Provides the custom metadata stored for this organization in json + format + operationId: findOrganizationCustomdata + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve the custom metadata of an organization + tags: + - Organizations + /organizations/{id}/devices: + get: + description: Provides a collection of devices for a given organization. + operationId: findOrganizationDevices + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by hostname, description, short_id, reservation short_id, + tags, plan name, plan slug, facility code, facility name, operating system + name, operating system slug, IP addresses. + in: query + name: search + schema: + type: string + - description: Filter by plan category + in: query + name: categories + schema: + items: + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + type: string + type: array + - description: Filter by device facility + in: query + name: facility + schema: + type: string + - description: Filter by partial hostname + in: query + name: hostname + schema: + type: string + - description: Filter only reserved instances. When set to true, only include + reserved instances. When set to false, only include on-demand instances. + in: query + name: reserved + schema: + type: boolean + - description: Filter by device tag + in: query + name: tag + schema: + type: string + - description: Filter by instance type (ondemand,spot,reserved) + in: query + name: type + schema: + type: string + - description: Filter only instances marked for termination. When set to true, + only include instances that have a termination time. When set to false, + only include instances that do not have a termination time. + in: query + name: has_termination_time + schema: + type: boolean + - description: Filter by MAC address + in: query + name: mac_address + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all devices of an organization + tags: + - Devices + x-equinix-metal-paginated-property: devices + /organizations/{id}/events: + get: + description: Returns a list of events for a single organization + operationId: findOrganizationEvents + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve organization's events + tags: + - Events + x-equinix-metal-paginated-property: events + /organizations/{id}/facilities: + get: + deprecated: true + description: Returns a listing of available datacenters for the given organization + operationId: findFacilitiesByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FacilityList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all facilities visible by the organization + tags: + - Facilities + /organizations/{id}/firmware-sets: + get: + description: Returns all firmware sets associated with the organization. + operationId: getOrganizationFirmwareSets + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: page number to return + in: query + name: page + schema: + type: integer + x-equinix-metal-page-param: true + - description: items returned per page. + in: query + name: per_page + schema: + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FirmwareSetListResponse' + description: Successful operation + '401': + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + '404': + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Get Organization's Firmware Sets + tags: + - FirmwareSets + /organizations/{id}/invitations: + get: + description: Returns all invitations in an organization. + operationId: findOrganizationInvitations + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InvitationList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve organization invitations + tags: + - Organizations + post: + description: 'In order to add a user to an organization, they must first be + invited. + + To invite to several projects the parameter `projects_ids:[a,b,c]` can be + used' + operationId: createOrganizationInvitation + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + $ref: '#/components/requestBodies/InvitationInput' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Invitation' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create an invitation for an organization + tags: + - Organizations + /organizations/{id}/invoices: + get: + description: Returns all invoices for an organization + operationId: findOrganizationInvoices + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: page number + in: query + name: page + schema: + type: integer + x-equinix-metal-page-param: true + - description: per page + in: query + name: per_page + schema: + type: integer + - description: filter by status + in: query + name: status + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InvoiceList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all invoices for an organization + tags: + - Invoices + /organizations/{id}/operating-systems: + get: + description: Returns a listing of available operating systems for the given + organization + operationId: findOperatingSystemsByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OperatingSystemList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all operating systems visible by the organization + tags: + - Organizations + /organizations/{id}/payment-methods: + get: + description: Returns all payment methods of an organization. + operationId: findOrganizationPaymentMethods + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethodList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all payment methods of an organization + tags: + - Organizations + post: + description: Creates a payment method. + operationId: createPaymentMethod + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethodCreateInput' + description: Payment Method to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethod' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a payment method for the given organization + tags: + - Organizations + /organizations/{id}/plans: + get: + description: Returns a listing of available plans for the given organization + operationId: findPlansByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PlanList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all plans visible by the organization + tags: + - Organizations + /organizations/{id}/projects: + get: + description: Returns a collection of projects that belong to the organization. + operationId: findOrganizationProjects + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter results by name. + in: query + name: name + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all projects of an organization + tags: + - Organizations + x-equinix-metal-paginated-property: projects + post: + description: Creates a new project for the organization + operationId: createOrganizationProject + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectCreateInput' + description: Project to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a project for the organization + tags: + - Organizations + /organizations/{id}/transfers: + get: + description: Provides a collection of project transfer requests from or to the + organization. + operationId: findOrganizationTransfers + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TransferRequestList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + summary: Retrieve all project transfer requests from or to an organization + tags: + - Organizations + /organizations/{organization_id}/connections: + get: + description: List the connections belonging to the organization + operationId: organizationListInterconnections + parameters: + - description: UUID of the organization + in: path + name: organization_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InterconnectionList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: List organization connections + tags: + - Interconnections + post: + description: Creates a new interconnection request. A Project ID must be specified + in the request body for connections on shared ports. + operationId: createOrganizationInterconnection + parameters: + - description: UUID of the organization + in: path + name: organization_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + $ref: '#/components/requestBodies/InterconnectionCreateInput' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Interconnection' + description: created + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Request a new interconnection for the organization + tags: + - Interconnections + /payment-methods/{id}: + delete: + description: Deletes the payment method. + operationId: deletePaymentMethod + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the payment method + tags: + - PaymentMethods + get: + description: Returns a payment method + operationId: findPaymentMethodById + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethod' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a payment method + tags: + - PaymentMethods + put: + description: Updates the payment method. + operationId: updatePaymentMethod + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethodUpdateInput' + description: Payment Method to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethod' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the payment method + tags: + - PaymentMethods + /plans: + get: + description: Provides a listing of available plans to provision your device + on. + operationId: findPlans + parameters: + - description: Filter plans by its category + in: query + name: categories[] + schema: + items: + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + type: string + type: array + - description: Filter plans by its plan type + in: query + name: type + schema: + enum: + - standard + - workload_optimized + - custom + example: standard + type: string + - description: Filter plans by slug + in: query + name: slug + schema: + example: c3.small.x86 + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PlanList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all plans + tags: + - Plans + /ports/{id}: + get: + description: Returns a port + operationId: findPortById + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Port' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a port + tags: + - Ports + /ports/{id}/assign: + post: + description: Assign a hardware port to a virtual network. + operationId: assignPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + $ref: '#/components/requestBodies/PortAssignInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Port' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Assign a port to virtual network + tags: + - Ports + /ports/{id}/bond: + post: + description: Enabling bonding for one or all ports + operationId: bondPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: enable both ports + in: query + name: bulk_enable + schema: + type: boolean + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Port' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Enabling bonding + tags: + - Ports + /ports/{id}/convert/layer-2: + post: + description: Converts a bond port to Layer 2. IP assignments of the port will + be removed. + operationId: convertLayer2 + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + $ref: '#/components/requestBodies/PortAssignInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Port' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Convert to Layer 2 + tags: + - Ports + /ports/{id}/convert/layer-3: + post: + description: Converts a bond port to Layer 3. VLANs must first be unassigned. + operationId: convertLayer3 + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PortConvertLayer3Input' + description: IPs to request + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Port' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Convert to Layer 3 + tags: + - Ports + /ports/{id}/disbond: + post: + description: Disabling bonding for one or all ports + operationId: disbondPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: disable both ports + in: query + name: bulk_disable + schema: + type: boolean + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Port' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Disabling bonding + tags: + - Ports + /ports/{id}/native-vlan: + delete: + description: Removes the native VLAN from this port + operationId: deleteNativeVlan + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Port' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Remove native VLAN + tags: + - Ports + post: + description: Sets a virtual network on this port as a "native VLAN". The VLAN + must have already been assigned using the using the "Assign a port to a virtual + network" operation. + operationId: assignNativeVlan + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Virtual Network ID. May be the UUID of the Virtual Network record, + or the VLAN value itself (ex: ''1001'').' + in: query + name: vnid + required: true + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Port' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Assign a native VLAN + tags: + - Ports + /ports/{id}/unassign: + post: + description: Unassign a port for a hardware. + operationId: unassignPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + $ref: '#/components/requestBodies/PortAssignInput' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Port' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Unassign a port + tags: + - Ports + /ports/{id}/vlan-assignments: + get: + description: Show the port's current VLAN assignments, including if this VLAN + is set as native, and the current state of the assignment (ex. 'assigned' + or 'unassigning') + operationId: findPortVlanAssignments + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + default: + - port + - virtual_network + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PortVlanAssignmentList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: List Current VLAN assignments for a port + tags: + - Ports + /ports/{id}/vlan-assignments/batches: + get: + description: Show all the VLAN assignment batches that have been created for + managing this port's VLAN assignments + operationId: findPortVlanAssignmentBatches + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PortVlanAssignmentBatchList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: List the VLAN Assignment Batches for a port + tags: + - Ports + post: + description: Create a new asynchronous batch request which handles adding and/or + removing the VLANs to which the port is assigned. + operationId: createPortVlanAssignmentBatch + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PortVlanAssignmentBatchCreateInput' + description: VLAN Assignment batch details + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/PortVlanAssignmentBatch' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a new Port-VLAN Assignment management batch + tags: + - Ports + /ports/{id}/vlan-assignments/batches/{batch_id}: + get: + description: Returns the details of an existing Port-VLAN Assignment batch, + including the list of VLANs to assign or unassign, and the current state of + the batch. + operationId: findPortVlanAssignmentBatchByPortIdAndBatchId + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Batch ID + in: path + name: batch_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PortVlanAssignmentBatch' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a VLAN Assignment Batch's details + tags: + - Ports + /ports/{id}/vlan-assignments/{assignment_id}: + get: + description: Show the details of a specific Port-VLAN assignment, including + the current state and if the VLAN is set as native. + operationId: findPortVlanAssignmentByPortIdAndAssignmentId + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Assignment ID + in: path + name: assignment_id + required: true + schema: + format: uuid + type: string + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + default: + - port + - virtual_network + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PortVlanAssignment' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Show a particular Port VLAN assignment's details + tags: + - Ports + /projects: + get: + description: Returns a collection of projects that the current user is a member + of. + operationId: findProjects + parameters: + - description: Filter results by name. + in: query + name: name + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all projects + tags: + - Projects + x-equinix-metal-paginated-property: projects + post: + description: Creates a new project for the user's default organization. If the + user does not have a default organization, the API will look for a personal + organization belonging to the user with the name "{User's Full Name} Projects" + to associate the project with. If that organization does not exist a new organization + named "{User's Full Name} Projects" will be created and the new project will + be tied to that organization. + operationId: createProject + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectCreateFromRootInput' + description: Project to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a project + tags: + - Projects + /projects/{id}: + delete: + description: Deletes the project. + operationId: deleteProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the project + tags: + - Projects + get: + description: Returns a single project if the user has access + operationId: findProjectById + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a project + tags: + - Projects + put: + description: Updates the project. + operationId: updateProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectUpdateInput' + description: Project to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Project' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the project + tags: + - Projects + /projects/{id}/api-keys: + get: + description: Returns all API keys for a specific project. + operationId: findProjectAPIKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all API keys for the project. + tags: + - Authentication + post: + description: Creates an API key for a project. + operationId: createProjectAPIKey + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenInput' + description: API Key to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/AuthToken' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create an API key for a project. + tags: + - Authentication + /projects/{id}/batches: + get: + description: Returns all batches for the given project + operationId: findBatchesByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchesList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all batches by project + tags: + - Batches + /projects/{id}/bgp-config: + get: + description: Returns a bgp config + operationId: findBgpConfigByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BgpConfig' + description: 'ok + + + When BGP configuration is not enabled empty structure is returned. + + When BGP configuration is disabled after being enabled BGP configuration + data is returned with status disabled. + + ' + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: 'not found + + + The project was not found. + + ' + summary: Retrieve a bgp config + tags: + - BGP + /projects/{id}/bgp-configs: + post: + description: Requests to enable bgp configuration for a project. + operationId: requestBgpConfig + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BgpConfigRequestInput' + description: BGP config Request to create + required: true + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Requesting bgp config + tags: + - BGP + /projects/{id}/bgp/sessions: + get: + description: Provides a listing of available BGP sessions for the project. + operationId: findProjectBgpSessions + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BgpSessionList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all BGP sessions for project + tags: + - BGP + /projects/{id}/customdata: + get: + description: Provides the custom metadata stored for this project in json format + operationId: findProjectCustomdata + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve the custom metadata of a project + tags: + - Projects + /projects/{id}/devices: + get: + description: Provides a collection of devices for a given project. + operationId: findProjectDevices + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by hostname, description, short_id, reservation short_id, + tags, plan name, plan slug, facility code, facility name, operating system + name, operating system slug, IP addresses. + in: query + name: search + schema: + type: string + - description: Filter by plan category + in: query + name: categories + schema: + items: + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + type: string + type: array + - description: Filter by device facility + in: query + name: facility + schema: + type: string + - description: Filter by device metro + in: query + name: metro + schema: + type: string + - description: Filter by partial hostname + in: query + name: hostname + schema: + type: string + - description: Filter only reserved instances. When set to true, only include + reserved instances. When set to false, only include on-demand instances. + in: query + name: reserved + schema: + type: boolean + - description: Filter by device tag + in: query + name: tag + schema: + type: string + - description: Filter by instance type (ondemand,spot,reserved) + in: query + name: type + schema: + type: string + - description: Filter only instances marked for termination. When set to true, + only include instances that have a termination time. When set to false, + only include instances that do not have a termination time. + in: query + name: has_termination_time + schema: + type: boolean + - description: Filter by MAC address + in: query + name: mac_address + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all devices of a project + tags: + - Devices + x-equinix-metal-paginated-property: devices + post: + description: 'Creates a new device and provisions it in the specified location. + + + Device type-specific options are accepted. For example, `baremetal` devices + accept `operating_system`, `hostname`, and `plan`. These parameters may not + be accepted for other device types. The default device type is `baremetal`.' + operationId: createDevice + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/createDevice_request' + description: Device to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Device' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a device + tags: + - Devices + /projects/{id}/devices/batch: + post: + description: Creates new devices in batch and provisions them in our datacenter. + operationId: createDeviceBatch + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InstancesBatchCreateInput' + description: Batches to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchesList' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a devices batch + tags: + - Batches + /projects/{id}/events: + get: + description: Returns a list of events for a single project + operationId: findProjectEvents + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve project's events + tags: + - Events + x-equinix-metal-paginated-property: events + /projects/{id}/facilities: + get: + deprecated: true + description: Returns a listing of available datacenters for the given project + operationId: findFacilitiesByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FacilityList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all facilities visible by the project + tags: + - Facilities + /projects/{id}/firmware-sets: + get: + description: Returns all firmware sets associated with the project or organization. + operationId: getProjectFirmwareSets + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: page number to return + in: query + name: page + schema: + type: integer + x-equinix-metal-page-param: true + - description: items returned per page. + in: query + name: per_page + schema: + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FirmwareSetListResponse' + description: Successful operation + '401': + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + '404': + description: Error responses are included with 4xx and 5xx HTTP responses + from the API service. Either "error" or "errors" will be set. + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Get Project's Firmware Sets + tags: + - FirmwareSets + /projects/{id}/global-bgp-ranges: + get: + description: Returns all global bgp ranges for a project + operationId: findGlobalBgpRanges + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalBgpRangeList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all global bgp ranges + tags: + - BGP + /projects/{id}/hardware-reservations: + get: + description: Provides a collection of hardware reservations for a given project. + operationId: findProjectHardwareReservations + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by facility code, plan name, project name, reservation + short ID or device hostname + in: query + name: query + schema: + type: string + - description: Filter by hardware reservation state + in: query + name: state + schema: + enum: + - active + - spare + - need_of_service + type: string + - description: Filter hardware reservation that is provisionable + in: query + name: provisionable + schema: + enum: + - only + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/HardwareReservationList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all hardware reservations for a given project + tags: + - HardwareReservations + x-equinix-metal-paginated-property: hardware_reservations + /projects/{id}/ips: + get: + description: Provides a paginated list of IP reservations for a single project. + operationId: findIPReservations + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter project IP reservations by reservation type + in: query + name: types + schema: + items: + enum: + - global_ipv4 + - private_ipv4 + - public_ipv4 + - public_ipv6 + - vrf + type: string + type: array + style: form + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Items returned per page + in: query + name: per_page + schema: + default: 250 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IPReservationList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all ip reservations + tags: + - IPAddresses + post: + description: Request more IP space for a project in order to have additional + IP addresses to assign to devices. If the request is within the max quota, + an IP reservation will be created. If the project will exceed its IP quota, + a request will be submitted for review, and will return an IP Reservation + with a `state` of `pending`. You can automatically have the request fail with + HTTP status 422 instead of triggering the review process by providing the + `fail_on_approval_required` parameter set to `true` in the request. + operationId: requestIPReservation + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/requestIPReservation_request' + description: IP Reservation Request to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/requestIPReservation_201_response' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Requesting IP reservations + tags: + - IPAddresses + /projects/{id}/licenses: + get: + description: Provides a collection of licenses for a given project. + operationId: findProjectLicenses + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LicenseList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all licenses + tags: + - Licenses + post: + description: Creates a new license for the given project + operationId: createLicense + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LicenseCreateInput' + description: License to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/License' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a License + tags: + - Licenses + /projects/{id}/plans: + get: + description: Returns a listing of available plans for the given project + operationId: findPlansByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PlanList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all plans visible by the project + tags: + - Plans + /projects/{id}/spot-market-requests: + get: + description: View all spot market requests for a given project. + operationId: listSpotMarketRequests + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SpotMarketRequestList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: List spot market requests + tags: + - SpotMarket + post: + description: 'Creates a new spot market request. + + + Type-specific options (such as operating_system for baremetal devices) should + be included in the main data structure alongside hostname and plan. + + + The features attribute allows you to optionally specify what features your + server should have. For example, if you require a server with a TPM chip, + you may specify `{ "features": { "tpm": "required" } }` (or `{ "features": + ["tpm"] }` in shorthand). + + + The request will fail if there are no available servers matching your criteria. + 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 (see the example request below). + + + The request will not fail if we have no servers with that feature in our inventory.' + operationId: createSpotMarketRequest + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SpotMarketRequestCreateInput' + description: Spot Market Request to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/SpotMarketRequest' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a spot market request + tags: + - SpotMarket + /projects/{id}/ssh-keys: + get: + description: Returns a collection of the project's ssh keys. + operationId: findProjectSSHKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by key, label, or fingerprint + in: query + name: query + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKeyList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve a project's ssh keys + tags: + - SSHKeys + post: + description: Creates a ssh key. + operationId: createProjectSSHKey + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKeyCreateInput' + description: ssh key to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKey' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a ssh key for the given project + tags: + - SSHKeys + /projects/{id}/transfers: + post: + deprecated: true + description: Organization owners can transfer their projects to other organizations. + operationId: createTransferRequest + parameters: + - description: UUID of the project to be transferred + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferRequestInput' + description: Transfer Request to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TransferRequest' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a transfer request + tags: + - Projects + /projects/{id}/usages: + get: + description: Returns all usages for a project. + operationId: findProjectUsage + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter usages created after this date + in: query + name: created[after] + schema: + format: datetime + type: string + - description: Filter usages created before this date + in: query + name: created[before] + schema: + format: datetime + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectUsageList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all usages for project + tags: + - Usages + /projects/{id}/virtual-networks: + get: + description: Provides a list of virtual networks for a single project. + operationId: findVirtualNetworks + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - deprecated: true + description: Filter by Facility ID (uuid) or Facility Code + in: query + name: facility + schema: + type: string + - description: Filter by Metro ID (uuid) or Metro Code + in: query + name: metro + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualNetworkList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all virtual networks + tags: + - VLANs + post: + description: Creates an virtual network. + operationId: createVirtualNetwork + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualNetworkCreateInput' + description: Virtual Network to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualNetwork' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a virtual network + tags: + - VLANs + /projects/{id}/vrfs: + get: + description: Returns the list of VRFs for a single project. + operationId: findVrfs + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Filter by Metro ID (uuid) or Metro Code + in: query + name: metro + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all VRFs in the project + tags: + - VRFs + post: + description: Creates a new VRF in the specified project + operationId: createVrf + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VrfCreateInput' + description: VRF to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Vrf' + description: created + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a new VRF in the specified project + tags: + - VRFs + /projects/{project_id}/connections: + get: + description: List the connections belonging to the project + operationId: projectListInterconnections + parameters: + - description: UUID of the project + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InterconnectionList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: List project connections + tags: + - Interconnections + x-equinix-metal-paginated-property: interconnections + post: + description: Creates a new interconnection request + operationId: createProjectInterconnection + parameters: + - description: UUID of the project + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + $ref: '#/components/requestBodies/InterconnectionCreateInput' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Interconnection' + description: created + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Request a new interconnection for the project's organization + tags: + - Interconnections + /projects/{project_id}/invitations: + get: + description: Returns all invitations in a project. + operationId: findProjectInvitations + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InvitationList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve project invitations + tags: + - Projects + post: + description: In order to add a user to a project, they must first be invited. + operationId: createProjectInvitation + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + $ref: '#/components/requestBodies/InvitationInput' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Invitation' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create an invitation for a project + tags: + - Projects + /projects/{project_id}/ips/{id}/customdata: + get: + description: Provides the custom metadata stored for this IP Reservation in + json format + operationId: findIPReservationCustomdata + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: Ip Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve the custom metadata of an IP Reservation + tags: + - Projects + /projects/{project_id}/memberships: + get: + description: Returns all memberships in a project. + operationId: findProjectMemberships + parameters: + - description: Search by member full name, id and email. + in: query + name: search + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MembershipList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve project memberships + tags: + - Projects + /projects/{project_id}/metal-gateways: + get: + description: Return all metal gateways for a project + operationId: findMetalGatewaysByProject + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MetalGatewayList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Returns all metal gateways for a project + tags: + - MetalGateways + x-equinix-metal-paginated-property: metal_gateways + post: + description: Create a metal gateway in a project + operationId: createMetalGateway + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/createMetalGateway_request' + description: Metal Gateway to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/findMetalGatewayById_200_response' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a metal gateway + tags: + - MetalGateways + /projects/{project_id}/self-service/reservations: + get: + description: Returns all reservations. + operationId: findSelfServiceReservations + parameters: + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: Filter reservations by items category + in: query + name: categories + schema: + items: + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SelfServiceReservationList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all reservations + tags: + - SelfServiceReservations + post: + description: Creates a reservation. + operationId: createSelfServiceReservation + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateSelfServiceReservationRequest' + description: reservation to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/SelfServiceReservationResponse' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a reservation + tags: + - SelfServiceReservations + /projects/{project_id}/self-service/reservations/{id}: + get: + description: Returns a reservation + operationId: findSelfServiceReservation + parameters: + - description: Reservation short_id + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SelfServiceReservationResponse' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a reservation + tags: + - SelfServiceReservations + /reset-password: + delete: + description: Resets current user password. + operationId: resetPassword + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/NewPassword' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Reset current user password + tags: + - PasswordResetTokens + post: + description: Creates a password reset token + operationId: createPasswordResetToken + parameters: + - description: Email of user to create password reset token + in: query + name: email + required: true + schema: + type: string + responses: + '201': + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a password reset token + tags: + - PasswordResetTokens + /routes/{id}: + delete: + description: Trigger the deletion of a VRF Route resource. The status of the + route will update to 'deleting', and the route resource will remain accessible + while background operations remove the route from the network. Once the route + has been removed from the network, the resource will be fully deleted. + operationId: deleteVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfRoute' + description: Accepted + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + summary: Delete a VRF Route + tags: + - VRFs + get: + description: Returns a single VRF Route resource + operationId: findVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfRoute' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + summary: Retrieve a VRF Route + tags: + - VRFs + put: + description: Requests a VRF Route be redeployed across the network. Updating + the prefix or next-hop address on a route is not currently supported. + operationId: updateVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VrfRouteUpdateInput' + required: true + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfRoute' + description: Accepted + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unprocessable Entity + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Too Many Requests + summary: Update a VRF Route + tags: + - VRFs + /routes/{id}/events: + get: + description: Returns a list of the VRF route events + operationId: findVrfRouteEvents + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Event' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve VRF route events + tags: + - Events + /spot-market-requests/{id}: + delete: + description: Deletes the spot market request. + operationId: deleteSpotMarketRequest + parameters: + - description: SpotMarketRequest UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Terminate associated spot instances + in: query + name: force_termination + schema: + type: boolean + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the spot market request + tags: + - SpotMarket + get: + description: Returns a single spot market request + operationId: findSpotMarketRequestById + parameters: + - description: SpotMarketRequest UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SpotMarketRequest' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a spot market request + tags: + - SpotMarket + /ssh-keys: + get: + description: "Returns a collection of the user\u2019s ssh keys." + operationId: findSSHKeys + parameters: + - description: Search by key, label, or fingerprint + in: query + name: search + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKeyList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all ssh keys + tags: + - SSHKeys + post: + description: Creates a ssh key. + operationId: createSSHKey + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + $ref: '#/components/requestBodies/SSHKeyCreateInput' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKey' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a ssh key for the current user + tags: + - SSHKeys + /ssh-keys/{id}: + delete: + description: Deletes the ssh key. + operationId: deleteSSHKey + parameters: + - description: ssh key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the ssh key + tags: + - SSHKeys + get: + description: Returns a single ssh key if the user has access + operationId: findSSHKeyById + parameters: + - description: SSH Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKey' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a ssh key + tags: + - SSHKeys + put: + description: Updates the ssh key. + operationId: updateSSHKey + parameters: + - description: SSH Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKeyInput' + description: ssh key to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SSHKey' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the ssh key + tags: + - SSHKeys + /support-requests: + post: + description: Support Ticket. + operationId: requestSupport + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SupportRequestInput' + description: Support Request to create + required: true + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a support ticket + tags: + - SupportRequest + /transfers/{id}: + delete: + description: Decline a transfer request. + operationId: declineTransferRequest + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Decline a transfer request + tags: + - TransferRequests + get: + description: Returns a single transfer request. + operationId: findTransferRequestById + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TransferRequest' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: View a transfer request + tags: + - TransferRequests + put: + description: Accept a transfer request. + operationId: acceptTransferRequest + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Accept a transfer request + tags: + - TransferRequests + /user: + get: + description: Returns the user object for the currently logged-in user. + operationId: findCurrentUser + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve the current user + tags: + - Users + put: + description: Updates the currently logged-in user. + operationId: updateCurrentUser + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpdateInput' + description: User to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the current user + tags: + - Users + /user/api-keys: + get: + description: Returns all API keys for the current user. + operationId: findAPIKeys + parameters: + - description: Search by description + in: query + name: search + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all user API keys + tags: + - Authentication + post: + description: Creates a API key for the current user. + operationId: createAPIKey + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenInput' + description: API key to create + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/AuthToken' + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create an API key + tags: + - Authentication + /user/api-keys/{id}: + delete: + description: Deletes the current user API key. + operationId: deleteUserAPIKey + parameters: + - description: API Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the API key + tags: + - Authentication + /user/otp/app: + delete: + description: Disables two factor authentication. + operationId: disableTfaApp + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Disable two factor authentication + tags: + - TwoFactorAuth + post: + description: Enables two factor authentication using authenticator app. + operationId: enableTfaApp + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Enable two factor auth using app + tags: + - TwoFactorAuth + /user/otp/recovery-codes: + get: + description: Returns my recovery codes. + operationId: findRecoveryCodes + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RecoveryCodeList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Retrieve my recovery codes + tags: + - OTPs + post: + description: Generate a new set of recovery codes. + operationId: regenerateCodes + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RecoveryCodeList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Generate new recovery codes + tags: + - OTPs + /user/otp/sms: + delete: + description: Disables two factor authentication. + operationId: disableTfaSms + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Disable two factor authentication + tags: + - TwoFactorAuth + post: + description: Enables two factor authentication with sms. + operationId: enableTfaSms + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Enable two factor auth using sms + tags: + - TwoFactorAuth + /user/otp/sms/receive: + post: + description: Sends an OTP to the user's mobile phone. + operationId: receiveCodes + responses: + '204': + description: no content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: internal server error + summary: Receive an OTP per sms + tags: + - OTPs + /user/otp/verify/{otp}: + post: + description: It verifies the user once a valid OTP is provided. It gives back + a session token, essentially logging in the user. + operationId: findEnsureOtp + parameters: + - description: OTP + in: path + name: otp + required: true + schema: + type: string + responses: + '204': + description: no content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Verify user by providing an OTP + tags: + - OTPs + /userdata/validate: + post: + description: Validates user data (Userdata) + operationId: validateUserdata + parameters: + - description: Userdata to validate + in: query + name: userdata + schema: + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Validate user data + tags: + - Userdata + /users: + get: + description: "Returns a list of users that the are accessible to the current\ + \ user (all users in the current user\u2019s projects, essentially)." + operationId: findUsers + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UserList' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + summary: Retrieve all users + tags: + - Users + x-equinix-metal-paginated-property: users + post: + description: Creates a user. + operationId: createUser + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserCreateInput' + description: User to create + required: true + responses: + '202': + description: accepted + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + example: + errors: + - username@example.com is not a valid email address + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create a user + tags: + - Users + /users/{id}: + get: + description: Returns a single user if the user has access + operationId: findUserById + parameters: + - description: User UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a user + tags: + - Users + /users/{id}/customdata: + get: + description: Provides the custom metadata stored for this user in json format + operationId: findUserCustomdata + parameters: + - description: User UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve the custom metadata of a user + tags: + - Users + /verify-email: + post: + description: Creates an email verification request + operationId: createValidationRequest + parameters: + - description: Email for verification request + in: query + name: login + required: true + schema: + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + responses: + '201': + description: created + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Create an email verification request + tags: + - UserVerificationTokens + put: + description: Consumes an email verification token and verifies the user associated + with it. + operationId: consumeVerificationRequest + parameters: + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyEmail' + description: Email to create + required: true + responses: + '200': + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Verify a user using an email verification token + tags: + - UserVerificationTokens + /virtual-circuits/{id}: + delete: + description: Delete a virtual circuit from a Dedicated Port. + operationId: deleteVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualCircuit' + description: accepted + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete a virtual circuit + tags: + - Interconnections + get: + description: Get the details of a virtual circuit + operationId: getVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualCircuit' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Get a virtual circuit + tags: + - Interconnections + put: + description: Update the details of a virtual circuit. + operationId: updateVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualCircuitUpdateInput' + description: Updated Virtual Circuit details + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualCircuit' + description: ok + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualCircuit' + description: accepted + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Update a virtual circuit + tags: + - Interconnections + /virtual-circuits/{id}/events: + get: + description: Returns a list of the virtual circuit events + operationId: findVirtualCircuitEvents + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + - description: Page to return + in: query + name: page + schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer + x-equinix-metal-page-param: true + - description: Items returned per page + in: query + name: per_page + schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Event' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve virtual circuit events + tags: + - Events + /virtual-networks/{id}: + delete: + description: Deletes a virtual network. + operationId: deleteVirtualNetwork + parameters: + - description: Virtual Network UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Delete a virtual network + tags: + - VLANs + get: + description: Get a virtual network. + operationId: getVirtualNetwork + parameters: + - description: Virtual Network UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualNetwork' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Get a virtual network + tags: + - VLANs + put: + description: Updates the virtual network. + operationId: updateVirtualNetwork + parameters: + - description: Virtual Network UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualNetworkUpdateInput' + description: Virtual network to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualNetwork' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: too many requests + summary: Updates the virtual network + tags: + - VLANs + /vrfs/{id}: + delete: + description: Deletes the VRF + operationId: deleteVrf + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: no content + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Delete the VRF + tags: + - VRFs + get: + description: Returns a single VRF resource + operationId: findVrfById + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Vrf' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve a VRF + tags: + - VRFs + put: + description: Updates the VRF. + operationId: updateVrf + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VrfUpdateInput' + description: VRF to update + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Vrf' + description: ok + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: unprocessable entity + summary: Update the VRF + tags: + - VRFs + /vrfs/{id}/bgp-neighbors: + get: + description: Provides BGP peering information such as the IP and state of the + neighbor. + operationId: getVrfBGPNeighbors + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfBGPNeighborsList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve BGP neighbor states for the VRF + tags: + - VRFs + /vrfs/{id}/ips: + get: + description: Returns the list of VRF IP Reservations for the VRF. + operationId: findVrfIpReservations + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only + the href attribute. Attribute names can be dotted (up to 3 levels) to exclude + deeply nested objects. + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfIpReservationList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve all VRF IP Reservations in the VRF + tags: + - VRFs + /vrfs/{id}/learned-routes: + get: + description: Provides information about learned routes for the VRF. The VRF + builds this information dynamically though BGP from other routers in the network. + operationId: getVrfLearnedRoutes + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfLearnedRoutesList' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve learned L3 routes within the VRF + tags: + - VRFs + /vrfs/{id}/routes: + get: + description: Returns the list of routes for the VRF + operationId: getVrfRoutes + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfRouteList' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + summary: Retrieve all routes in the VRF + tags: + - VRFs + post: + description: 'Create a route in a VRF. Currently only static default routes + are supported. + + ' + operationId: createVrfRoute + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Nested attributes to include. Included objects will return their + full + + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + + nested objects.' + explode: false + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: 'Nested attributes to exclude. Excluded objects will return only + the href + + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + + nested objects.' + explode: false + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VrfRouteCreateInput' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfRoute' + description: OK + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not Found + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unprocessable entity + summary: Create a VRF route + tags: + - VRFs + /vrfs/{vrf_id}/ips/{id}: + get: + description: Returns the specified IP Reservation for the VRF. + operationId: findVrfIpReservation + parameters: + - description: VRF UUID + in: path + name: vrf_id + required: true + schema: + format: uuid + type: string + - description: IP UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only + the href attribute. Attribute names can be dotted (up to 3 levels) to exclude + deeply nested objects. + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VrfIpReservation' + description: ok + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not found + summary: Retrieve the Specified VRF IP Reservation + tags: + - VRFs +security: +- x_auth_token: [] +servers: +- url: https://api.equinix.com/metal/v1 +tags: +- description: "Nearly all of the endpoints in the API require authentication. Authentication\ + \ is performed by providing an authentication token (interchangeably referred\ + \ to as an API key) in the `X-Auth-Token` HTTP request header.\n\n\n\nUser API keys can be obtained by creating them\ + \ in the Equinix Metal Portal or by using the [Create a User API Key](#operation/createAPIKey)\ + \ endpoint.\n\nProject API keys can also be obtained by creating them in the Equinix\ + \ Metal Portal or by using the [Create a Project API Key](#operation/createProjectAPIKey)\ + \ endpoint. Project API keys are scoped to a single project and can only be used\ + \ to access resources within that project.\n\nFor example, to use an authenticated\ + \ API token, you would make a request like the following:\n\n```bash\ncurl -H\ + \ 'X-Auth-Token: my_authentication_token' \\\n https://api.equinix.com/metal/v1/user/api-keys\n\ + ```\n\nApplications can take advantage of the Equinix Metal API and API keys to\ + \ perform any of the actions that can be performed in the Equinix Metal Portal.\ + \ For example, you can use the API to create and manage devices, projects, and\ + \ other resources.\n\nAPI keys can be deleted without affecting any of the resources\ + \ created with them. Access to applications using the API can be revoked by deleting\ + \ the API key used to authenticate the application.\n" + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/api-keys/ + name: Authentication +- description: 'Equinix Metal uses conventional HTTP response codes to indicate the + success or failure of an API request. + + + In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate + an error that failed given the information provided (e.g., a required parameter + was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error + with Equinix Metal''s servers (these are rare). + + + | Code | Summary + + | ---------------------------------- | ------------------------------------------------------ + + | 200 OK | Everything worked as expected. + + | 201 Create | Everything worked as expected, the resource + was created. + + | 422 Bad Request | The request was unacceptable, often due + to missing a required parameter. + + | 401 Unauthorized | No valid API key provided. + + | 404 Not Found | The requested resource doesn''t exist. + + | 500, 502, 503, 504 - Server Errors | Something went wrong on Equinix Metal''s + end. (These are rare.) + + + Errors (4xx, 5xx) reported by the API will include a JSON error response. This + response will be structured as one of the following: + + + ```json + + {"error": "the error message"} + + ``` + + + or + + + ```json + + {"errors": ["one error", "another error"} + + ``` + + + The JSON response is not guaranteed so check the HTTP status message. JSON may + not be included if the error is reported by an API intermediary, like a loadbalancer + service. + + ' + name: Errors +- description: 'Manage device batches. See project endpoints to list batches for a + particular project. Check out the product docs to learn more about [Batch Deployment](https://deploy.equinix.com/developers/docs/metal/deploy/batch-deployment/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/batch-deployment/ + name: Batches +- description: 'Manage BGP configs and sessions. See device endpoints to create and + list BGP sessions for a particular device. Check out the product docs to learn + more about [Local and Global BGP](https://deploy.equinix.com/developers/docs/metal/bgp/bgp-on-equinix-metal/#local-bgp-vs-global-bgp). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/bgp/bgp-on-equinix-metal/ + name: BGP +- description: 'Capacity Management. Check out the product docs to learn more about + [Capacity](https://deploy.equinix.com/developers/docs/metal/locations/capacity/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/locations/capacity/ + name: Capacity +- description: 'Network Interconnections. See Instructions to create Network Interconnections + at Check out the product docs to learn more about [Equinix Fabric](https://deploy.equinix.com/developers/docs/metal/interconnections/dedicated-ports-fabric/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/interconnections/introduction/ + name: Interconnections +- description: 'Device Management. Check out the product docs to learn more about + [Server Devices](https://deploy.equinix.com/developers/docs/metal/hardware/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/on-demand/ + name: Devices +- description: Email Management + name: Emails +- description: Event Management + name: Events +- description: 'Facility Management. Check out the product docs to learn more about + [Facilities](https://deploy.equinix.com/developers/docs/metal/locations/metros/). + + ' + name: Facilities +- description: 'Firmware Sets Management. Notice: Firmware Sets are a test feature + currently under active development, and only available to certain users. Please + contact Customer Success for more information. + + ' + name: FirmwareSets +- description: 'Console Log Details. Notice: This is a test feature currently under + active development, and only available to certain users. Please contact Customer + Success for more information. + + ' + name: ConsoleLogDetails +- description: 'Global BGP Range Management + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/bgp/global-bgp/ + name: GlobalBgpRanges +- description: 'Hardware Reservation Management. Check out the product docs to learn + more about [Reserved Hardware](https://deploy.equinix.com/developers/docs/metal/deploy/reserved/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/reserved/ + name: HardwareReservations +- description: 'Incident Management + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/locations/maintenance/ + name: Incidents +- description: 'Manage invitations. See project endpoints to create a new invitation. + Check out the product docs to learn more about [Invitations](https://deploy.equinix.com/developers/docs/metal/identity-access-management/users//). + + ' + name: Invitations +- description: 'Manage IP addresses. See device and project endpoints to list and + create IP assignments for a particular project or device. Check out the product + docs to learn more about [the basic networking features](https://deploy.equinix.com/developers/docs/metal/networking/ip-addresses/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/networking/server-level-networking/ + name: IPAddresses +- description: 'Manage licenses. See project endpoints to list and create licenses + for a particular project. + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/operating-systems/licensed/ + name: Licenses +- description: 'Membership Management (Project). Check out the product docs to learn + more about [Membership](https://deploy.equinix.com/developers/docs/metal/projects/managing-a-project/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/projects/managing-a-project/ + name: Memberships +- description: 'Device Metadata + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/server-metadata/metadata/ + name: Metadata +- description: 'Metal Gateway Management.Check out the product docs to learn more + about [Metal Gateways](https://deploy.equinix.com/developers/docs/metal/networking/vrf/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/networking/vrf/ + name: MetalGateways +- description: Metro Management. Check out the product docs to learn more about [Metros](https://deploy.equinix.com/developers/docs/metal/locations/metros/). + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/locations/metros/ + name: Metros +- description: 'Operating System Management. Check out the product docs to learn more + about [Operating Systems choices](https://deploy.equinix.com/developers/docs/metal/operating-systems/licensed/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/operating-systems/supported/ + name: OperatingSystems +- description: Organizations Management. Check out the product docs to learn more + about [Organizations](https://deploy.equinix.com/developers/docs/metal/identity-access-management/organizations/). + name: Organizations +- description: 'OTP Management. Check out the product docs to learn more about [OTP](https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/#multi-factor-authentication). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/#multi-factor-authentication + name: OTPs +- description: 'Password Reset Token Management + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/#changing-your-password + name: PasswordResetTokens +- description: 'Payment Method Management + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/billing/payment-methods/ + name: PaymentMethods +- description: 'Plan Management (Device). Check out the product docs to learn more + about [Device Plans](https://deploy.equinix.com/developers/docs/metal/hardware/). + + ' + name: Plans +- description: 'Port Management. Check out the product docs to learn more about [Port + configurations](https://deploy.equinix.com/developers/docs/metal/layer2-networking/overview/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/layer2-networking/overview/ + name: Ports +- description: 'Project Management. Check out the product docs to learn more about + [Projects](https://deploy.equinix.com/developers/docs/metal/projects/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/projects/ + name: Projects +- description: 'Self Service Reservations + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/reserved/ + name: SelfServiceReservations +- description: 'Spot Market Pricing and Requests Management. Check out the product + docs to learn more about [Spot Market features](https://deploy.equinix.com/developers/docs/metal/deploy/spot-market/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/deploy/spot-market/ + name: SpotMarket +- description: 'Manage SSH keys. See project endpoints to list and create project-level + SSH keys. + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/ssh-keys/ + name: SSHKeys +- description: 'Support request + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/support-center/ + name: SupportRequest +- description: 'Project Transfer Requests Management + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/projects/#transferring-a-project + name: TransferRequests +- description: 'Two Factor Authentication Management. Check out the product docs to + learn more about [2FA](https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/#multi-factor-authentication). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/#multi-factor-authentication + name: TwoFactorAuth +- description: Usage Management + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/billing/checking-usage/ + name: Usages +- description: 'Userdata Management + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/server-metadata/user-data/ + name: Userdata +- description: 'User Management + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/users/ + name: Users +- description: 'User Verification Token Management + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/identity-access-management/organizations/#adding-team-members-to-an-organization + name: UserVerificationTokens +- description: 'Manage virtual networks (VLANs). See project endpoints to list and + create virtual networks. Check out the product docs to learn more about [VLANs](https://deploy.equinix.com/developers/docs/metal/layer2-networking/vlans/). + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/layer2-networking/vlans/ + name: VLANs +- description: 'Volume Management (Block Storage). Notice: Block storage support will + be deprecated soon. Please check here: https://deploy.equinix.com/developers/docs/metal/storage/storage-appliances/ + for more details. + + ' + externalDocs: + url: https://deploy.equinix.com/developers/docs/metal/storage/storage-appliances/ + name: Volumes +- description: 'VRF Management. A VRF is a project-scoped virtual router resource + that defines a collection of customer-managed IP blocks that can be used in BGP + peering on one or more virtual networks. Metal Gateways and Interconnection Virtual + Circuits can take advantage of VRFs to enable Layer 3 routing with custom network + ranges. + + ' + name: VRFs +x-tagGroups: +- name: Accounts and Organization + tags: + - Authentication + - Emails + - Invitations + - Memberships + - Organizations + - OTPs + - PasswordResetTokens + - PaymentMethods + - Projects + - SSHKeys + - SupportRequest + - TransferRequests + - TwoFactorAuth + - Users + - UserVerificationTokens +- name: Services and Billing + tags: + - Events + - Facilities + - Incidents + - Invoices + - Licenses + - Metros + - Plans + - Usages +- name: Servers + tags: + - Devices + - Batches + - Capacity + - ConsoleLogDetails + - FirmwareSets + - HardwareReservations + - OperatingSystems + - Ports + - SelfServiceReservations + - SpotMarket + - Userdata + - Volumes +- name: Networking + tags: + - BGP + - Interconnections + - IPAddresses + - MetalGateways + - VLANs + - VRFs diff --git a/templates/services/metalv1/api.mustache b/templates/services/metalv1/api.mustache new file mode 100644 index 00000000..6c0d22e5 --- /dev/null +++ b/templates/services/metalv1/api.mustache @@ -0,0 +1,282 @@ +# coding: utf-8 + +{{>partial_header}} +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +{{#imports}} +{{import}} +{{/imports}} + +from {{packageName}}.api_client import ApiClient, RequestSerialized +from {{packageName}}.api_response import ApiResponse +from {{packageName}}.rest import RESTResponseType + + +{{#operations}} +class {{classname}}: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client +{{#operation}} +{{#vendorExtensions}} +{{#x-equinix-metal-paginated-property}} + @validate_call + def {{operationId}}_all_pages(self, {{#allParams}}{{^vendorExtensions.x-equinix-metal-page-param}}{{paramName}} : {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, {{/vendorExtensions.x-equinix-metal-page-param}}{{/allParams}}{{#asyncio}}async_req: Optional[bool]=None, {{/asyncio}}**kwargs) -> {{#asyncio}}Union[{{{returnType}}}{{^returnType}}None{{/returnType}}, Awaitable[{{{returnType}}}{{^returnType}}None{{/returnType}}]]{{/asyncio}}{{^asyncio}}{{{returnType}}}{{^returnType}}None{{/returnType}}{{/asyncio}}: # noqa: E501 + """{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + + This method is the same as {{operationId}}, but fetches resources from all the pages. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.{{operationId}}({{#allParams}}}{{^vendorExtensions.x-equinix-metal-page-param}}{{paramName}}, {{/vendorExtensions.x-equinix-metal-page-param}}, {{/allParams}}async_req=True) + >>> result = thread.get() + +{{#allParams}} {{^vendorExtensions.x-equinix-metal-page-param}} + :param {{paramName}}:{{#description}} {{{.}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} + :type {{paramName}}: {{dataType}}{{#optional}}, optional{{/optional}} +{{/vendorExtensions.x-equinix-metal-page-param}}{{/allParams}} + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for a single page request. + If one number provided, it will be single + page request timeout. It can also be a pair + (tuple) of (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: {{returnType}}{{^returnType}}None{{/returnType}} + + """ + all_pages = None + + page = 1 + while True: + # Template comment: here we set var "page" to page number and then + # we call the base method with all the parameters listed (including + # page). + page_response = self.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}**kwargs) # noqa: E501 + if all_pages is None: + all_pages = page_response + else: + all_pages.{{.}}.extend(page_response.{{.}}) + if page_response.meta.next is None: + break + page += 1 + + return all_pages + +{{/x-equinix-metal-paginated-property}} +{{/vendorExtensions}} + @validate_call + {{#asyncio}}async {{/asyncio}}def {{operationId}}{{>partial_api_args}} -> {{{returnType}}}{{^returnType}}None{{/returnType}}: +{{>partial_api}} + response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + {{#asyncio}}await {{/asyncio}}response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + {{#asyncio}}async {{/asyncio}}def {{operationId}}_with_http_info{{>partial_api_args}} -> ApiResponse[{{{returnType}}}{{^returnType}}None{{/returnType}}]: +{{>partial_api}} + response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + {{#asyncio}}await {{/asyncio}}response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + {{#asyncio}}async {{/asyncio}}def {{operationId}}_without_preload_content{{>partial_api_args}} -> RESTResponseType: +{{>partial_api}} + response_data = {{#asyncio}}await {{/asyncio}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _{{operationId}}_serialize( + self, + {{#allParams}} + {{paramName}}, + {{/allParams}} + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + {{#servers.0}} + _hosts = [{{#servers}} + '{{{url}}}'{{^-last}},{{/-last}}{{/servers}} + ] + _host = _hosts[_host_index] + {{/servers.0}} + {{^servers.0}} + _host = None + {{/servers.0}} + + _collection_formats: Dict[str, str] = { + {{#allParams}} + {{#isArray}} + '{{baseName}}': '{{collectionFormat}}', + {{/isArray}} + {{/allParams}} + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters +{{#pathParams}} + if {{paramName}} is not None: + _path_params['{{baseName}}'] = {{paramName}}{{#isEnumRef}}.value{{/isEnumRef}} +{{/pathParams}} + # process the query parameters +{{#queryParams}} + if {{paramName}} is not None: + {{#isDateTime}} + if isinstance({{paramName}}, datetime): + _query_params.append( + ( + '{{baseName}}', + {{paramName}}.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('{{baseName}}', {{paramName}})) + {{/isDateTime}} + {{#isDate}} + if isinstance({{paramName}}, date): + _query_params.append( + ( + '{{baseName}}', + {{paramName}}.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('{{baseName}}', {{paramName}})) + {{/isDate}} + {{^isDateTime}}{{^isDate}} + _query_params.append(('{{baseName}}', {{paramName}}{{#isEnumRef}}.value{{/isEnumRef}})) + {{/isDate}}{{/isDateTime}} +{{/queryParams}} + # process the header parameters +{{#headerParams}} + if {{paramName}} is not None: + _header_params['{{baseName}}'] = {{paramName}} +{{/headerParams}} + # process the form parameters +{{#formParams}} + if {{paramName}} is not None: + {{#isFile}} + _files['{{{baseName}}}'] = {{paramName}} + {{/isFile}} + {{^isFile}} + _form_params.append(('{{{baseName}}}', {{paramName}})) + {{/isFile}} +{{/formParams}} + # process the body parameter +{{#bodyParam}} + if {{paramName}} is not None: + {{#isBinary}} + # convert to byte array if the input is a file name (str) + if isinstance({{paramName}}, str): + with open({{paramName}}, "rb") as _fp: + _body_params = _fp.read() + else: + _body_params = {{paramName}} + {{/isBinary}} + {{^isBinary}} + _body_params = {{paramName}} + {{/isBinary}} +{{/bodyParam}} + + {{#constantParams}} + {{#isQueryParam}} + # Set client side default value of Query Param "{{baseName}}". + _query_params['{{baseName}}'] = {{#_enum}}'{{{.}}}'{{/_enum}} + {{/isQueryParam}} + {{#isHeaderParam}} + # Set client side default value of Header Param "{{baseName}}". + _header_params['{{baseName}}'] = {{#_enum}}'{{{.}}}'{{/_enum}} + {{/isHeaderParam}} + {{/constantParams}} + + {{#hasProduces}} + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [{{#produces}} + '{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}} + ] + ) + {{/hasProduces}} + + {{#hasConsumes}} + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [{{#consumes}} + '{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}} + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + {{/hasConsumes}} + + # authentication setting + _auth_settings: List[str] = [{{#authMethods}} + '{{name}}'{{^-last}}, {{/-last}}{{/authMethods}} + ] + + return self.api_client.param_serialize( + method='{{httpMethod}}', + resource_path='{{{path}}}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + +{{/operation}} +{{/operations}} diff --git a/templates/services/metalv1/api_doc.mustache b/templates/services/metalv1/api_doc.mustache new file mode 100644 index 00000000..47e349f3 --- /dev/null +++ b/templates/services/metalv1/api_doc.mustache @@ -0,0 +1,82 @@ +# {{packageName}}.{{classname}}{{#description}} +{{.}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{#vendorExtensions.x-equinix-metal-paginated-property}}[**{{operationId}}_all_pages**]({{classname}}.md#{{operationId}}_all_pages) | **{{httpMethod}}** {{path}} | {{summary}}, fetches all the pages +{{/vendorExtensions.x-equinix-metal-paginated-property}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} +# **{{{operationId}}}** +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{{summary}}}{{#notes}} + +{{{.}}}{{/notes}} + +### Example + +{{#hasAuthMethods}} +{{#authMethods}} +{{#isBasic}} +{{#isBasicBasic}} +* Basic Authentication ({{name}}): +{{/isBasicBasic}} +{{#isBasicBearer}} +* Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} Authentication ({{name}}): +{{/isBasicBearer}} +{{/isBasic}} +{{#isApiKey}} +* Api Key Authentication ({{name}}): +{{/isApiKey }} +{{#isOAuth}} +* OAuth Authentication ({{name}}): +{{/isOAuth }} +{{/authMethods}} +{{/hasAuthMethods}} +{{> api_doc_example }} + +### Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +{{#vendorExtensions.x-equinix-metal-paginated-property}} +# **{{{operationId}}}_all_pages** +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}_all_pages({{#allParams}}{{^vendorExtensions.x-equinix-metal-page-param}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-equinix-metal-page-param}}{{/allParams}}) +Just like [**{{operationId}}**]({{classname}}.md#{{operationId}}) but fetches resources from all pages. This method doesn't take `page` parameter. Other parameters, return type and other characteristics are the same as in [**{{operationId}}**]({{classname}}.md#{{operationId}}). +{{/vendorExtensions.x-equinix-metal-paginated-property}} +{{/operation}} +{{/operations}} diff --git a/templates/services/metalv1/api_test.mustache b/templates/services/metalv1/api_test.mustache new file mode 100644 index 00000000..165d28d7 --- /dev/null +++ b/templates/services/metalv1/api_test.mustache @@ -0,0 +1,44 @@ +# coding: utf-8 + +{{>partial_header}} + +import unittest + +from {{apiPackage}}.{{classFilename}} import {{classname}} + + +class {{#operations}}Test{{classname}}(unittest.TestCase): + """{{classname}} unit test stubs""" + + def setUp(self) -> None: + self.api = {{classname}}() + + def tearDown(self) -> None: + pass + + {{#operation}} + def test_{{operationId}}(self) -> None: + """Test case for {{{operationId}}} + +{{#summary}} + {{{.}}} +{{/summary}} + """ + pass + +{{#vendorExtensions.x-equinix-metal-paginated-property}} + def test_{{operationId}}_all_pages(self): + """Test case for {{{operationId}}}_all_pages + +{{#summary}} + {{{.}}} # noqa: E501 +{{/summary}} + """ + pass + +{{/vendorExtensions.x-equinix-metal-paginated-property}} + {{/operation}} +{{/operations}} + +if __name__ == '__main__': + unittest.main() diff --git a/templates/services/metalv1/partial_header.mustache b/templates/services/metalv1/partial_header.mustache new file mode 100644 index 00000000..13d1ed0e --- /dev/null +++ b/templates/services/metalv1/partial_header.mustache @@ -0,0 +1,15 @@ +""" +{{#appName}} + {{{.}}} + +{{/appName}} + {{#version}} + The version of the OpenAPI document: {{{.}}} + {{/version}} + {{#infoEmail}} + Contact: {{{.}}} + {{/infoEmail}} + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501