Skip to content

Latest commit

 

History

History
372 lines (257 loc) · 12.2 KB

File metadata and controls

372 lines (257 loc) · 12.2 KB

hyperstack.KeypairApi

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

Method HTTP request Description
delete_key_pair DELETE /core/keypair/{id} Delete key pair
import_key_pair POST /core/keypairs Import key pair
list_key_pairs GET /core/keypairs List key pairs
update_key_pair_name PUT /core/keypair/{id} Update key pair name

delete_key_pair

ResponseModel delete_key_pair(id)

Delete key pair

Permanently deletes a specified key pair. Include the key pair ID in the request path to remove the designated key pair.

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.KeypairApi(api_client)
    id = 56 # int | 

    try:
        # Delete key pair
        api_response = api_instance.delete_key_pair(id)
        print("The response of KeypairApi->delete_key_pair:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling KeypairApi->delete_key_pair: %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 Keypair successfully deleted. -
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]

import_key_pair

ImportKeypairResponse import_key_pair(payload)

Import key pair

Imports a new key pair for secure shell (SSH) access to your resources. To import a new key pair, include the key name, environment name, and public key in the request body. For additional information on importing SSH key pairs, click here.

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.import_keypair_payload import ImportKeypairPayload
from hyperstack.models.import_keypair_response import ImportKeypairResponse
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.KeypairApi(api_client)
    payload = hyperstack.ImportKeypairPayload() # ImportKeypairPayload | 

    try:
        # Import key pair
        api_response = api_instance.import_key_pair(payload)
        print("The response of KeypairApi->import_key_pair:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling KeypairApi->import_key_pair: %s\n" % e)

Parameters

Name Type Description Notes
payload ImportKeypairPayload

Return type

ImportKeypairResponse

Authorization

apiKey, accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Keypair is imported successfully -
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]

list_key_pairs

Keypairs list_key_pairs()

List key pairs

Retrieves a list of your existing SSH key pairs, providing details for each. For additional information on SSH key pairs, click here.

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.keypairs import Keypairs
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.KeypairApi(api_client)

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

Parameters

This endpoint does not need any parameter.

Return type

Keypairs

Authorization

apiKey, accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Retrieval of key pairs list successful. -
400 Bad Request -
401 Unauthorized -
500 Internal Server Error -

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

update_key_pair_name

UpdateKeypairnameresponse update_key_pair_name(id, payload)

Update key pair name

Updates the name of a specified key pair. Include the key pair ID in the request path and the new name of the key pair in the request body.

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.update_keypair_name import UpdateKeypairName
from hyperstack.models.update_keypairnameresponse import UpdateKeypairnameresponse
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.KeypairApi(api_client)
    id = 56 # int | 
    payload = hyperstack.UpdateKeypairName() # UpdateKeypairName | 

    try:
        # Update key pair name
        api_response = api_instance.update_key_pair_name(id, payload)
        print("The response of KeypairApi->update_key_pair_name:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling KeypairApi->update_key_pair_name: %s\n" % e)

Parameters

Name Type Description Notes
id int
payload UpdateKeypairName

Return type

UpdateKeypairnameresponse

Authorization

apiKey, accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Keypair name updated successfully. -
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]