Models

ContractApi

ContractApi

All URIs are relative to https://api.ionos.com/cloudapi/v5

Method

HTTP request

Description

contracts_get

GET /contracts

Retrieve a Contract

contracts_get

Contract contracts_get(pretty=pretty, depth=depth, x_contract_number=x_contract_number)

Retrieve a Contract

Retrieves the attributes of user's contract.

Example

  • Basic Authentication (Basic Authentication):

    from __future__ import print_function
    import time
    import ionoscloud
    from ionoscloud.rest import ApiException
    from pprint import pprint
    # Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v5
    # See configuration.py for a list of all supported configuration parameters.
    configuration = ionoscloud.Configuration(
    host = 'https://api.ionos.com/cloudapi/v5',
    )
    # The client must configure the authentication and authorization parameters
    # in accordance with the API server security policy.
    # Examples with auth method are provided below
    # Configure HTTP basic authorization: Basic Authentication
    configuration.username = 'YOUR_USERNAME'
    configuration.password = 'YOUR_PASSWORD'
    # Enter a context with an instance of the API client
    with ionoscloud.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud.ContractApi(api_client)
    pretty = True # bool | Controls whether response is pretty-printed (with indentation and new lines) (optional) (default to True)
    depth = 0 # int | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on (optional) (default to 0)
    x_contract_number = 56 # int | Users having more than 1 contract need to provide contract number, against which all API requests should be executed (optional)
    try:
    # Retrieve a Contract
    api_response = api_instance.contracts_get(pretty=pretty, depth=depth, x_contract_number=x_contract_number)
    pprint(api_response)
    except ApiException as e:
    print('Exception when calling ContractApi.contracts_get: %s\n' % e)
  • Api Key Authentication (Token Authentication):

    from __future__ import print_function
    import time
    import ionoscloud
    from ionoscloud.rest import ApiException
    from pprint import pprint
    # Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v5
    # See configuration.py for a list of all supported configuration parameters.
    configuration = ionoscloud.Configuration(
    host = 'https://api.ionos.com/cloudapi/v5',
    )
    # The client must configure the authentication and authorization parameters
    # in accordance with the API server security policy.
    # Examples with auth method are provided below
    # Configure Api Key access token for authorization: Token Authentication
    configuration.api_key = {
    'Token Authentication': 'YOUR_API_TOKEN',
    }
    # Enter a context with an instance of the API client
    with ionoscloud.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud.ContractApi(api_client)
    pretty = True # bool | Controls whether response is pretty-printed (with indentation and new lines) (optional) (default to True)
    depth = 0 # int | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on (optional) (default to 0)
    x_contract_number = 56 # int | Users having more than 1 contract need to provide contract number, against which all API requests should be executed (optional)
    try:
    # Retrieve a Contract
    api_response = api_instance.contracts_get(pretty=pretty, depth=depth, x_contract_number=x_contract_number)
    pprint(api_response)
    except ApiException as e:
    print('Exception when calling ContractApi.contracts_get: %s\n' % e)

Parameters

Name

Type

Description

Notes

pretty

bool

Controls whether response is pretty-printed (with indentation and new lines)

[optional] [default to True]

depth

int

Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on

[optional] [default to 0]

x_contract_number

int

Users having more than 1 contract need to provide contract number, against which all API requests should be executed

[optional]

Return type

Contract

Authorization

Basic Authentication, Token Authentication

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json