198 lines
11 KiB
TypeScript
198 lines
11 KiB
TypeScript
/* tslint:disable */
|
|||
|
|
/* eslint-disable */
|
||
|
|
/**
|
||
|
|
* Boundary controller HTTP API
|
||
|
|
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||
|
|
*
|
||
|
|
* The version of the OpenAPI document: 0.19.0
|
||
|
|
*
|
||
|
|
*
|
||
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||
|
|
* https://openapi-generator.tech
|
||
|
|
* Do not edit the class manually.
|
||
|
|
*/
|
||
|
|
|
||
|
|
import { mapValues } from '../runtime';
|
||
|
|
import type { ControllerApiResourcesPluginsV1PluginInfo } from './ControllerApiResourcesPluginsV1PluginInfo';
|
||
|
|
import {
|
||
|
|
ControllerApiResourcesPluginsV1PluginInfoFromJSON,
|
||
|
|
ControllerApiResourcesPluginsV1PluginInfoFromJSONTyped,
|
||
|
|
ControllerApiResourcesPluginsV1PluginInfoToJSON,
|
||
|
|
ControllerApiResourcesPluginsV1PluginInfoToJSONTyped,
|
||
|
|
} from './ControllerApiResourcesPluginsV1PluginInfo';
|
||
|
|
import type { ControllerApiResourcesScopesV1ScopeInfo } from './ControllerApiResourcesScopesV1ScopeInfo';
|
||
|
|
import {
|
||
|
|
ControllerApiResourcesScopesV1ScopeInfoFromJSON,
|
||
|
|
ControllerApiResourcesScopesV1ScopeInfoFromJSONTyped,
|
||
|
|
ControllerApiResourcesScopesV1ScopeInfoToJSON,
|
||
|
|
ControllerApiResourcesScopesV1ScopeInfoToJSONTyped,
|
||
|
|
} from './ControllerApiResourcesScopesV1ScopeInfo';
|
||
|
|
|
||
|
|
/**
|
||
|
|
*
|
||
|
|
* @export
|
||
|
|
* @interface ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
export interface ControllerApiResourcesHostsetsV1HostSet {
|
||
|
|
/**
|
||
|
|
* Output only. The ID of the Host Set.
|
||
|
|
* @type {string}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
readonly id?: string;
|
||
|
|
/**
|
||
|
|
* The Host Catalog of which this Host Set is a part.
|
||
|
|
* @type {string}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
hostCatalogId?: string;
|
||
|
|
/**
|
||
|
|
*
|
||
|
|
* @type {ControllerApiResourcesScopesV1ScopeInfo}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
scope?: ControllerApiResourcesScopesV1ScopeInfo;
|
||
|
|
/**
|
||
|
|
*
|
||
|
|
* @type {ControllerApiResourcesPluginsV1PluginInfo}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
plugin?: ControllerApiResourcesPluginsV1PluginInfo;
|
||
|
|
/**
|
||
|
|
* Optional name for identification purposes.
|
||
|
|
* @type {string}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
name?: string;
|
||
|
|
/**
|
||
|
|
* Optional user-set description for identification purposes.
|
||
|
|
* @type {string}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
description?: string;
|
||
|
|
/**
|
||
|
|
* Output only. The time this resource was created.
|
||
|
|
* @type {Date}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
readonly createdTime?: Date;
|
||
|
|
/**
|
||
|
|
* Output only. The time this resource was last updated.
|
||
|
|
* @type {Date}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
readonly updatedTime?: Date;
|
||
|
|
/**
|
||
|
|
* Version is used in mutation requests, after the initial creation, to ensure this resource has not changed.
|
||
|
|
* The mutation will fail if the version does not match the latest known good version.
|
||
|
|
* @type {number}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
version?: number;
|
||
|
|
/**
|
||
|
|
* The type of the Host Set.
|
||
|
|
* @type {string}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
type?: string;
|
||
|
|
/**
|
||
|
|
* Output only. A list of Hosts in this Host Set.
|
||
|
|
* @type {Array<string>}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
readonly hostIds?: Array<string>;
|
||
|
|
/**
|
||
|
|
* multiple possible endpoints for a host. Preferences are specified by
|
||
|
|
* "cidr:<valid IPv4/6 CIDR>" or "dns:<globbed name>", specifying which IP
|
||
|
|
* address or DNS name out of a host's available possibilities should be
|
||
|
|
* preferred. If no preferences are specified, a value will be chosen from
|
||
|
|
* among all avialable values using a built-in priority order. May not be
|
||
|
|
* valid for all plugin types.
|
||
|
|
* @type {Array<string>}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
preferredEndpoints?: Array<string>;
|
||
|
|
/**
|
||
|
|
* An interger number of seconds indicating the amount of time that should
|
||
|
|
* elapse between syncs of the host set. The interval will be applied to the
|
||
|
|
* end of the previous sync operation, not the start. Setting to -1 will
|
||
|
|
* disable syncing for that host set; setting to zero will cause the set to
|
||
|
|
* use Boundary's default. The default may change between releases. May not
|
||
|
|
* be valid for all plugin types.
|
||
|
|
* @type {number}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
syncIntervalSeconds?: number;
|
||
|
|
/**
|
||
|
|
* The attributes that are applicable for the specific Host Set type.
|
||
|
|
* @type {object}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
attributes?: object;
|
||
|
|
/**
|
||
|
|
* Output only. The available actions on this resource for this user.
|
||
|
|
* @type {Array<string>}
|
||
|
|
* @memberof ControllerApiResourcesHostsetsV1HostSet
|
||
|
|
*/
|
||
|
|
readonly authorizedActions?: Array<string>;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Check if a given object implements the ControllerApiResourcesHostsetsV1HostSet interface.
|
||
|
|
*/
|
||
|
|
export function instanceOfControllerApiResourcesHostsetsV1HostSet(value: object): value is ControllerApiResourcesHostsetsV1HostSet {
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function ControllerApiResourcesHostsetsV1HostSetFromJSON(json: any): ControllerApiResourcesHostsetsV1HostSet {
|
||
|
|
return ControllerApiResourcesHostsetsV1HostSetFromJSONTyped(json, false);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function ControllerApiResourcesHostsetsV1HostSetFromJSONTyped(json: any, ignoreDiscriminator: boolean): ControllerApiResourcesHostsetsV1HostSet {
|
||
|
|
if (json == null) {
|
||
|
|
return json;
|
||
|
|
}
|
||
|
|
return {
|
||
|
|
|
||
|
|
'id': json['id'] == null ? undefined : json['id'],
|
||
|
|
'hostCatalogId': json['host_catalog_id'] == null ? undefined : json['host_catalog_id'],
|
||
|
|
'scope': json['scope'] == null ? undefined : ControllerApiResourcesScopesV1ScopeInfoFromJSON(json['scope']),
|
||
|
|
'plugin': json['plugin'] == null ? undefined : ControllerApiResourcesPluginsV1PluginInfoFromJSON(json['plugin']),
|
||
|
|
'name': json['name'] == null ? undefined : json['name'],
|
||
|
|
'description': json['description'] == null ? undefined : json['description'],
|
||
|
|
'createdTime': json['created_time'] == null ? undefined : (new Date(json['created_time'])),
|
||
|
|
'updatedTime': json['updated_time'] == null ? undefined : (new Date(json['updated_time'])),
|
||
|
|
'version': json['version'] == null ? undefined : json['version'],
|
||
|
|
'type': json['type'] == null ? undefined : json['type'],
|
||
|
|
'hostIds': json['host_ids'] == null ? undefined : json['host_ids'],
|
||
|
|
'preferredEndpoints': json['preferred_endpoints'] == null ? undefined : json['preferred_endpoints'],
|
||
|
|
'syncIntervalSeconds': json['sync_interval_seconds'] == null ? undefined : json['sync_interval_seconds'],
|
||
|
|
'attributes': json['attributes'] == null ? undefined : json['attributes'],
|
||
|
|
'authorizedActions': json['authorized_actions'] == null ? undefined : json['authorized_actions'],
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export function ControllerApiResourcesHostsetsV1HostSetToJSON(json: any): ControllerApiResourcesHostsetsV1HostSet {
|
||
|
|
return ControllerApiResourcesHostsetsV1HostSetToJSONTyped(json, false);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function ControllerApiResourcesHostsetsV1HostSetToJSONTyped(value?: Omit<ControllerApiResourcesHostsetsV1HostSet, 'id'|'created_time'|'updated_time'|'host_ids'|'authorized_actions'> | null, ignoreDiscriminator: boolean = false): any {
|
||
|
|
if (value == null) {
|
||
|
|
return value;
|
||
|
|
}
|
||
|
|
|
||
|
|
return {
|
||
|
|
|
||
|
|
'host_catalog_id': value['hostCatalogId'],
|
||
|
|
'scope': ControllerApiResourcesScopesV1ScopeInfoToJSON(value['scope']),
|
||
|
|
'plugin': ControllerApiResourcesPluginsV1PluginInfoToJSON(value['plugin']),
|
||
|
|
'name': value['name'],
|
||
|
|
'description': value['description'],
|
||
|
|
'version': value['version'],
|
||
|
|
'type': value['type'],
|
||
|
|
'preferred_endpoints': value['preferredEndpoints'],
|
||
|
|
'sync_interval_seconds': value['syncIntervalSeconds'],
|
||
|
|
'attributes': value['attributes'],
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|