Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Latest commit

 

History

History
275 lines (199 loc) · 8.13 KB

TagApi.md

File metadata and controls

275 lines (199 loc) · 8.13 KB

roccclient.TagApi

All URIs are relative to https://rocc.org/api/v1

Method HTTP request Description
create_tag POST /tags Create a tag
delete_tag DELETE /tags/{tagId} Delete a tag
get_tag GET /tags/{tagId} Get a tag
list_tags GET /tags Get all tags

create_tag

TagCreateResponse create_tag(tag_id, tag_create_request=tag_create_request)

Create a tag

Create a tag with the specified name

Example

from __future__ import print_function
import time
import roccclient
from roccclient.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://rocc.org/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = roccclient.Configuration(
    host = "https://rocc.org/api/v1"
)


# Enter a context with an instance of the API client
with roccclient.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = roccclient.TagApi(api_client)
    tag_id = 'tag_id_example' # str | The ID of the tag that is being created
tag_create_request = roccclient.TagCreateRequest() # TagCreateRequest |  (optional)

    try:
        # Create a tag
        api_response = api_instance.create_tag(tag_id, tag_create_request=tag_create_request)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TagApi->create_tag: %s\n" % e)

Parameters

Name Type Description Notes
tag_id str The ID of the tag that is being created
tag_create_request TagCreateRequest [optional]

Return type

TagCreateResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Success -
400 Invalid request -
409 The request conflicts with current state of the target resource -
500 The request cannot be fulfilled due to an unexpected server error -

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

delete_tag

object delete_tag(tag_id)

Delete a tag

Deletes the tag specified

Example

from __future__ import print_function
import time
import roccclient
from roccclient.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://rocc.org/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = roccclient.Configuration(
    host = "https://rocc.org/api/v1"
)


# Enter a context with an instance of the API client
with roccclient.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = roccclient.TagApi(api_client)
    tag_id = 'tag_id_example' # str | The ID of the tag

    try:
        # Delete a tag
        api_response = api_instance.delete_tag(tag_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TagApi->delete_tag: %s\n" % e)

Parameters

Name Type Description Notes
tag_id str The ID of the tag

Return type

object

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
404 The specified resource was not found -
500 The request cannot be fulfilled due to an unexpected server error -

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

get_tag

Tag get_tag(tag_id)

Get a tag

Returns the tag specified

Example

from __future__ import print_function
import time
import roccclient
from roccclient.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://rocc.org/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = roccclient.Configuration(
    host = "https://rocc.org/api/v1"
)


# Enter a context with an instance of the API client
with roccclient.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = roccclient.TagApi(api_client)
    tag_id = 'tag_id_example' # str | The ID of the tag

    try:
        # Get a tag
        api_response = api_instance.get_tag(tag_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TagApi->get_tag: %s\n" % e)

Parameters

Name Type Description Notes
tag_id str The ID of the tag

Return type

Tag

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
404 The specified resource was not found -
500 The request cannot be fulfilled due to an unexpected server error -

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

list_tags

PageOfTags list_tags(limit=limit, offset=offset, filter=filter)

Get all tags

Returns the tags

Example

from __future__ import print_function
import time
import roccclient
from roccclient.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://rocc.org/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = roccclient.Configuration(
    host = "https://rocc.org/api/v1"
)


# Enter a context with an instance of the API client
with roccclient.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = roccclient.TagApi(api_client)
    limit = 10 # int | Maximum number of results returned (optional) (default to 10)
offset = 0 # int | Index of the first result that must be returned (optional) (default to 0)
filter = roccclient.TagFilter() # TagFilter | Object that describes how to filter the results (optional)

    try:
        # Get all tags
        api_response = api_instance.list_tags(limit=limit, offset=offset, filter=filter)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling TagApi->list_tags: %s\n" % e)

Parameters

Name Type Description Notes
limit int Maximum number of results returned [optional] [default to 10]
offset int Index of the first result that must be returned [optional] [default to 0]
filter TagFilter Object that describes how to filter the results [optional]

Return type

PageOfTags

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
400 Invalid request -
500 The request cannot be fulfilled due to an unexpected server error -

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