Skip to content

Latest commit

 

History

History
355 lines (247 loc) · 11.5 KB

File metadata and controls

355 lines (247 loc) · 11.5 KB

hyperstack.ImageApi

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

Method HTTP request Description
delete_image DELETE /core/images/{id} Delete an image
fetch_image_name_availability GET /core/image/name-availability/{name} Fetch name availability for Images
get_image GET /core/images/{id} Get Private Image Details
list_images GET /core/images List Images

delete_image

ResponseModel delete_image(id)

Delete an image

Deletes an image permanently. Provide the image ID in the path to specify the image to be deleted.

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

    try:
        # Delete an image
        api_response = api_instance.delete_image(id)
        print("The response of ImageApi->delete_image:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImageApi->delete_image: %s\n" % e)

Parameters

Name Type Description Notes
id int

Return type

ResponseModel

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Image 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]

fetch_image_name_availability

NameAvailableModel fetch_image_name_availability(name)

Fetch name availability for Images

Check if an Image name is available

Example

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

# 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.ImageApi(api_client)
    name = 'name_example' # str | 

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

Parameters

Name Type Description Notes
name str

Return type

NameAvailableModel

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_image

Image get_image(id, include_related_vms=include_related_vms)

Get Private Image Details

Retrieve details of a specific image by providing the image ID.

Example

  • Api Key Authentication (apiKey):
import hyperstack
from hyperstack.models.image import Image
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.ImageApi(api_client)
    id = 56 # int | 
    include_related_vms = True # bool |  (optional)

    try:
        # Get Private Image Details
        api_response = api_instance.get_image(id, include_related_vms=include_related_vms)
        print("The response of ImageApi->get_image:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImageApi->get_image: %s\n" % e)

Parameters

Name Type Description Notes
id int
include_related_vms bool [optional]

Return type

Image

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Image details retrieved 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]

list_images

Images list_images(region=region, include_public=include_public, search=search, page=page, per_page=per_page)

List Images

Returns a list of all available operating system (OS) images, providing details about each image's corresponding virtual machine operating system. You can include the optional region parameter in the query string of the request to specifically return OS images from the designated region. Additionally, use the include_public parameter to specify whether to include public images in the response. For more information onOS images, click here.

Example

  • Api Key Authentication (apiKey):
import hyperstack
from hyperstack.models.images import Images
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.ImageApi(api_client)
    region = 'region_example' # str | Region Name (optional)
    include_public = True # bool | Flag to include public images in the response (true/false). Default is true. (optional)
    search = 'search_example' # str | Search query to filter images by name (optional)
    page = 56 # int | Page number for pagination (optional)
    per_page = 56 # int | Number of Images per page (optional)

    try:
        # List Images
        api_response = api_instance.list_images(region=region, include_public=include_public, search=search, page=page, per_page=per_page)
        print("The response of ImageApi->list_images:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ImageApi->list_images: %s\n" % e)

Parameters

Name Type Description Notes
region str Region Name [optional]
include_public bool Flag to include public images in the response (true/false). Default is true. [optional]
search str Search query to filter images by name [optional]
page int Page number for pagination [optional]
per_page int Number of Images per page [optional]

Return type

Images

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Retrieval of images list successful. -
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]