pem.setResourceTypeLimit

This method is supported by Operations starting from version 2.6.1

This method sets limits on a Resource Type within given Subscription.

The method has the following input parameters:

Name

Type

Short Description

subscription_id

int

ID of the Subscription

resource_type_id

int

ID of the Resource type

[limit]

int

New Resource Type limit.

Note: Use -1 value to make a resource unlimited.

[limit64]

bigint

64bit analog of the limit parameter; has higher priority.

Note: Use -1 value to make a resource unlimited.

[autoprovide]

boolean

If the actual provisioning/un-provisioning should proceed

If the autoprovide flag is set to 1 (true), then the method performs the following additional tasks:

  • If a particular resource was either added or its limit was changed from zero to any non-zero value, then it will be auto-provided.
  • If limit of a particular resource is changed from non-zero value to zero, then it will be automatically un-provided.

    Note: For a resource that belongs to the Application service reference resource class, setting its limit to zero leads to overusage (usage will not be decreased, and unprovisioning will not be initiated for this resource).

The method performs the following tasks depending on the cases outlined in the table below:

setResourceTypeLimits for resource (usage=N, limit=N)

autoprovide=1

autoprovide=0

limit=L (L < N)

Returns an error (exception)

Returns an error (exception)

limit=0

Un-provide

Overuse (N - L)

Note: Operations resource type structure has a tree-like form, so auto-provisioning of leaf resources is impossible without provisioning of root ones. Be aware of what resources to send with this method to get predictable results.