Skip to content

Latest commit

 

History

History
344 lines (239 loc) · 11 KB

File metadata and controls

344 lines (239 loc) · 11 KB

hyperstack.ComplianceApi

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

Method HTTP request Description
create_compliance POST /core/compliance Create compliance
delete_compliance DELETE /core/compliance/{gpu_model} Delete a compliance
get_compliance GET /core/compliance Retrieve GPU compliance
update_compliance PUT /core/compliance Update a compliance

create_compliance

CreateUpdateComplianceResponse create_compliance(payload)

Create compliance

Example

  • Api Key Authentication (apiKey):
import hyperstack
from hyperstack.models.compliance_payload import CompliancePayload
from hyperstack.models.create_update_compliance_response import CreateUpdateComplianceResponse
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'

# 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.ComplianceApi(api_client)
    payload = hyperstack.CompliancePayload() # CompliancePayload | 

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

Parameters

Name Type Description Notes
payload CompliancePayload

Return type

CreateUpdateComplianceResponse

Authorization

apiKey

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 -
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_compliance

ResponseModel delete_compliance(gpu_model)

Delete a compliance

Example

  • Api Key Authentication (apiKey):
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'

# 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.ComplianceApi(api_client)
    gpu_model = 'gpu_model_example' # str | 

    try:
        # Delete a compliance
        api_response = api_instance.delete_compliance(gpu_model)
        print("The response of ComplianceApi->delete_compliance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ComplianceApi->delete_compliance: %s\n" % e)

Parameters

Name Type Description Notes
gpu_model str

Return type

ResponseModel

Authorization

apiKey

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_compliance

ComplianceResponse get_compliance(gpu=gpu)

Retrieve GPU compliance

Returns a list of compliance objects each corresponding to available GPU models. These compliance objects contain minimum and maximum values for RAM in GB, number of vCPUs, and system disk capacity in GB. Use the optional gpu model parameter in the query string to filter responses by GPU model. For additional details on GPU compliance, click here.

Example

  • Api Key Authentication (apiKey):
import hyperstack
from hyperstack.models.compliance_response import ComplianceResponse
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'

# 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.ComplianceApi(api_client)
    gpu = 'gpu_example' # str | This is for gpu model (optional)

    try:
        # Retrieve GPU compliance
        api_response = api_instance.get_compliance(gpu=gpu)
        print("The response of ComplianceApi->get_compliance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ComplianceApi->get_compliance: %s\n" % e)

Parameters

Name Type Description Notes
gpu str This is for gpu model [optional]

Return type

ComplianceResponse

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Compliance list retrieved successfully. -
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]

update_compliance

CreateUpdateComplianceResponse update_compliance(payload)

Update a compliance

Example

  • Api Key Authentication (apiKey):
import hyperstack
from hyperstack.models.compliance_payload import CompliancePayload
from hyperstack.models.create_update_compliance_response import CreateUpdateComplianceResponse
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'

# 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.ComplianceApi(api_client)
    payload = hyperstack.CompliancePayload() # CompliancePayload | 

    try:
        # Update a compliance
        api_response = api_instance.update_compliance(payload)
        print("The response of ComplianceApi->update_compliance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ComplianceApi->update_compliance: %s\n" % e)

Parameters

Name Type Description Notes
payload CompliancePayload

Return type

CreateUpdateComplianceResponse

Authorization

apiKey

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]