Skip to content

Latest commit

 

History

History
1176 lines (822 loc) · 37.6 KB

File metadata and controls

1176 lines (822 loc) · 37.6 KB

hyperstack.VirtualMachineApi

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

Method HTTP request Description
add_security_rule POST /core/virtual-machines/{id}/sg-rules Add Security Rule
create_instances POST /core/virtual-machines Create Instances
delete_a_security_rule DELETE /core/virtual-machines/{virtual_machine_id}/sg-rules/{sg_rule_id} Delete a security group rule
delete_an_instance DELETE /core/virtual-machines/{id} Delete an instance
get_an_instance_details GET /core/virtual-machines/{id} Get an instance details
hard_reboot_instance GET /core/virtual-machines/{id}/hard-reboot Hard Reboot Instance
hibernate_instance GET /core/virtual-machines/{virtual_machine_id}/hibernate Hibernate Instance
list_instances GET /core/virtual-machines List Instances
resize_virtual_machine POST /core/virtual-machines/{virtual_machine_id}/resize Resize Virtual Machine
restore_instance_from_hibernation GET /core/virtual-machines/{virtual_machine_id}/hibernate-restore Restore Instance from Hibernation
retrieved_metrics_successfully GET /core/virtual-machines/{virtual_machine_id}/metrics Get instance metrics
start_instance GET /core/virtual-machines/{id}/start Start Instance
stop_instance GET /core/virtual-machines/{id}/stop Stop Instance

add_security_rule

SecurityGroupRule add_security_rule(id, payload)

Add Security Rule

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.create_security_rule_payload import CreateSecurityRulePayload
from hyperstack.models.security_group_rule import SecurityGroupRule
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.VirtualMachineApi(api_client)
    id = 56 # int | 
    payload = hyperstack.CreateSecurityRulePayload() # CreateSecurityRulePayload | 

    try:
        # Add Security Rule
        api_response = api_instance.add_security_rule(id, payload)
        print("The response of VirtualMachineApi->add_security_rule:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->add_security_rule: %s\n" % e)

Parameters

Name Type Description Notes
id int
payload CreateSecurityRulePayload

Return type

SecurityGroupRule

Authorization

apiKey, accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Security Rule created 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]

create_instances

Instances create_instances(payload)

Create Instances

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.create_instances_payload import CreateInstancesPayload
from hyperstack.models.instances import Instances
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.VirtualMachineApi(api_client)
    payload = hyperstack.CreateInstancesPayload() # CreateInstancesPayload | 

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

Parameters

Name Type Description Notes
payload CreateInstancesPayload

Return type

Instances

Authorization

apiKey, accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Instances are created successfully -
400 Bad Request -
401 Unauthorized -
404 Not Found -
405 Method Not Allowed -
409 Conflict -
500 Internal Server Error -

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

delete_a_security_rule

ResponseModel delete_a_security_rule(virtual_machine_id, sg_rule_id)

Delete a security group rule

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.VirtualMachineApi(api_client)
    virtual_machine_id = 56 # int | 
    sg_rule_id = 56 # int | 

    try:
        # Delete a security group rule
        api_response = api_instance.delete_a_security_rule(virtual_machine_id, sg_rule_id)
        print("The response of VirtualMachineApi->delete_a_security_rule:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->delete_a_security_rule: %s\n" % e)

Parameters

Name Type Description Notes
virtual_machine_id int
sg_rule_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]

delete_an_instance

ResponseModel delete_an_instance(id)

Delete an instance

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

    try:
        # Delete an instance
        api_response = api_instance.delete_an_instance(id)
        print("The response of VirtualMachineApi->delete_an_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->delete_an_instance: %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]

get_an_instance_details

Instance get_an_instance_details(id)

Get an instance details

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.instance import Instance
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.VirtualMachineApi(api_client)
    id = 56 # int | 

    try:
        # Get an instance details
        api_response = api_instance.get_an_instance_details(id)
        print("The response of VirtualMachineApi->get_an_instance_details:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->get_an_instance_details: %s\n" % e)

Parameters

Name Type Description Notes
id int

Return type

Instance

Authorization

apiKey, accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Getting instance detail successful -
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]

hard_reboot_instance

ResponseModel hard_reboot_instance(id)

Hard Reboot Instance

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

    try:
        # Hard Reboot Instance
        api_response = api_instance.hard_reboot_instance(id)
        print("The response of VirtualMachineApi->hard_reboot_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->hard_reboot_instance: %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]

hibernate_instance

ResponseModel hibernate_instance(virtual_machine_id)

Hibernate Instance

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

    try:
        # Hibernate Instance
        api_response = api_instance.hibernate_instance(virtual_machine_id)
        print("The response of VirtualMachineApi->hibernate_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->hibernate_instance: %s\n" % e)

Parameters

Name Type Description Notes
virtual_machine_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]

list_instances

Instances list_instances()

List Instances

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.instances import Instances
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.VirtualMachineApi(api_client)

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

Parameters

This endpoint does not need any parameter.

Return type

Instances

Authorization

apiKey, accessToken

HTTP request headers

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

HTTP response details

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

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

resize_virtual_machine

ResponseModel resize_virtual_machine(virtual_machine_id, payload)

Resize Virtual Machine

Example

  • Api Key Authentication (apiKey):
  • Api Key Authentication (accessToken):
import hyperstack
from hyperstack.models.instance_resize_payload import InstanceResizePayload
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.VirtualMachineApi(api_client)
    virtual_machine_id = 56 # int | 
    payload = hyperstack.InstanceResizePayload() # InstanceResizePayload | 

    try:
        # Resize Virtual Machine
        api_response = api_instance.resize_virtual_machine(virtual_machine_id, payload)
        print("The response of VirtualMachineApi->resize_virtual_machine:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->resize_virtual_machine: %s\n" % e)

Parameters

Name Type Description Notes
virtual_machine_id int
payload InstanceResizePayload

Return type

ResponseModel

Authorization

apiKey, accessToken

HTTP request headers

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

HTTP response details

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

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

restore_instance_from_hibernation

ResponseModel restore_instance_from_hibernation(virtual_machine_id)

Restore Instance from Hibernation

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

    try:
        # Restore Instance from Hibernation
        api_response = api_instance.restore_instance_from_hibernation(virtual_machine_id)
        print("The response of VirtualMachineApi->restore_instance_from_hibernation:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->restore_instance_from_hibernation: %s\n" % e)

Parameters

Name Type Description Notes
virtual_machine_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]

retrieved_metrics_successfully

ResponseModel retrieved_metrics_successfully(virtual_machine_id, duration=duration)

Get instance metrics

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.VirtualMachineApi(api_client)
    virtual_machine_id = 56 # int | 
    duration = 'duration_example' # str |  (optional)

    try:
        # Get instance metrics
        api_response = api_instance.retrieved_metrics_successfully(virtual_machine_id, duration=duration)
        print("The response of VirtualMachineApi->retrieved_metrics_successfully:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->retrieved_metrics_successfully: %s\n" % e)

Parameters

Name Type Description Notes
virtual_machine_id int
duration str [optional]

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 -
406 Not Acceptable -
500 Internal Server Error -

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

start_instance

ResponseModel start_instance(id)

Start Instance

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

    try:
        # Start Instance
        api_response = api_instance.start_instance(id)
        print("The response of VirtualMachineApi->start_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->start_instance: %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]

stop_instance

ResponseModel stop_instance(id)

Stop Instance

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

    try:
        # Stop Instance
        api_response = api_instance.stop_instance(id)
        print("The response of VirtualMachineApi->stop_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VirtualMachineApi->stop_instance: %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]