Skip to main content
Reliable Services/VM Scheduling Policy Interfaces
POSTVM Scheduling Policy InterfacesSince 4.6.0SynchronousAuth Required

Create VM Scheduling Policy

Create VM Scheduling Policy

Execution Availability

Try It Out

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

Request Inputs

Body Fields

  • paramsObjectRequired

    Request body parameter object.

    • ruleStringRequired

      Rule

    • modeStringRequired

      Enforcement level

    • vmGroupUuidStringRequired

      VM scheduling group UUID

    • hostGroupUuidString

      Host scheduling group UUID

    • nameStringRequired

      Resource name

    • descriptionString

      Detailed description of the resource

    • policyString

      策略。

    • typeString

      类型。

    • zoneUuidString

      Data Center UUID

    • subTypeString

      订阅类型。

    • resourceUuidString

      Resource UUID

    • tagUuidsList

      Tag UUID list

  • systemTagsList

    System tags

  • userTagsList

    User tags

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • errorErrorCodeRequired

    Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error

    • codeStringRequired

      Error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001

    • descriptionStringRequired

      Brief description of the error

    • detailsStringRequired

      Detailed information about the error

    • elaborationStringRequired

      Reserved field. Default is null

    • opaqueLinkedHashMapRequired

      Reserved field. Default is null

    • causeErrorCodeRequired

      Root error. The source error that caused the current error. This field is null if no root error exists

  • inventoryAffinityGroupInventoryRequired

    For details, see inventory

    • uuidStringRequired

      UUID of the resource. Uniquely identifies the resource

    • nameStringRequired

      Resource name

    • descriptionStringRequired

      Detailed description of the resource

    • policyStringRequired

      策略信息。

    • versionStringRequired

      版本号。

    • typeStringRequired

      类型。

    • applianceStringRequired

      设备。

    • stateStringRequired

      当前状态。

    • createDateTimestampRequired

      Creation time

    • lastOpDateTimestampRequired

      Last modification time

    • usagesListRequired

      For details, see usages

      • uuidStringRequired

        UUID of the resource. Uniquely identifies the resource

      • affinityGroupUuidStringRequired

        No description provided.

      • resourceUuidStringRequired

        资源UUID。若指定,资源会使用该字段值作为UUID。

      • resourceTypeStringRequired

        资源类型。

      • createDateTimestampRequired

        Creation time

      • lastOpDateTimestampRequired

        Last modification time

Endpoint

POST/zstack/v1/vmsSchedulingRule

/zstack/v1/vmsSchedulingRule

Operation ID

CreateVmSchedulingRule

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/vmsSchedulingRule' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"rule":"<rule>","mode":"<mode>","vmGroupUuid":"<vmGroupUuid>","hostGroupUuid":"<hostGroupUuid>","name":"<name>","description":"<description>","policy":"<policy>","type":"<type>","zoneUuid":"<zoneUuid>","subType":"<subType>","resourceUuid":"<resourceUuid>","tagUuids":["<tagUuids>"]},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "d517b42f669b324288fe8977a7df2e4d", "name": "affinity-group-test", "description": "affinity group for test", "policy": "ANTISOFT", "version": "1.0", "type": "HOST" } }

Change History

This API has no change history records yet.

View all change history