Skip to content

Latest commit

 

History

History
536 lines (371 loc) · 16.7 KB

File metadata and controls

536 lines (371 loc) · 16.7 KB

hyperstack.ClustersApi

All URIs are relative to https://infrahub-api.nexgencloud.com/v1

Method HTTP request Description
create_cluster POST /core/clusters Create Cluster
delete_a_cluster DELETE /core/clusters/{id} Delete a cluster
fetch_cluster_name_availability GET /core/clusters/name-availability/{name} Fetch cluster name availability
get_cluster_versions GET /core/clusters/versions GET Cluster Versions
getting_cluster_detail GET /core/clusters/{id} Getting Cluster Detail
list_clusters GET /core/clusters List Clusters

create_cluster

ClusterResponse create_cluster(payload)

Create Cluster

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.cluster_response import ClusterResponse
from hyperstack.models.create_cluster_payload import CreateClusterPayload
from hyperstack.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = hyperstack.Configuration(
    host = "https://infrahub-api.nexgencloud.com/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: apiKey
configuration.api_key['apiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'

# Configure API key authorization: accessToken
configuration.api_key['accessToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['accessToken'] = 'Bearer'

# Enter a context with an instance of the API client
with hyperstack.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hyperstack.ClustersApi(api_client)
    payload = hyperstack.CreateClusterPayload() # CreateClusterPayload | 

    try:
        # Create Cluster
        api_response = api_instance.create_cluster(payload)
        print("The response of ClustersApi->create_cluster:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClustersApi->create_cluster: %s\n" % e)

Parameters

Name Type Description Notes
payload CreateClusterPayload

Return type

ClusterResponse

Authorization

apiKey, accessToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Success -
400 Bad Request -
401 Unauthorized -
404 Not Found -
409 Conflict -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_a_cluster

ResponseModel delete_a_cluster(id)

Delete a cluster

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.response_model import ResponseModel
from hyperstack.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = hyperstack.Configuration(
    host = "https://infrahub-api.nexgencloud.com/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: apiKey
configuration.api_key['apiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'

# Configure API key authorization: accessToken
configuration.api_key['accessToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['accessToken'] = 'Bearer'

# Enter a context with an instance of the API client
with hyperstack.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hyperstack.ClustersApi(api_client)
    id = 56 # int | 

    try:
        # Delete a cluster
        api_response = api_instance.delete_a_cluster(id)
        print("The response of ClustersApi->delete_a_cluster:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClustersApi->delete_a_cluster: %s\n" % e)

Parameters

Name Type Description Notes
id int

Return type

ResponseModel

Authorization

apiKey, accessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
401 Unauthorized -
404 Not Found -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

fetch_cluster_name_availability

NameAvailableModel fetch_cluster_name_availability(name)

Fetch cluster name availability

Check if a Cluster name is available

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.name_available_model import NameAvailableModel
from hyperstack.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = hyperstack.Configuration(
    host = "https://infrahub-api.nexgencloud.com/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: apiKey
configuration.api_key['apiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'

# Configure API key authorization: accessToken
configuration.api_key['accessToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['accessToken'] = 'Bearer'

# Enter a context with an instance of the API client
with hyperstack.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hyperstack.ClustersApi(api_client)
    name = 'name_example' # str | 

    try:
        # Fetch cluster name availability
        api_response = api_instance.fetch_cluster_name_availability(name)
        print("The response of ClustersApi->fetch_cluster_name_availability:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClustersApi->fetch_cluster_name_availability: %s\n" % e)

Parameters

Name Type Description Notes
name str

Return type

NameAvailableModel

Authorization

apiKey, accessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
401 Unauthorized -
404 Not Found -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_cluster_versions

ClusterVersions get_cluster_versions()

GET Cluster Versions

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.cluster_versions import ClusterVersions
from hyperstack.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = hyperstack.Configuration(
    host = "https://infrahub-api.nexgencloud.com/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: apiKey
configuration.api_key['apiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'

# Configure API key authorization: accessToken
configuration.api_key['accessToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['accessToken'] = 'Bearer'

# Enter a context with an instance of the API client
with hyperstack.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hyperstack.ClustersApi(api_client)

    try:
        # GET Cluster Versions
        api_response = api_instance.get_cluster_versions()
        print("The response of ClustersApi->get_cluster_versions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClustersApi->get_cluster_versions: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ClusterVersions

Authorization

apiKey, accessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Retrieved Cluster Versions. -
400 Bad Request -
401 Unauthorized -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getting_cluster_detail

ClusterResponse getting_cluster_detail(id)

Getting Cluster Detail

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.cluster_response import ClusterResponse
from hyperstack.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = hyperstack.Configuration(
    host = "https://infrahub-api.nexgencloud.com/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: apiKey
configuration.api_key['apiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'

# Configure API key authorization: accessToken
configuration.api_key['accessToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['accessToken'] = 'Bearer'

# Enter a context with an instance of the API client
with hyperstack.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hyperstack.ClustersApi(api_client)
    id = 56 # int | 

    try:
        # Getting Cluster Detail
        api_response = api_instance.getting_cluster_detail(id)
        print("The response of ClustersApi->getting_cluster_detail:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClustersApi->getting_cluster_detail: %s\n" % e)

Parameters

Name Type Description Notes
id int

Return type

ClusterResponse

Authorization

apiKey, accessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
401 Unauthorized -
404 Not Found -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_clusters

ClusterListResponse list_clusters()

List Clusters

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.cluster_list_response import ClusterListResponse
from hyperstack.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = hyperstack.Configuration(
    host = "https://infrahub-api.nexgencloud.com/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: apiKey
configuration.api_key['apiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'

# Configure API key authorization: accessToken
configuration.api_key['accessToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['accessToken'] = 'Bearer'

# Enter a context with an instance of the API client
with hyperstack.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hyperstack.ClustersApi(api_client)

    try:
        # List Clusters
        api_response = api_instance.list_clusters()
        print("The response of ClustersApi->list_clusters:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClustersApi->list_clusters: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ClusterListResponse

Authorization

apiKey, accessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
401 Unauthorized -
500 Internal Server Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]