Skip to main content
Compute Management/Host Related Interfaces
POSTHost Related InterfacesSince 4.7.11SynchronousAuth Required

Allocate Host Compute Resources

Allocate Host Compute Resources

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • uuidStringRequired

    Resource UUID, uniquely identifies the resource

Body Fields

  • paramsObjectRequired

    Request body parameter object.

    • strategyStringRequired

      Allocation strategy

    • sceneStringRequired

      Allocation scene

    • vcpuintRequired

      Required vCPU count

    • memSizeLong

      Required memory size

  • systemTagsList

    System tag

  • userTagsList

    User tag

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • nameStringRequired

    Resource name

  • uuidStringRequired

    Resource UUID, uniquely identifies the resource

  • vCPUPinListRequired

    pCPU information allocated for the corresponding vCPU count

  • errorErrorCodeRequired

    Error code. If not null, the operation failed. If null, the operation succeeded. See details error

    • codeStringRequired

      Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001

    • descriptionStringRequired

      Brief description of the error

    • detailsStringRequired

      Detailed error information

    • elaborationStringRequired

      Reserved field, default is null

    • opaqueLinkedHashMapRequired

      Reserved field, default is null

    • causeErrorCodeRequired

      Root cause, the error that caused the current error. If there is no original error, this field is null

Endpoint

POST/zstack/v1/hosts/{uuid}/allocate-resource

/zstack/v1/hosts/{uuid}/allocate-resource

Operation ID

AllocateHostResource

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/hosts/{uuid}/allocate-resource' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"strategy":"<strategy>","scene":"<scene>","vcpu":1,"memSize":1},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "name": "example", "uuid": "f7bae73b9874344b8766dfcdda48ad6e", "vCPUPin": [ { "vCPU": "0", "pCPU": "13" } ] }

Change History

This API has no change history records yet.

View all change history