Skip to content

Latest commit

 

History

History
168 lines (124 loc) · 5.39 KB

NamespaceServiceApi.md

File metadata and controls

168 lines (124 loc) · 5.39 KB

onepanel.core.api.NamespaceServiceApi

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

Method HTTP request Description
create_namespace POST /apis/v1beta1/namespaces
list_namespaces GET /apis/v1beta1/namespaces

create_namespace

Namespace create_namespace(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.NamespaceServiceApi(api_client)
    body = onepanel.core.api.Namespace() # Namespace | 

    try:
        api_response = api_instance.create_namespace(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling NamespaceServiceApi->create_namespace: %s\n" % e)

Parameters

Name Type Description Notes
body Namespace

Return type

Namespace

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]

list_namespaces

ListNamespacesResponse list_namespaces(page_size=page_size, page=page, query=query)

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.NamespaceServiceApi(api_client)
    page_size = 56 # int |  (optional)
page = 56 # int |  (optional)
query = 'query_example' # str |  (optional)

    try:
        api_response = api_instance.list_namespaces(page_size=page_size, page=page, query=query)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling NamespaceServiceApi->list_namespaces: %s\n" % e)

Parameters

Name Type Description Notes
page_size int [optional]
page int [optional]
query str [optional]

Return type

ListNamespacesResponse

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]