Skip to content

Latest commit

 

History

History
984 lines (740 loc) · 32.5 KB

WorkspaceServiceApi.md

File metadata and controls

984 lines (740 loc) · 32.5 KB

onepanel.core.api.WorkspaceServiceApi

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

Method HTTP request Description
create_workspace POST /apis/v1beta1/{namespace}/workspaces
delete_workspace DELETE /apis/v1beta1/{namespace}/workspaces/{uid}
get_workspace GET /apis/v1beta1/{namespace}/workspaces/{uid}
get_workspace_container_logs GET /apis/v1beta1/{namespace}/workspaces/{uid}/containers/{containerName}/logs
get_workspace_statistics_for_namespace GET /apis/v1beta1/{namespace}/workspace/statistics
list_workspaces GET /apis/v1beta1/{namespace}/workspaces
list_workspaces_field GET /apis/v1beta/{namespace}/field/workspaces/{fieldName}
pause_workspace PUT /apis/v1beta1/{namespace}/workspaces/{uid}/pause
resume_workspace PUT /apis/v1beta1/{namespace}/workspaces/{uid}/resume
retry_last_workspace_action PUT /apis/v1beta1/{namespace}/workspaces/{uid}/retry
update_workspace PUT /apis/v1beta1/{namespace}/workspaces/{uid}
update_workspace_status PUT /apis/v1beta1/{namespace}/workspaces/{uid}/status

create_workspace

Workspace create_workspace(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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
body = onepanel.core.api.CreateWorkspaceBody() # CreateWorkspaceBody | 

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

Parameters

Name Type Description Notes
namespace str
body CreateWorkspaceBody

Return type

Workspace

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_workspace

object delete_workspace(namespace, 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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
uid = 'uid_example' # str | 

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

Parameters

Name Type Description Notes
namespace str
uid str

Return type

object

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_workspace

Workspace get_workspace(namespace, 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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
uid = 'uid_example' # str | 

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

Parameters

Name Type Description Notes
namespace str
uid str

Return type

Workspace

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_workspace_container_logs

StreamResultOfLogStreamResponse get_workspace_container_logs(namespace, uid, container_name, since_time=since_time)

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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
uid = 'uid_example' # str | 
container_name = 'container_name_example' # str | 
since_time = 'since_time_example' # str |  (optional)

    try:
        api_response = api_instance.get_workspace_container_logs(namespace, uid, container_name, since_time=since_time)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling WorkspaceServiceApi->get_workspace_container_logs: %s\n" % e)

Parameters

Name Type Description Notes
namespace str
uid str
container_name str
since_time str [optional]

Return type

StreamResultOfLogStreamResponse

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.(streaming responses) -
0 An unexpected error response. -

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

get_workspace_statistics_for_namespace

GetWorkspaceStatisticsForNamespaceResponse get_workspace_statistics_for_namespace(namespace)

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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 

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

Parameters

Name Type Description Notes
namespace str

Return type

GetWorkspaceStatisticsForNamespaceResponse

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]

list_workspaces

ListWorkspaceResponse list_workspaces(namespace, page_size=page_size, page=page, order=order, labels=labels, phase=phase)

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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
page_size = 56 # int |  (optional)
page = 56 # int |  (optional)
order = 'order_example' # str |  (optional)
labels = 'labels_example' # str |  (optional)
phase = 'phase_example' # str |  (optional)

    try:
        api_response = api_instance.list_workspaces(namespace, page_size=page_size, page=page, order=order, labels=labels, phase=phase)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling WorkspaceServiceApi->list_workspaces: %s\n" % e)

Parameters

Name Type Description Notes
namespace str
page_size int [optional]
page int [optional]
order str [optional]
labels str [optional]
phase str [optional]

Return type

ListWorkspaceResponse

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]

list_workspaces_field

ListWorkspacesFieldResponse list_workspaces_field(namespace, field_name)

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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
field_name = 'field_name_example' # str | 

    try:
        api_response = api_instance.list_workspaces_field(namespace, field_name)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling WorkspaceServiceApi->list_workspaces_field: %s\n" % e)

Parameters

Name Type Description Notes
namespace str
field_name str

Return type

ListWorkspacesFieldResponse

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]

pause_workspace

object pause_workspace(namespace, 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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
uid = 'uid_example' # str | 

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

Parameters

Name Type Description Notes
namespace str
uid str

Return type

object

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]

resume_workspace

object resume_workspace(namespace, 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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
uid = 'uid_example' # str | 
body = onepanel.core.api.UpdateWorkspaceBody() # UpdateWorkspaceBody | 

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

Parameters

Name Type Description Notes
namespace str
uid str
body UpdateWorkspaceBody

Return type

object

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]

retry_last_workspace_action

object retry_last_workspace_action(namespace, 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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
uid = 'uid_example' # str | 

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

Parameters

Name Type Description Notes
namespace str
uid str

Return type

object

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]

update_workspace

object update_workspace(namespace, 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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
uid = 'uid_example' # str | 
body = onepanel.core.api.UpdateWorkspaceBody() # UpdateWorkspaceBody | 

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

Parameters

Name Type Description Notes
namespace str
uid str
body UpdateWorkspaceBody

Return type

object

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]

update_workspace_status

object update_workspace_status(namespace, 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.WorkspaceServiceApi(api_client)
    namespace = 'namespace_example' # str | 
uid = 'uid_example' # str | 
body = onepanel.core.api.WorkspaceStatus() # WorkspaceStatus | 

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

Parameters

Name Type Description Notes
namespace str
uid str
body WorkspaceStatus

Return type

object

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]