All URIs are relative to https://app.harness.io
Method | HTTP request | Description |
---|---|---|
add_api_key | POST /cf/admin/apikey | Creates an API key for the given Environment |
delete_api_key | DELETE /cf/admin/apikey/{identifier} | Deletes an API Key |
get_all_api_keys | GET /cf/admin/apikey | Returns API Keys for an Environment |
get_api_key | GET /cf/admin/apikey/{identifier} | Returns API keys |
update_api_key | PUT /cf/admin/apikey/{identifier} | Updates an API Key |
CfApiKey add_api_key(account_identifier, org_identifier, environment_identifier, project_identifier, body=body)
Creates an API key for the given Environment
Creates an API key for the given Environment
from __future__ import print_function
import time
import harness_python_sdk
from harness_python_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: x-api-key
configuration = harness_python_sdk.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# create an instance of the API class
api_instance = harness_python_sdk.APIKeysApi(harness_python_sdk.ApiClient(configuration))
account_identifier = 'account_identifier_example' # str | Account Identifier
org_identifier = 'org_identifier_example' # str | Organization Identifier
environment_identifier = 'environment_identifier_example' # str | Environment Identifier
project_identifier = 'project_identifier_example' # str | The Project identifier
body = NULL # object | (optional)
try:
# Creates an API key for the given Environment
api_response = api_instance.add_api_key(account_identifier, org_identifier, environment_identifier, project_identifier, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling APIKeysApi->add_api_key: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
account_identifier | str | Account Identifier | |
org_identifier | str | Organization Identifier | |
environment_identifier | str | Environment Identifier | |
project_identifier | str | The Project identifier | |
body | object | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_api_key(identifier, project_identifier, environment_identifier, account_identifier, org_identifier)
Deletes an API Key
Deletes an API key for the given identifier
from __future__ import print_function
import time
import harness_python_sdk
from harness_python_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: x-api-key
configuration = harness_python_sdk.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# create an instance of the API class
api_instance = harness_python_sdk.APIKeysApi(harness_python_sdk.ApiClient(configuration))
identifier = 'identifier_example' # str | Unique identifier for the object in the API.
project_identifier = 'project_identifier_example' # str | The Project identifier
environment_identifier = 'environment_identifier_example' # str | Environment Identifier
account_identifier = 'account_identifier_example' # str | Account Identifier
org_identifier = 'org_identifier_example' # str | Organization Identifier
try:
# Deletes an API Key
api_instance.delete_api_key(identifier, project_identifier, environment_identifier, account_identifier, org_identifier)
except ApiException as e:
print("Exception when calling APIKeysApi->delete_api_key: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Unique identifier for the object in the API. | |
project_identifier | str | The Project identifier | |
environment_identifier | str | Environment Identifier | |
account_identifier | str | Account Identifier | |
org_identifier | str | Organization Identifier |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiKeys get_all_api_keys(account_identifier, org_identifier, project_identifier, environment_identifier, page_number=page_number, page_size=page_size)
Returns API Keys for an Environment
Returns all the API Keys for an Environment
from __future__ import print_function
import time
import harness_python_sdk
from harness_python_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: x-api-key
configuration = harness_python_sdk.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# create an instance of the API class
api_instance = harness_python_sdk.APIKeysApi(harness_python_sdk.ApiClient(configuration))
account_identifier = 'account_identifier_example' # str | Account Identifier
org_identifier = 'org_identifier_example' # str | Organization Identifier
project_identifier = 'project_identifier_example' # str | The Project identifier
environment_identifier = 'environment_identifier_example' # str | Environment Identifier
page_number = 56 # int | PageNumber (optional)
page_size = 56 # int | PageSize (optional)
try:
# Returns API Keys for an Environment
api_response = api_instance.get_all_api_keys(account_identifier, org_identifier, project_identifier, environment_identifier, page_number=page_number, page_size=page_size)
pprint(api_response)
except ApiException as e:
print("Exception when calling APIKeysApi->get_all_api_keys: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
account_identifier | str | Account Identifier | |
org_identifier | str | Organization Identifier | |
project_identifier | str | The Project identifier | |
environment_identifier | str | Environment Identifier | |
page_number | int | PageNumber | [optional] |
page_size | int | PageSize | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CfApiKey get_api_key(identifier, project_identifier, environment_identifier, account_identifier, org_identifier)
Returns API keys
Returns all the API Keys for the given identifier
from __future__ import print_function
import time
import harness_python_sdk
from harness_python_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: x-api-key
configuration = harness_python_sdk.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# create an instance of the API class
api_instance = harness_python_sdk.APIKeysApi(harness_python_sdk.ApiClient(configuration))
identifier = 'identifier_example' # str | Unique identifier for the object in the API.
project_identifier = 'project_identifier_example' # str | The Project identifier
environment_identifier = 'environment_identifier_example' # str | Environment Identifier
account_identifier = 'account_identifier_example' # str | Account Identifier
org_identifier = 'org_identifier_example' # str | Organization Identifier
try:
# Returns API keys
api_response = api_instance.get_api_key(identifier, project_identifier, environment_identifier, account_identifier, org_identifier)
pprint(api_response)
except ApiException as e:
print("Exception when calling APIKeysApi->get_api_key: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Unique identifier for the object in the API. | |
project_identifier | str | The Project identifier | |
environment_identifier | str | Environment Identifier | |
account_identifier | str | Account Identifier | |
org_identifier | str | Organization Identifier |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_api_key(project_identifier, environment_identifier, account_identifier, org_identifier, identifier, body=body)
Updates an API Key
Updates an API key for the given identifier
from __future__ import print_function
import time
import harness_python_sdk
from harness_python_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: x-api-key
configuration = harness_python_sdk.Configuration()
configuration.api_key['x-api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# create an instance of the API class
api_instance = harness_python_sdk.APIKeysApi(harness_python_sdk.ApiClient(configuration))
project_identifier = 'project_identifier_example' # str | The Project identifier
environment_identifier = 'environment_identifier_example' # str | Environment Identifier
account_identifier = 'account_identifier_example' # str | Account Identifier
org_identifier = 'org_identifier_example' # str | Organization Identifier
identifier = 'identifier_example' # str | Unique identifier for the object in the API.
body = NULL # object | (optional)
try:
# Updates an API Key
api_instance.update_api_key(project_identifier, environment_identifier, account_identifier, org_identifier, identifier, body=body)
except ApiException as e:
print("Exception when calling APIKeysApi->update_api_key: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_identifier | str | The Project identifier | |
environment_identifier | str | Environment Identifier | |
account_identifier | str | Account Identifier | |
org_identifier | str | Organization Identifier | |
identifier | str | Unique identifier for the object in the API. | |
body | object | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]