Access Control


RequestConsoleAccess

API Request

URLs
POST zstack/v1/consoles
Headers
Authorization: OAuth the-session-uuid
Body
{   "params": {     "vmInstanceUuid": "b95acae48c804003ac3820751b58a50d"   },   "systemTags": [],   "userTags": [] }
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"vmInstanceUuid":"e0442db541833083bd7e411a4d94d969"}}' \ http://localhost:8080/zstack/v1/consoles
Request Parameters
Name Type Location Description Optional Value Starting Version
vmInstanceUuid String body (contained in the params structure) The VM instance UUID. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample Response
{   "inventory": {     "scheme": "http",     "hostname": "127.0.0.1",     "port": 4900.0,     "token": "d96caf24fae54c76b7652f548a258261"   } }
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory ConsoleInventory See inventory. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventory
Name Type Description Starting Version
scheme String The type of the access protocol. 0.6
hostname String The hostname. 0.6
port int The port. 0.6
token String The token. 0.6

SDK Sample

Java SDK
RequestConsoleAccessAction action = new RequestConsoleAccessAction(); action.vmInstanceUuid = "c8925478e1f840caa1f3919affa19155"; action.sessionId = "f896abb919754292aa8d2f286596142c"; RequestConsoleAccessAction.Result res = action.call();
Python SDK
RequestConsoleAccessAction action = RequestConsoleAccessAction() action.vmInstanceUuid = "f37c825f87444941bf16261f63c7dbb7" action.sessionId = "331a21749df940e4b447e9103518890d" RequestConsoleAccessAction.Result res = action.call()

QueryConsoleProxyAgent

API Request

URLs
GET zstack/v1/consoles/agents GET zstack/v1/consoles/agents/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth 350b72c2d3f24641a767acbcec744b19" \ -X GET http://localhost:8080/zstack/v1/consoles/agents?q=uuid=745b7c17cd224025b3adfef4ae61b3d2
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth bb08e240616b482984c397e4517a021c" \ -X GET http://localhost:8080/zstack/v1/consoles/agents/8a3cc2be7e20420db29925e381c598bc

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryConsoleProxyAgent, and pressing the Tab key.

API Response

Sample Response
{   "inventories": [     {       "uuid": "c77bbc7d3364449e9543d0776a6087de",       "managementIp": "127.0.0.1",       "type": "ManagementServerConsoleProxy",       "state": "Connected"     }   ] }
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventories List See inventories. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 0.6
description String The detailed description of the resource. 0.6
managementIp String The IP address of the management node. 0.6
type String The type. 0.6
status String The status, including Connected and Disconnected. 0.6
state String The state, including Enabled and Disabled. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

SDK Sample

Java SDK
QueryConsoleProxyAgentAction action = new QueryConsoleProxyAgentAction(); action.conditions = asList("uuid=dfbe49d87cb94d93b69354fa1270012b"); action.sessionId = "e2300cd4f74a457e87f13842aeb8fdef"; QueryConsoleProxyAgentAction.Result res = action.call();
Python SDK
QueryConsoleProxyAgentAction action = QueryConsoleProxyAgentAction() action.conditions = ["uuid=1e47046946f849ee871de20a2b045750"] action.sessionId = "1655d7f2e56d4710824cd1082bd5cc94" QueryConsoleProxyAgentAction.Result res = action.call()













Archives

Download Document Archives

Back to Top

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.
同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.