From 4af6e4e8667f57bda86e2960c568c51a2119e5dc Mon Sep 17 00:00:00 2001 From: pollfly <75068813+pollfly@users.noreply.github.com> Date: Tue, 12 Jul 2022 12:33:21 +0300 Subject: [PATCH] Add APIClient intro page (#289) --- docs/clearml_sdk/apiclient_sdk.md | 32 +++++++++++++++++++++++++++++++ docs/clearml_sdk/clearml_sdk.md | 5 +++++ sidebars.js | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 docs/clearml_sdk/apiclient_sdk.md diff --git a/docs/clearml_sdk/apiclient_sdk.md b/docs/clearml_sdk/apiclient_sdk.md new file mode 100644 index 00000000..ad2a6bd4 --- /dev/null +++ b/docs/clearml_sdk/apiclient_sdk.md @@ -0,0 +1,32 @@ +--- +title: APIClient +--- + +The `APIClient` class provides a Pythonic interface to access ClearML's backend REST API. It is a convenient low-level access tool. +Through an `APIClient` instance, you can access ClearML’s REST API services: +* [authentication](../references/api/login.md) - Authentication management, authorization and administration for the entire system +* [debug](../references/api/debug.md) - Debugging utilities +* [projects](../references/api/projects.md) - Support for defining Projects containing tasks, models, datasets, and/or pipelines +* [queues](../references/api/queues.md) - [Queue](../fundamentals/agents_and_queues.md) management API +* [workers](../references/api/workers.md) - API for worker machines to report status and retrieve tasks for execution. +* [events](../references/api/events.md) - Event (e.g. metrics, debug samples) reporting and retrieval API +* [models](../references/api/models.md) - Model management API +* [tasks](../references/api/tasks.md) - [Task](../fundamentals/task.md) Management API + +## Using APIClient + +`APIClient` makes the ClearML Server’s REST API endpoints available as Python methods. + +To use `APIClient`, create an instance of it then call the method corresponding to the desired REST API endpoints, with +its respective parameters as described in the [REST API reference page](../references/api/index.md). + +For example, the [`POST/ projects.get_all`](../references/api/projects.md#post-projectsget_all) call returns all projects +in your workspace. The following code uses APIClient to retrieve a list of all projects whose name starts with "example." + +```python +from clearml.backend_api.session.client import APIClient +# Create an instance of APIClient +client = APIClient() +project_list = client.projects.get_all(name="example*") +print(project_list) +``` \ No newline at end of file diff --git a/docs/clearml_sdk/clearml_sdk.md b/docs/clearml_sdk/clearml_sdk.md index b428bc10..44c4af11 100644 --- a/docs/clearml_sdk/clearml_sdk.md +++ b/docs/clearml_sdk/clearml_sdk.md @@ -84,6 +84,11 @@ including local folders, S3, Google Cloud Storage, Azure Storage, and http(s). See the [StorageManager SDK reference page](../references/sdk/storage.md). +### APIClient +The `APIClient` class provides a Pythonic interface to access ClearML's backend REST API. + +See an [overview](apiclient_sdk.md) for APIClient usage. + ### ClearmlJob Use the ClearmlJob to create and manage jobs based on existing tasks. The class supports changing a job's parameters, configurations, and other execution details. diff --git a/sidebars.js b/sidebars.js index 3961a619..2488a7e0 100644 --- a/sidebars.js +++ b/sidebars.js @@ -15,7 +15,7 @@ module.exports = { }, 'getting_started/architecture']}, {'ClearML Fundamentals': ['fundamentals/projects', 'fundamentals/task', 'fundamentals/hyperparameters', 'fundamentals/artifacts', 'fundamentals/logger', 'fundamentals/agents_and_queues', 'fundamentals/hpo']}, - {'ClearML SDK': ['clearml_sdk/clearml_sdk', 'clearml_sdk/task_sdk', 'clearml_sdk/model_sdk']}, + {'ClearML SDK': ['clearml_sdk/clearml_sdk', 'clearml_sdk/task_sdk', 'clearml_sdk/model_sdk', 'clearml_sdk/apiclient_sdk']}, 'clearml_agent', {'ClearML Pipelines':['pipelines/pipelines', {"Building Pipelines":