Skip to main content

Nutanix Karbon Platform Services

Project description

KPS API

Documentation for Nutanix Karbon Platform Services python sdk.

Requirements.

Python 3.4+

Installation & Usage

The python package is hosted on PyPi

pip install kps-api

(you may need to run pip with root permission: sudo pip install kps-api)

Then import the package:

import kps_api 

Getting Started

from __future__ import print_function
import time
import kps_api
from kps_api.rest import ApiException
from pprint import pprint

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
body = kps_api.ApplicationV2() # ApplicationV2 | Describes the application creation request.
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.

try:
    # Create an application.
    api_response = api_instance.application_create_v2(body, authorization)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->application_create_v2: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
id = 'id_example' # str | ID of the entity

try:
    # Delete application specified by the application ID.
    api_response = api_instance.application_delete_v2(authorization, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->application_delete_v2: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
id = 'id_example' # str | ID of the entity

try:
    # Get application by application ID.
    api_response = api_instance.application_get_v2(authorization, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->application_get_v2: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
page_index = 789 # int | 0-based index of the page to fetch results. (optional)
page_size = 789 # int | Item count of each page. (optional)
order_by = ['order_by_example'] # list[str] | Specify result order. Zero or more entries with format: &ltkey> [desc] where orderByKeys lists allowed keys in each response. (optional)
filter = 'filter_example' # str | Specify result filter. Format is similar to a SQL WHERE clause. For example, to filter object by name with prefix foo, use: name LIKE 'foo%'. Supported filter keys are the same as order by keys. (optional)

try:
    # Get all applications.
    api_response = api_instance.application_list_v2(authorization, page_index=page_index, page_size=page_size, order_by=order_by, filter=filter)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->application_list_v2: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
body = kps_api.ApplicationV2() # ApplicationV2 | 
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
id = 'id_example' # str | ID of the entity

try:
    # Update a specific application with ID {id}.
    api_response = api_instance.application_update_v3(body, authorization, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->application_update_v3: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
id = 'id_example' # str | ID of the entity
edge_id = 'edge_id_example' # str | ID for the edge

try:
    # Get containers of an application specified by Application ID running on a specific edge.
    api_response = api_instance.get_application_containers(authorization, id, edge_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->get_application_containers: %s\n" % e)

# Configure API key authorization: BearerToken
configuration = kps_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = kps_api.ApplicationApi(kps_api.ApiClient(configuration))
authorization = 'authorization_example' # str | Format: Bearer <token>, with <token> from login API response.
project_id = 'project_id_example' # str | ID for the project
page_index = 789 # int | 0-based index of the page to fetch results. (optional)
page_size = 789 # int | Item count of each page. (optional)
order_by = ['order_by_example'] # list[str] | Specify result order. Zero or more entries with format: &ltkey> [desc] where orderByKeys lists allowed keys in each response. (optional)
filter = 'filter_example' # str | Specify result filter. Format is similar to a SQL WHERE clause. For example, to filter object by name with prefix foo, use: name LIKE 'foo%'. Supported filter keys are the same as order by keys. (optional)

try:
    # Get all applications in a project according to project ID.
    api_response = api_instance.project_get_applications_v2(authorization, project_id, page_index=page_index, page_size=page_size, order_by=order_by, filter=filter)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ApplicationApi->project_get_applications_v2: %s\n" % e)

Documentation for API Endpoints

The documentation for the Nutanix Karbon Platform Services API endpoints can be found on Nutanix.dev

BearerToken

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

karbon-platform-services-api@nutanix.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kps_api-1.0.1262.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kps_api-1.0.1262-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file kps_api-1.0.1262.tar.gz.

File metadata

  • Download URL: kps_api-1.0.1262.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for kps_api-1.0.1262.tar.gz
Algorithm Hash digest
SHA256 bfb9c4a043c400a49f32c7064e7331d1758d32a3d2ce38da20effbcf24665ee7
MD5 0bde14795c65572f6072e1a3500a86bc
BLAKE2b-256 ef16ef2da832a237aed6a5490d206e52971eae236d71dfe7db695e111ea3a653

See more details on using hashes here.

File details

Details for the file kps_api-1.0.1262-py3-none-any.whl.

File metadata

  • Download URL: kps_api-1.0.1262-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for kps_api-1.0.1262-py3-none-any.whl
Algorithm Hash digest
SHA256 5cc8ee9090abd0b97f1d29c58e2b820891f4e1a3d46018b010774b653953a0c5
MD5 ce20556cd79467ba21fb9287a33cd46e
BLAKE2b-256 8d810b540e5903629e6550ca51ce574c27161adab58d0387ffee4e9f08dc3e20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page