Skip to content

Create



POST /api/v1/workspace/create

Overview

Create a workspace.

Use an existing workspace API Key to create a new workspace. The owner of the new workspace defaults to the owner of the space to which the API Key of this request belongs.

When creating a paid workspace, it will be bound to the Billing Center account of the space to which the API Key of this request belongs by default.

Body Request Parameters

Parameter Name Type Required Description
name string Y Name
Example: supper_workspace
Allow empty: False
Max length: 256
desc string Description
Example: Workspace description
Allow empty: True
Allow empty string: True
menuStyle string Workspace menu style, operation/test/development; (deprecated)
Example: Operation
Allow empty: False
Allow empty string: True
needCreateAk boolean Whether to create a workspace AK
Example: True
Allow empty: False
createPayWsVersion boolean Create a paid workspace version, (default false, create a Free Plan workspace)
Example: True
Allow empty: False
akName string Workspace AK name
Example: True
Allow empty: False
language string Workspace language
Allow empty: True
Allow empty string: True
Options: ['zh', 'en']

Parameter Additional Notes

Data description.*

  • Request parameter description
Parameter Name Type Description
name string Name of the new workspace
desc string Description of the new workspace
needCreateAk boolean Whether to create an API KEY in the new workspace
akName string Name of the API KEY
createPayWsVersion boolean Create a paid workspace version (default false, create a Free Plan workspace)

  • Response parameter description
Parameter Name Type Description
akInfo dict API KEY information of the new workspace
ownerInfo dict Owner information of the new workspace
wsInfo dict Workspace related information
versionType string Workspace version type

Request Example

curl 'https://openapi.guance.com/api/v1/workspace/create' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"name":"ws_create_test","desc":"test","needCreateAk":true,"akName":"test_ak"}' \
--compressed
--insecure

Response

{
    "code": 200,
    "content": {
        "accountInfo": [
            "acnt_xxxxxx"
        ],
        "akInfo": {
            "keyId": "wsak_xxxxxx",
            "keySk": "xxxxxxxxxxx",
            "name": "test_ak"
        },
        "makeResourceExceptionCode": "",
        "ownerInfo": {
            "accountUUID": "acnt_xxxxxxxxxx",
            "email": "xxx@guance.com",
            "name": "Test"
        },
        "wsInfo": {
            "billingState": "free",
            "createAt": 1672802266,
            "creator": "wsak_xxxxx",
            "dashboardUUID": null,
            "datastore": {
                "backup_log": "es",
                "custom_object": "es",
                "keyevent": "es",
                "logging": "es",
                "metric": "influxdb",
                "network": "es",
                "object": "es",
                "object_history": "es",
                "rum": "es",
                "security": "es",
                "tracing": "es"
            },
            "dbUUID": "ifdb_xxxx32",
            "deleteAt": -1,
            "desc": "test",
            "durationSet": {
                "apm": "7d",
                "backup_log": "7d",
                "keyevent": "7d",
                "logging": "7d",
                "network": "1d",
                "rp": "7d"
            },
            "enablePublicDataway": 1,
            "esIndexMerged": 1,
            "esIndexSettings": {},
            "esInstanceUUID": "es_xxxx32",
            "exterId": "",
            "id": null,
            "isLocked": 0,
            "isOpenLogMultipleIndex": false,
            "lockAt": -1,
            "loggingCutSize": 10240,
            "makeResourceExceptionCode": "",
            "name": "ws_create_test",
            "rpName": "rp1",
            "status": 0,
            "supportJsonMessage": 1,
            "updateAt": 1672802266,
            "updator": "wsak_xxxxx",
            "uuid": "wksp_xxxx32",
            "versionType": "free"
        }
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-89835D3F-C614-46AD-A1B8-83CC686DDA7F"
}

Feedback

Is this page helpful? ×