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 |
TagsCreateTag201Response create_tag(body=body)
Create Tag
Create a tag. Can only create one tag per request.
- 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)
Name | Type | Description | Notes |
---|---|---|---|
body | str | [optional] |
- Content-Type: application/json
- Accept: application/json
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(tag_id)
Delete Tag
Delete a tag.
tag_id
(path parameter): The unique identifier of the tag.
- 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)
Name | Type | Description | Notes |
---|---|---|---|
tag_id | str |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BlueprintsListBlueprints200Response get_tags(search)
Get Tags
Return configured tags.
- 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)
Name | Type | Description | Notes |
---|---|---|---|
search | str | Return resultes containing a given tag search string. |
BlueprintsListBlueprints200Response
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | * Content-Type - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TagsCreateTag201Response update_tag(tag_id, body=body)
Update Tag
Update tag name.
tag_id
(path parameter): The unique identifier of the tag.
- 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)
Name | Type | Description | Notes |
---|---|---|---|
tag_id | str | ||
body | str | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | * Content-Type - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]