REST API - add

vcenter trust subscriptions: add

Add a new subscription record into database. There are two possible situations for add. A. In the first case, the client is only interested in one VCTrust object and the VCTrust object has to exist in database. To make such a subscription, the client need to tell database which VCTrust object he is interested in. The GUID (VCTrust Id) field stands for that specific VCTrust and need to be specified. In this way, the client will only receive notification from that specified object changes. There is no limit on how many subscription an endpoint can add. B. In the second case, the client makes a subscription without a specified VCTrust object, which means the client is interested in every VCTrust object. Whenever the database changes (e.g add a new VCTrust, delete VCTrust, update...), the client gets notified. All the records in the database will not be deleted automatically. The only way to delete a record is to invoke delete API. Warning: This operation is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Request:

HTTP request

POST https://{server}/rest/vcenter/trust/subscriptions?action=add

Request Body Structure:

{
    "params"{
        "send_results"true,
        "content_type""string",
        "notification_endpoint""string",
        "query_string""string"
    }
}

Request Body Parameters:

Name Type Description
bold = required
params create_spec Create Specification that includes all the parameters needed to create a new subscription.
params.notification_endpoint string The notification endpoint url. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

params.send_results boolean If the sendResults is set, the actual change will be sent. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Optional. defaults to null.

params.content_type string If the optional contentType is specified, the notifcation will be sent using the data-source specific (see HEAD) content type. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Optional. The default is the JSON-RPC defined "NotificationEvent".

params.query_string string The query string is the scope of notification and it specify the vctrust id here. If no query string is provided, then it is assumed that all vctrust changes are tracked. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Optional. default is null.

Response:

HTTP Status Code: 200

Representation:

{
    "value"{
        "expiration""string",
        "subscription""string"
    }
}

Response Type:

Name Type Description
bold = required
value info The info object that includes subscription id and expiration date.
value.subscription string Subscription Id, which is the primary key in subscription database. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

value.expiration string The expiration datetime. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Errors:

HTTP Status Code Type Description
403 unauthorized unauthorized
400 already_exists already exists
400 invalid_request invalid request
500 resource_inaccessible resource inaccessible
400 invalid_argument invalid argument
500 error all other errors