Getting Started
This section describes the procedure for creating a screen by calling APIs:
1. If the token authentication is used, obtain the user token. The token will be put into the request header for authentication in a subsequent request.
2. Call an API to create a screen.
Prerequisite
- You have obtained the endpoints of IAM and endpoints of DLV.
- You have obtained project IDs. For details about project IDs, see Obtaining a Project ID.
Procedure
The following values are examples (replace them with actual values):
- IAM endpoint: iam_endpoint
- DLV endpoint: dlv_endpoint
- Project ID: project_id
Perform the following operations to create a screen:
- When using token authentication, obtain the user token and set it as an environment variable.
curl -H "Content-Type:application/json" https://iam_endpoint/v3/auth/tokens -X POST -d '{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "testname", "domain": { "name": "testname" }, "password": "Passw0rd" } } }, "scope": { "project": { "name": "aaa" } } } }' -v -k
The value of X-Subject-Token in the response header is the token.
X-Subject-Token:MIIDkgYJKoZIhvcNAQcCoIIDgzCCA38CAQExDTALBglghkgBZQMEAgEwgXXXXX...
Run the following command to set the token as an environment variable for future use: The value of X-Auth-Token is the token value obtained in the previous step.
export Token=MIIDkgYJKoZIhvcNAQcCoIIDgzCCA38CAQExDTALBglghkgBZQMEAgEwgXXXXX...
- Call the API for creating a screen.
curl -X POST -H 'Content-Type:application/json;charset=utf-8' -H "X-Auth-Token:$Token" -d '{ "name": "my_screen", "alias": "first_screen", "description": "my first screen", "template_id": "453113551", "workspaceId":"86ce107974ce4f93b618acb232863027" } }' https://dlv_endpoint/v1/project_id/screens -v -k
Screen parameters are described as follows:
- name: name of the screen.
- alias: alias of the screen.
- description: description of the screen.
- template_id: ID of the screen template.
- workspaceId: workspace ID.
If status code 200 is returned, the screen is successfully created. If a status code listed Status Codes is returned, the screen fails to be created.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot