DataSphere API overview
In DataSphere, you can perform all basic operations on resources and notebooks using both the UI and API.
The Yandex Cloud API
Working with the community
With CommunityService
calls and Community
methods, you can create, update, and delete a community. You can also view a list of communities in a particular organization.
Description | gRPC | REST |
---|---|---|
Creates a new community in the specified organization | Create | create |
Updates a community | Update | update |
Deletes a community | Delete | delete |
Returns information about a community | Get | get |
Returns a list of communities in the specified organization | List | list |
Example. Creating a community:
grpcurl -rpc-header "Authorization: Bearer <IAM_token>" \
-d '{"organization_id": "<organization_ID>"}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v2.CommunityService/Create
Example. Viewing a list of communities in an organization:
grpcurl -rpc-header "Authorization: Bearer <IAM_token>" \
-d '{"organization_id": "<organization_ID>"}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v2.CommunityService/List
For more information about the CommunityService
calls, see the API documentation.
Example. Creating a community:
curl -H "Authorization: Bearer <IAM_token>" \
-X POST "https://datasphere.api.cloud.yandex.net/datasphere/v2/communities" \
-d '{ "organizationId": "<organization_ID>" }'
Example. Viewing a list of communities in an organization:
curl -H "Authorization: Bearer <IAM_token>" \
-X GET "https://datasphere.api.cloud.yandex.net/datasphere/v2/communities" \
-d '{ "organizationId": "<organization_ID>" }'
For more information about the Community
methods, see the API documentation.
Working with projects
With ProjectService
calls and Project
methods, you can create, open, update, or delete a project. You can also view a list of projects in a particular community.
Description | gRPC | REST |
---|---|---|
Creates a new project in the specified community | Create | create |
Updates a project | Update | update |
Deletes a project | Delete | delete |
Opens a project | Open | open |
Returns information about a project | Get | get |
Retrieves the list of projects in the specified community | List | list |
Example. Creating a project:
grpcurl -rpc-header "Authorization: Bearer <IAM_token>" \
-d '{"community_id": "<community_ID>"}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v2.ProjectService/Create
Example. Viewing a list of folder projects:
grpcurl -rpc-header "Authorization: Bearer <IAM_token>" \
-d '{"community_id": "<community_ID>"}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v2.ProjectService/List
For more information about the ProjectService
calls, see the API documentation.
Example. Creating a project:
curl -H "Authorization: Bearer <IAM_token>" \
-X POST "https://datasphere.api.cloud.yandex.net/datasphere/v2/projects" \
-d '{ "communityId": "<community_ID>" }'
Example. Viewing a list of community projects:
curl -H "Authorization: Bearer <IAM_token>" \
-X GET "https://datasphere.api.cloud.yandex.net/datasphere/v2/projects" \
-d '{ "communityId": "<community_ID>" }'
For more information about the Project
methods, see the API documentation.
Working with notebooks
To run a notebook, you can use the Execute
call or the execute
method in ProjectService
.
Description | gRPC | REST |
---|---|---|
Runs the specified notebook | Execute | execute |
Example. Running the whole notebook:
grpcurl -rpc-header "Authorization: Bearer <IAM_token>" \
-d '{"project_id": "<project_ID>", "target": "notebook_id", "notebook_id": "<notebook_ID>"}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v2.ProjectService/Execute
To get the notebook ID, follow this guide: Getting a notebook ID.
For more information about the ProjectService
calls, see the API documentation.
Example. Running the whole notebook:
curl -H "Authorization: Bearer <IAM_token>" \
-X POST "https://datasphere.api.cloud.yandex.net/datasphere/v2/projects/<project_ID>:execute" \
-d '{ "notebook_id": "<notebook_ID>" }'
To get the notebook ID, follow this guide: Getting a notebook ID.
For more information about the Project
methods, see the API documentation.
Access management
You can use the API to set up access to a project (ProjectService
, Project
) or community (CommunityService
, Community
).
Description | gRPC | REST |
---|---|---|
Returns a list of access permissions for a project | ListAccessBindings | ListAccessBindings |
Sets up access to a project | SetAccessBindings | SetAccessBindings |
Updates access to a project | UpdateAccessBindings | UpdateAccessBindings |
Returns a list of access permissions for a community | ListAccessBindings | ListAccessBindings |
Sets up access to a community | SetAccessBindings | SetAccessBindings |
Updates access to a community | UpdateAccessBindings | UpdateAccessBindings |
Example. Viewing a list of access permissions for a project:
grpcurl -rpc-header "Authorization: Bearer <IAM_token>" \
-d '{"resource_id": "<project_ID>"}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v2.ProjectService/ListAccessBindings
Example. Viewing a list of access permissions for a community:
grpcurl -rpc-header "Authorization: Bearer <IAM_token>" \
-d '{"resource_id": "<community_ID>"}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v2.CommunityService/ListAccessBindings
For more information about the ProjectService and CommunityService methods, see the API documentation.
Example. Viewing a list of access permissions for a project:
curl -H "Authorization: Bearer <IAM_token>" \
-X GET "https://datasphere.api.cloud.yandex.net/datasphere/v2/projects/<resource_ID>:accessBindings"
Example. Viewing a list of access permissions for a community:
curl -H "Authorization: Bearer <IAM_token>" \
-X GET "https://datasphere.api.cloud.yandex.net/datasphere/v2/communities/<resource_ID>:accessBindings"
For more information about the Project and Community methods, see the API documentation.
Managing consumption limits
You can use the API to set up consumption limits for a project (ProjectService
, Project
).
Description | gRPC | REST |
---|---|---|
Returns a project's balance | getUnitBalance | getUnitBalance |
Sets a project's balance | setUnitBalance | setUnitBalance |
Example. Getting a project's balance:
grpcurl -rpc-header "Authorization: Bearer <IAM_token>" \
-d '{"project_id": "<project_ID>"}' \
datasphere.api.cloud.yandex.net:443 \
yandex.cloud.datasphere.v2.ProjectService/GetUnitBalance
For more information about the ProjectService
calls, see the API documentation.
Example. Getting a project's balance:
curl -H "Authorization: Bearer <IAM_token>" \
-X GET "https://datasphere.api.cloud.yandex.net/datasphere/v2/projects/<project_ID>:unitBalance"
For more information about the Project
methods, see the API documentation.