All URIs are relative to http://localhost, except if the operation defines another base path.
| 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 |
createResourceInstance($proj_id, $env_id, $resource_instance_create): \OpenAPI\Client\Model\ResourceInstanceReadCreate 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.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\ResourceInstancesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$resource_instance_create = new \OpenAPI\Client\Model\ResourceInstanceCreate(); // \OpenAPI\Client\Model\ResourceInstanceCreate
try {
$result = $apiInstance->createResourceInstance($proj_id, $env_id, $resource_instance_create);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ResourceInstancesApi->createResourceInstance: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| resource_instance_create | \OpenAPI\Client\Model\ResourceInstanceCreate |
\OpenAPI\Client\Model\ResourceInstanceRead
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteResourceInstance($proj_id, $env_id, $instance_id)Delete Resource Instance
Deletes the instance and all its related data.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\ResourceInstancesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$instance_id = 'instance_id_example'; // 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($proj_id, $env_id, $instance_id);
} catch (Exception $e) {
echo 'Exception when calling ResourceInstancesApi->deleteResourceInstance: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| instance_id | string | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the "slug"). |
void (empty response body)
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getResourceInstance($proj_id, $env_id, $instance_id): \OpenAPI\Client\Model\ResourceInstanceReadGet Resource Instance
Gets a instance, if such instance exists. Otherwise returns 404.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\ResourceInstancesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$instance_id = 'instance_id_example'; // string | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the \"slug\").
try {
$result = $apiInstance->getResourceInstance($proj_id, $env_id, $instance_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ResourceInstancesApi->getResourceInstance: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| instance_id | string | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the "slug"). |
\OpenAPI\Client\Model\ResourceInstanceRead
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listResourceInstances($proj_id, $env_id, $page, $per_page): \OpenAPI\Client\Model\ResourceInstanceRead[]List Resource Instances
Lists all the resource instances defined within an environment.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\ResourceInstancesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$page = 1; // int | Page number of the results to fetch, starting at 1.
$per_page = 30; // int | The number of results per page (max 100).
try {
$result = $apiInstance->listResourceInstances($proj_id, $env_id, $page, $per_page);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ResourceInstancesApi->listResourceInstances: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| page | int | Page number of the results to fetch, starting at 1. | [optional] [default to 1] |
| per_page | int | The number of results per page (max 100). | [optional] [default to 30] |
\OpenAPI\Client\Model\ResourceInstanceRead[]
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateResourceInstance($proj_id, $env_id, $instance_id, $resource_instance_update): \OpenAPI\Client\Model\ResourceInstanceReadUpdate Resource Instance
Partially updates the instance definition. Fields that will be provided will be completely overwritten.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\ResourceInstancesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$instance_id = 'instance_id_example'; // string | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the \"slug\").
$resource_instance_update = new \OpenAPI\Client\Model\ResourceInstanceUpdate(); // \OpenAPI\Client\Model\ResourceInstanceUpdate
try {
$result = $apiInstance->updateResourceInstance($proj_id, $env_id, $instance_id, $resource_instance_update);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ResourceInstancesApi->updateResourceInstance: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| instance_id | string | Either the unique id of the resource instance, or the URL-friendly key of the resource instance (i.e: the "slug"). | |
| resource_instance_update | \OpenAPI\Client\Model\ResourceInstanceUpdate |
\OpenAPI\Client\Model\ResourceInstanceRead
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]