Skip to content

Latest commit

 

History

History
366 lines (278 loc) · 15.3 KB

ResourceConstraintApi.md

File metadata and controls

366 lines (278 loc) · 15.3 KB

waylay.services.resources.ResourceConstraintApi

All URIs are relative to https://api.waylay.io

Method HTTP request Description
create POST /resources/v1/resourceconstraints Create Resource Constraint
delete DELETE /resources/v1/resourceconstraints/{resourceConstraintId} Remove Resource Constraint
get GET /resources/v1/resourceconstraints/{resourceConstraintId} Get Resource Constraint
list GET /resources/v1/resourceconstraints List Resource Constraints
replace PUT /resources/v1/resourceconstraints/{resourceConstraintId} Update Resource Constraint

create

create( headers ) -> ResourceConstraintCreationResponse

Create Resource Constraint

Creates a new Resource Constraint from the given representation.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-resources-types` is installed
from waylay.services.resources.models.constraint import Constraint
from waylay.services.resources.models.resource_constraint_creation_response import ResourceConstraintCreationResponse
try:
    # Create Resource Constraint
    # calls `POST /resources/v1/resourceconstraints`
    api_response = await waylay_client.resources.resource_constraint.create(
        # json data: use a generated model or a json-serializable python data structure (dict, list)
        json = waylay.services.resources.Constraint() # Constraint | 
    )
    print("The response of resources.resource_constraint.create:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling resources.resource_constraint.create: %s\n" % e)

Endpoint

POST /resources/v1/resourceconstraints

Parameters

Name Type API binding Description Notes
json Constraint json request body
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) ResourceConstraintCreationResponse ResourceConstraintCreationResponse
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Resource Constraint Created * Location - URI where the created Resource Constraint can be fetched
400 Invalid Resource Constraint -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete

delete( resource_constraint_id: str, headers ) -> void (empty response body)

Remove Resource Constraint

Removes a Resource Constraint. Fails if the Resource Constraint is already applied to a Resource Type.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-resources-types` is installed
try:
    # Remove Resource Constraint
    # calls `DELETE /resources/v1/resourceconstraints/{resourceConstraintId}`
    await waylay_client.resources.resource_constraint.delete(
        'resource_constraint_id_example', # resource_constraint_id | path param "resourceConstraintId"
    )
except ApiError as e:
    print("Exception when calling resources.resource_constraint.delete: %s\n" % e)

Endpoint

DELETE /resources/v1/resourceconstraints/{resourceConstraintId}

Parameters

Name Type API binding Description Notes
resource_constraint_id str path parameter "resourceConstraintId" Resource Constraint id
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) void (empty response body)
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Resource Constraint Removed -
400 Resource Constraint Still In Use -
404 Resource Constraint Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get

get( resource_constraint_id: str, headers ) -> ResourceConstraintWithIdEntity

Get Resource Constraint

Gets the definition or JSON Schema representation of a Resource Constraint.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-resources-types` is installed
from waylay.services.resources.models.resource_constraint_with_id_entity import ResourceConstraintWithIdEntity
try:
    # Get Resource Constraint
    # calls `GET /resources/v1/resourceconstraints/{resourceConstraintId}`
    api_response = await waylay_client.resources.resource_constraint.get(
        'resource_constraint_id_example', # resource_constraint_id | path param "resourceConstraintId"
    )
    print("The response of resources.resource_constraint.get:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling resources.resource_constraint.get: %s\n" % e)

Endpoint

GET /resources/v1/resourceconstraints/{resourceConstraintId}

Parameters

Name Type API binding Description Notes
resource_constraint_id str path parameter "resourceConstraintId" Resource Constraint id
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) ResourceConstraintWithIdEntity ResourceConstraintWithIdEntity
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/schema+json

HTTP response details

Status code Description Response headers
200 Resource Constraint Fetched -
404 Resource Constraint Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list

list( query: ListQuery, headers ) -> List[ResourceConstraintWithIdEntity]

List Resource Constraints

Lists Resource Constraints that fulfill the given criteria.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-resources-types` is installed
from waylay.services.resources.models.resource_constraint_with_id_entity import ResourceConstraintWithIdEntity
try:
    # List Resource Constraints
    # calls `GET /resources/v1/resourceconstraints`
    api_response = await waylay_client.resources.resource_constraint.list(
        # query parameters:
        query = {
        },
    )
    print("The response of resources.resource_constraint.list:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling resources.resource_constraint.list: %s\n" % e)

Endpoint

GET /resources/v1/resourceconstraints

Parameters

Name Type API binding Description Notes
query QueryParamTypes | None URL query parameter
query['skip'] (dict)
query.skip (Query)
int query parameter "skip" (Paging) items to skip in the listing [optional] [default 0]
query['limit'] (dict)
query.limit (Query)
int query parameter "limit" (Paging) maximal number of items returned [optional] [default 100]
query['filter'] (dict)
query.filter (Query)
str query parameter "filter" (Filter) fuzzy search on multiple fields. [optional]
query['query'] (dict)
query.query (Query)
str query parameter "query" Search string using following query language > `tags:<operation>(<arguments>)` Supported operations are * `eq`: equals - exact match * `in`: in - exact match - arguments are a (comma-separated) list of values * `exists`: check if tags are specified on the Constraint * `like`: wildcard search - argument should contain * and/or ? For more info see Waylay Docs [optional]
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) List[ResourceConstraintWithIdEntity] List[ResourceConstraintWithIdEntity]
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Resource Constraints * X-Count - Total number of resource constraints that fulfill the given criteria of which this is one page of results.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

replace

replace( resource_constraint_id: str, headers ) -> ResourceConstraintWithIdEntity

Update Resource Constraint

Replaces the full definition of a Resource Constraint. Fails if the Resource Constraint is already applied to a Resource Type that has Resources assigned to it.

Example

from pprint import pprint

# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-resources-types` is installed
from waylay.services.resources.models.constraint import Constraint
from waylay.services.resources.models.resource_constraint_with_id_entity import ResourceConstraintWithIdEntity
try:
    # Update Resource Constraint
    # calls `PUT /resources/v1/resourceconstraints/{resourceConstraintId}`
    api_response = await waylay_client.resources.resource_constraint.replace(
        'resource_constraint_id_example', # resource_constraint_id | path param "resourceConstraintId"
        # json data: use a generated model or a json-serializable python data structure (dict, list)
        json = waylay.services.resources.Constraint() # Constraint | 
    )
    print("The response of resources.resource_constraint.replace:\n")
    pprint(api_response)
except ApiError as e:
    print("Exception when calling resources.resource_constraint.replace: %s\n" % e)

Endpoint

PUT /resources/v1/resourceconstraints/{resourceConstraintId}

Parameters

Name Type API binding Description Notes
resource_constraint_id str path parameter "resourceConstraintId" Resource Constraint id
json Constraint json request body
headers HeaderTypes request headers

Return type

Selected path param Raw response param Return Type Description Links
Literal[""] (default) False (default) ResourceConstraintWithIdEntity ResourceConstraintWithIdEntity
str False (default) Any If any other string value for the selected path is provided, the exact type of the response will only be known at runtime.
/ True Response The raw http response object.

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Resource Constraint Replaced -
400 Validation Failed -
404 Resource Constraint Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]