All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
createResourceInstance | POST /v2/facts/{proj_id}/{env_id}/resource_instances | Create Resource Instance |
deleteResourceInstance | DELETE /v2/facts/{proj_id}/{env_id}/resource_instances/{instance_id} | Delete Resource Instance |
getResourceInstance | GET /v2/facts/{proj_id}/{env_id}/resource_instances/{instance_id} | Get Resource Instance |
listResourceInstances | GET /v2/facts/{proj_id}/{env_id}/resource_instances | List Resource Instances |
updateResourceInstance | PATCH /v2/facts/{proj_id}/{env_id}/resource_instances/{instance_id} | Update Resource Instance |
ResourceInstanceRead createResourceInstance(projId, envId, resourceInstanceCreate)
Create Resource Instance
Creates a new instance inside the Permit.io system. If the instance is already created: will return 200 instead of 201, and will return the existing instance object in the response body.
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = ResourceInstancesApi()
val projId : kotlin.String = projId_example // kotlin.String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
val envId : kotlin.String = envId_example // kotlin.String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
val resourceInstanceCreate : ResourceInstanceCreate = // ResourceInstanceCreate |
try {
val result : ResourceInstanceRead = apiInstance.createResourceInstance(projId, envId, resourceInstanceCreate)
println(result)
} catch (e: ClientException) {
println("4xx response calling ResourceInstancesApi#createResourceInstance")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ResourceInstancesApi#createResourceInstance")
e.printStackTrace()
}
Name | Type | Description | Notes |
---|---|---|---|
projId | kotlin.String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
envId | kotlin.String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
resourceInstanceCreate | ResourceInstanceCreate |
Configure HTTPBearer: ApiClient.accessToken = ""
- Content-Type: application/json
- Accept: application/json
deleteResourceInstance(projId, envId, instanceId)
Delete Resource Instance
Deletes the instance and all its related data.
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = ResourceInstancesApi()
val projId : kotlin.String = projId_example // kotlin.String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
val envId : kotlin.String = envId_example // kotlin.String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
val instanceId : kotlin.String = instanceId_example // kotlin.String | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the \"slug\").
try {
apiInstance.deleteResourceInstance(projId, envId, instanceId)
} catch (e: ClientException) {
println("4xx response calling ResourceInstancesApi#deleteResourceInstance")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ResourceInstancesApi#deleteResourceInstance")
e.printStackTrace()
}
Name | Type | Description | Notes |
---|---|---|---|
projId | kotlin.String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
envId | kotlin.String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
instanceId | kotlin.String | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the "slug"). |
null (empty response body)
Configure HTTPBearer: ApiClient.accessToken = ""
- Content-Type: Not defined
- Accept: application/json
ResourceInstanceRead getResourceInstance(projId, envId, instanceId)
Get Resource Instance
Gets a instance, if such instance exists. Otherwise returns 404.
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = ResourceInstancesApi()
val projId : kotlin.String = projId_example // kotlin.String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
val envId : kotlin.String = envId_example // kotlin.String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
val instanceId : kotlin.String = instanceId_example // kotlin.String | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the \"slug\").
try {
val result : ResourceInstanceRead = apiInstance.getResourceInstance(projId, envId, instanceId)
println(result)
} catch (e: ClientException) {
println("4xx response calling ResourceInstancesApi#getResourceInstance")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ResourceInstancesApi#getResourceInstance")
e.printStackTrace()
}
Name | Type | Description | Notes |
---|---|---|---|
projId | kotlin.String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
envId | kotlin.String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
instanceId | kotlin.String | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the "slug"). |
Configure HTTPBearer: ApiClient.accessToken = ""
- Content-Type: Not defined
- Accept: application/json
kotlin.collections.List<ResourceInstanceRead> listResourceInstances(projId, envId, page, perPage)
List Resource Instances
Lists all the resource instances defined within an environment.
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = ResourceInstancesApi()
val projId : kotlin.String = projId_example // kotlin.String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
val envId : kotlin.String = envId_example // kotlin.String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
val page : kotlin.Int = 56 // kotlin.Int | Page number of the results to fetch, starting at 1.
val perPage : kotlin.Int = 56 // kotlin.Int | The number of results per page (max 100).
try {
val result : kotlin.collections.List<ResourceInstanceRead> = apiInstance.listResourceInstances(projId, envId, page, perPage)
println(result)
} catch (e: ClientException) {
println("4xx response calling ResourceInstancesApi#listResourceInstances")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ResourceInstancesApi#listResourceInstances")
e.printStackTrace()
}
Name | Type | Description | Notes |
---|---|---|---|
projId | kotlin.String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
envId | kotlin.String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
page | kotlin.Int | Page number of the results to fetch, starting at 1. | [optional] [default to 1] |
perPage | kotlin.Int | The number of results per page (max 100). | [optional] [default to 30] |
kotlin.collections.List<ResourceInstanceRead>
Configure HTTPBearer: ApiClient.accessToken = ""
- Content-Type: Not defined
- Accept: application/json
ResourceInstanceRead updateResourceInstance(projId, envId, instanceId, resourceInstanceUpdate)
Update Resource Instance
Partially updates the instance definition. Fields that will be provided will be completely overwritten.
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = ResourceInstancesApi()
val projId : kotlin.String = projId_example // kotlin.String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
val envId : kotlin.String = envId_example // kotlin.String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
val instanceId : kotlin.String = instanceId_example // kotlin.String | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the \"slug\").
val resourceInstanceUpdate : ResourceInstanceUpdate = // ResourceInstanceUpdate |
try {
val result : ResourceInstanceRead = apiInstance.updateResourceInstance(projId, envId, instanceId, resourceInstanceUpdate)
println(result)
} catch (e: ClientException) {
println("4xx response calling ResourceInstancesApi#updateResourceInstance")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ResourceInstancesApi#updateResourceInstance")
e.printStackTrace()
}
Name | Type | Description | Notes |
---|---|---|---|
projId | kotlin.String | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
envId | kotlin.String | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
instanceId | kotlin.String | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the "slug"). | |
resourceInstanceUpdate | ResourceInstanceUpdate |
Configure HTTPBearer: ApiClient.accessToken = ""
- Content-Type: application/json
- Accept: application/json