Skip to content

Latest commit

 

History

History
270 lines (203 loc) · 10.4 KB

TagsApi.md

File metadata and controls

270 lines (203 loc) · 10.4 KB

harness_python_sdk.TagsApi

All URIs are relative to https://app.harness.io

Method HTTP request Description
create_tag POST /cf/admin/tags Creates a Tag
delete_tag DELETE /cf/admin/tags/{identifier} Delete a Tag
get_all_tags GET /cf/admin/tags Returns all Tags
get_tag GET /cf/admin/tags/{identifier} Returns a Tag

create_tag

TagResponseMetadata create_tag(body, account_identifier, org_identifier, project_identifier)

Creates a Tag

Create Tags for the given identifier

Example

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.TagsApi(harness_python_sdk.ApiClient(configuration))
body = harness_python_sdk.Tag() # Tag | 
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

try:
    # Creates a Tag
    api_response = api_instance.create_tag(body, account_identifier, org_identifier, project_identifier)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TagsApi->create_tag: %s\n" % e)

Parameters

Name Type Description Notes
body Tag
account_identifier str Account Identifier
org_identifier str Organization Identifier
project_identifier str The Project identifier

Return type

TagResponseMetadata

Authorization

x-api-key

HTTP request headers

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

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

delete_tag

delete_tag(identifier, account_identifier, org_identifier, project_identifier, commit_msg=commit_msg, force_delete=force_delete)

Delete a Tag

Delete Tag for the given identifier and account ID

Example

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.TagsApi(harness_python_sdk.ApiClient(configuration))
identifier = 'identifier_example' # str | Unique identifier for the object in the API.
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
commit_msg = 'commit_msg_example' # str | Git commit message (optional)
force_delete = true # bool | Permanently deletes the the feature flag (optional)

try:
    # Delete a Tag
    api_instance.delete_tag(identifier, account_identifier, org_identifier, project_identifier, commit_msg=commit_msg, force_delete=force_delete)
except ApiException as e:
    print("Exception when calling TagsApi->delete_tag: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Unique identifier for the object in the API.
account_identifier str Account Identifier
org_identifier str Organization Identifier
project_identifier str The Project identifier
commit_msg str Git commit message [optional]
force_delete bool Permanently deletes the the feature flag [optional]

Return type

void (empty response body)

Authorization

x-api-key

HTTP request headers

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

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

get_all_tags

Tags get_all_tags(account_identifier, org_identifier, project_identifier, environment_identifier, page_number=page_number, page_size=page_size, sort_order=sort_order, sort_by_field=sort_by_field, tag_identifier_filter=tag_identifier_filter)

Returns all Tags

Returns all the Tags for the given Account ID

Example

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.TagsApi(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)
sort_order = 'sort_order_example' # str | SortOrder (optional)
sort_by_field = 'sort_by_field_example' # str | SortByField (optional)
tag_identifier_filter = 'tag_identifier_filter_example' # str | Partial Search of Tag Identifiers to filter on (optional)

try:
    # Returns all Tags
    api_response = api_instance.get_all_tags(account_identifier, org_identifier, project_identifier, environment_identifier, page_number=page_number, page_size=page_size, sort_order=sort_order, sort_by_field=sort_by_field, tag_identifier_filter=tag_identifier_filter)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TagsApi->get_all_tags: %s\n" % e)

Parameters

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]
sort_order str SortOrder [optional]
sort_by_field str SortByField [optional]
tag_identifier_filter str Partial Search of Tag Identifiers to filter on [optional]

Return type

Tags

Authorization

x-api-key

HTTP request headers

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

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

get_tag

Feature get_tag(identifier, account_identifier, org_identifier, project_identifier, environment_identifier=environment_identifier, metrics=metrics, archived=archived)

Returns a Tag

Returns details such as identifier,Associated Feature Flag etc for the given Tag

Example

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.TagsApi(harness_python_sdk.ApiClient(configuration))
identifier = 'identifier_example' # str | Unique identifier for the object in the API.
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 (optional)
metrics = true # bool | Parameter to indicate if metrics data is requested in response (optional)
archived = true # bool | Status of the feature flag (optional)

try:
    # Returns a Tag
    api_response = api_instance.get_tag(identifier, account_identifier, org_identifier, project_identifier, environment_identifier=environment_identifier, metrics=metrics, archived=archived)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TagsApi->get_tag: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Unique identifier for the object in the API.
account_identifier str Account Identifier
org_identifier str Organization Identifier
project_identifier str The Project identifier
environment_identifier str Environment [optional]
metrics bool Parameter to indicate if metrics data is requested in response [optional]
archived bool Status of the feature flag [optional]

Return type

Feature

Authorization

x-api-key

HTTP request headers

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

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