Skip to content

Latest commit

 

History

History
327 lines (223 loc) · 9.3 KB

TagsApi.md

File metadata and controls

327 lines (223 loc) · 9.3 KB

kandji.TagsApi

All URIs are relative to https://<sub_domain>.api.kandji.io

Method HTTP request Description
create_tag POST /api/v1/tags Create Tag
delete_tag DELETE /api/v1/tags/{tag_id} Delete Tag
get_tags GET /api/v1/tags Get Tags
update_tag PATCH /api/v1/tags/{tag_id} Update Tag

create_tag

TagsCreateTag201Response create_tag(body=body)

Create Tag

Create a tag. Can only create one tag per request.

Example

  • Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.tags_create_tag201_response import TagsCreateTag201Response
from kandji.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
    host = "https://<sub_domain>.api.kandji.io"
)

# 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 Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kandji.TagsApi(api_client)
    body = {"name":"accuhive_01"} # str |  (optional)

    try:
        # Create Tag
        api_response = api_instance.create_tag(body=body)
        print("The response of TagsApi->create_tag:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TagsApi->create_tag: %s\n" % e)

Parameters

Name Type Description Notes
body str [optional]

Return type

TagsCreateTag201Response

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Created * Content-Type -

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

delete_tag

delete_tag(tag_id)

Delete Tag

Delete a tag.

Request Parameters

tag_id (path parameter): The unique identifier of the tag.

Example

  • Bearer (API Token) Authentication (bearer):
import kandji
from kandji.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
    host = "https://<sub_domain>.api.kandji.io"
)

# 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 Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kandji.TagsApi(api_client)
    tag_id = 'tag_id_example' # str | 

    try:
        # Delete Tag
        api_instance.delete_tag(tag_id)
    except Exception as e:
        print("Exception when calling TagsApi->delete_tag: %s\n" % e)

Parameters

Name Type Description Notes
tag_id str

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 No Content -

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

get_tags

BlueprintsListBlueprints200Response get_tags(search)

Get Tags

Return configured tags.

Example

  • Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.blueprints_list_blueprints200_response import BlueprintsListBlueprints200Response
from kandji.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
    host = "https://<sub_domain>.api.kandji.io"
)

# 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 Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kandji.TagsApi(api_client)
    search = 'accuhive' # str | Return resultes containing a given tag search string.

    try:
        # Get Tags
        api_response = api_instance.get_tags(search)
        print("The response of TagsApi->get_tags:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TagsApi->get_tags: %s\n" % e)

Parameters

Name Type Description Notes
search str Return resultes containing a given tag search string.

Return type

BlueprintsListBlueprints200Response

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK * Content-Type -

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

update_tag

TagsCreateTag201Response update_tag(tag_id, body=body)

Update Tag

Update tag name.

Request Parameters

tag_id (path parameter): The unique identifier of the tag.

Example

  • Bearer (API Token) Authentication (bearer):
import kandji
from kandji.models.tags_create_tag201_response import TagsCreateTag201Response
from kandji.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://<sub_domain>.api.kandji.io
# See configuration.py for a list of all supported configuration parameters.
configuration = kandji.Configuration(
    host = "https://<sub_domain>.api.kandji.io"
)

# 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 Bearer authorization (API Token): bearer
configuration = kandji.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with kandji.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kandji.TagsApi(api_client)
    tag_id = 'tag_id_example' # str | 
    body = {"name":"accuhive_02"} # str |  (optional)

    try:
        # Update Tag
        api_response = api_instance.update_tag(tag_id, body=body)
        print("The response of TagsApi->update_tag:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TagsApi->update_tag: %s\n" % e)

Parameters

Name Type Description Notes
tag_id str
body str [optional]

Return type

TagsCreateTag201Response

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK * Content-Type -

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