Skip to content

Latest commit

 

History

History
426 lines (322 loc) · 13.8 KB

File metadata and controls

426 lines (322 loc) · 13.8 KB

onepanel.core.api.LabelServiceApi

All URIs are relative to http://localhost:8888

Method HTTP request Description
add_labels POST /apis/v1beta1/{namespace}/{resource}/{uid}/labels
delete_label DELETE /apis/v1beta1/{namespace}/{resource}/{uid}/labels/{key}
get_available_labels GET /apis/v1beta1/{namespace}/{resource}/labels
get_labels GET /apis/v1beta1/{namespace}/{resource}/{uid}/labels
replace_labels PUT /apis/v1beta1/{namespace}/{resource}/{uid}/labels

add_labels

GetLabelsResponse add_labels(namespace, resource, uid, body)

Example

  • Api Key Authentication (Bearer):
from __future__ import print_function
import time
import onepanel.core.api
from onepanel.core.api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8888
# See configuration.py for a list of all supported configuration parameters.
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888"
)

# 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.

# If inside Onepanel you do not need to pass any parameters to `get_access_token`
access_token = onepanel.core.auth.get_access_token(username='<username>', token='<token>', host='<host>')

# Configure API key authorization: Bearer
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888",
    api_key = {
        'authorization': access_token
    }
)
configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with onepanel.core.api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = onepanel.core.api.LabelServiceApi(api_client)
    namespace = 'namespace_example' # str | 
resource = 'resource_example' # str | 
uid = 'uid_example' # str | 
body = onepanel.core.api.Labels() # Labels | 

    try:
        api_response = api_instance.add_labels(namespace, resource, uid, body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling LabelServiceApi->add_labels: %s\n" % e)

Parameters

Name Type Description Notes
namespace str
resource str
uid str
body Labels

Return type

GetLabelsResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/octet-stream

HTTP response details

Status code Description Response headers
200 A successful response. -
0 An unexpected error response. -

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

delete_label

GetLabelsResponse delete_label(namespace, resource, uid, key)

Example

  • Api Key Authentication (Bearer):
from __future__ import print_function
import time
import onepanel.core.api
from onepanel.core.api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8888
# See configuration.py for a list of all supported configuration parameters.
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888"
)

# 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.

# If inside Onepanel you do not need to pass any parameters to `get_access_token`
access_token = onepanel.core.auth.get_access_token(username='<username>', token='<token>', host='<host>')

# Configure API key authorization: Bearer
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888",
    api_key = {
        'authorization': access_token
    }
)
configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with onepanel.core.api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = onepanel.core.api.LabelServiceApi(api_client)
    namespace = 'namespace_example' # str | 
resource = 'resource_example' # str | 
uid = 'uid_example' # str | 
key = 'key_example' # str | 

    try:
        api_response = api_instance.delete_label(namespace, resource, uid, key)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling LabelServiceApi->delete_label: %s\n" % e)

Parameters

Name Type Description Notes
namespace str
resource str
uid str
key str

Return type

GetLabelsResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/octet-stream

HTTP response details

Status code Description Response headers
200 A successful response. -
0 An unexpected error response. -

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

get_available_labels

GetLabelsResponse get_available_labels(namespace, resource, key_like=key_like, skip_keys=skip_keys)

Example

  • Api Key Authentication (Bearer):
from __future__ import print_function
import time
import onepanel.core.api
from onepanel.core.api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8888
# See configuration.py for a list of all supported configuration parameters.
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888"
)

# 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.

# If inside Onepanel you do not need to pass any parameters to `get_access_token`
access_token = onepanel.core.auth.get_access_token(username='<username>', token='<token>', host='<host>')

# Configure API key authorization: Bearer
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888",
    api_key = {
        'authorization': access_token
    }
)
configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with onepanel.core.api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = onepanel.core.api.LabelServiceApi(api_client)
    namespace = 'namespace_example' # str | 
resource = 'resource_example' # str | 
key_like = 'key_like_example' # str |  (optional)
skip_keys = 'skip_keys_example' # str |  (optional)

    try:
        api_response = api_instance.get_available_labels(namespace, resource, key_like=key_like, skip_keys=skip_keys)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling LabelServiceApi->get_available_labels: %s\n" % e)

Parameters

Name Type Description Notes
namespace str
resource str
key_like str [optional]
skip_keys str [optional]

Return type

GetLabelsResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/octet-stream

HTTP response details

Status code Description Response headers
200 A successful response. -
0 An unexpected error response. -

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

get_labels

GetLabelsResponse get_labels(namespace, resource, uid)

Example

  • Api Key Authentication (Bearer):
from __future__ import print_function
import time
import onepanel.core.api
from onepanel.core.api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8888
# See configuration.py for a list of all supported configuration parameters.
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888"
)

# 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.

# If inside Onepanel you do not need to pass any parameters to `get_access_token`
access_token = onepanel.core.auth.get_access_token(username='<username>', token='<token>', host='<host>')

# Configure API key authorization: Bearer
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888",
    api_key = {
        'authorization': access_token
    }
)
configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with onepanel.core.api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = onepanel.core.api.LabelServiceApi(api_client)
    namespace = 'namespace_example' # str | 
resource = 'resource_example' # str | 
uid = 'uid_example' # str | 

    try:
        api_response = api_instance.get_labels(namespace, resource, uid)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling LabelServiceApi->get_labels: %s\n" % e)

Parameters

Name Type Description Notes
namespace str
resource str
uid str

Return type

GetLabelsResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/octet-stream

HTTP response details

Status code Description Response headers
200 A successful response. -
0 An unexpected error response. -

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

replace_labels

GetLabelsResponse replace_labels(namespace, resource, uid, body)

Example

  • Api Key Authentication (Bearer):
from __future__ import print_function
import time
import onepanel.core.api
from onepanel.core.api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:8888
# See configuration.py for a list of all supported configuration parameters.
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888"
)

# 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.

# If inside Onepanel you do not need to pass any parameters to `get_access_token`
access_token = onepanel.core.auth.get_access_token(username='<username>', token='<token>', host='<host>')

# Configure API key authorization: Bearer
configuration = onepanel.core.api.Configuration(
    host = "http://localhost:8888",
    api_key = {
        'authorization': access_token
    }
)
configuration.api_key_prefix['authorization'] = 'Bearer'

# Enter a context with an instance of the API client
with onepanel.core.api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = onepanel.core.api.LabelServiceApi(api_client)
    namespace = 'namespace_example' # str | 
resource = 'resource_example' # str | 
uid = 'uid_example' # str | 
body = onepanel.core.api.Labels() # Labels | 

    try:
        api_response = api_instance.replace_labels(namespace, resource, uid, body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling LabelServiceApi->replace_labels: %s\n" % e)

Parameters

Name Type Description Notes
namespace str
resource str
uid str
body Labels

Return type

GetLabelsResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/octet-stream

HTTP response details

Status code Description Response headers
200 A successful response. -
0 An unexpected error response. -

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