Files
threshold-ui/e2e-tests/api-client/models/ControllerApiResourcesWorkersV1Worker.ts
T

242 lines
14 KiB
TypeScript
Raw Normal View History

/* 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 { ControllerApiResourcesWorkersV1RemoteStorageState } from './ControllerApiResourcesWorkersV1RemoteStorageState';
import {
ControllerApiResourcesWorkersV1RemoteStorageStateFromJSON,
ControllerApiResourcesWorkersV1RemoteStorageStateFromJSONTyped,
ControllerApiResourcesWorkersV1RemoteStorageStateToJSON,
ControllerApiResourcesWorkersV1RemoteStorageStateToJSONTyped,
} from './ControllerApiResourcesWorkersV1RemoteStorageState';
import type { ControllerApiResourcesScopesV1ScopeInfo } from './ControllerApiResourcesScopesV1ScopeInfo';
import {
ControllerApiResourcesScopesV1ScopeInfoFromJSON,
ControllerApiResourcesScopesV1ScopeInfoFromJSONTyped,
ControllerApiResourcesScopesV1ScopeInfoToJSON,
ControllerApiResourcesScopesV1ScopeInfoToJSONTyped,
} from './ControllerApiResourcesScopesV1ScopeInfo';
/**
*
* @export
* @interface ControllerApiResourcesWorkersV1Worker
*/
export interface ControllerApiResourcesWorkersV1Worker {
/**
* Output only. The ID of the User.
* @type {string}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly id?: string;
/**
* The ID of the Scope this resource is in.
* @type {string}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
scopeId?: string;
/**
*
* @type {ControllerApiResourcesScopesV1ScopeInfo}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
scope?: ControllerApiResourcesScopesV1ScopeInfo;
/**
* Optional name for identification purposes. Can only be set through the API
* for `pki`-type workers; read-only for `kms`-type workers.
* @type {string}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
name?: string;
/**
* Optional user-set description for identification purposes. Can only be set
* through the API for `pki`-type workers; read-only for `kms`-type workers.
* @type {string}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
description?: string;
/**
* Output only. The time this resource was created.
* @type {Date}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly createdTime?: Date;
/**
* Output only. The time this resource was last updated.
* @type {Date}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
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 ControllerApiResourcesWorkersV1Worker
*/
version?: number;
/**
* Output only. The address that this worker is reachable at, as sourced from
* the worker's configuration file.
* @type {string}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly address?: string;
/**
* Output only. The deduplicated union of the tags reported by the worker from
* its configuration and any tags added through other means. This is used
* when applying worker filters.
* @type {{ [key: string]: Array<object>; }}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly canonicalTags?: { [key: string]: Array<object>; };
/**
* Output only. The tags set in the worker's configuration file.
* @type {{ [key: string]: Array<object>; }}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly configTags?: { [key: string]: Array<object>; };
/**
* Output only. The time this worker daemon last reported its status.
* @type {Date}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly lastStatusTime?: Date;
/**
*
* @type {string}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
workerGeneratedAuthToken?: string;
/**
* Output only. An activation token that can be given to a worker to correlate
* it to the created resource.
* @type {string}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly controllerGeneratedActivationToken?: string;
/**
* Output only. The number of connections that this worker is currently handling.
* @type {number}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly activeConnectionCount?: number;
/**
* Output only. The type of the worker, denoted by how it authenticates: `pki`
* or `kms`.
* @type {string}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly type?: string;
/**
* Output only. The api tags set for the worker.
* @type {{ [key: string]: Array<object>; }}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly apiTags?: { [key: string]: Array<object>; };
/**
* Output only. The version of the Boundary binary the worker is running.
* @type {string}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly releaseVersion?: string;
/**
* Output only. The ids of the workers directly connected to this worker.
* @type {Array<string>}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly directlyConnectedDownstreamWorkers?: Array<string>;
/**
* Output only. The available actions on this resource for the requester.
* @type {Array<string>}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly authorizedActions?: Array<string>;
/**
*
* @type {string}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly localStorageState?: string;
/**
* Output only. The remote_storage_state indicats the permission state of the storage buckets that the Worker
* is actively using. The possible permission state types include: write, read, and delete. The possible
* permission state values include: unknown, error, and ok.
* @type {{ [key: string]: ControllerApiResourcesWorkersV1RemoteStorageState; }}
* @memberof ControllerApiResourcesWorkersV1Worker
*/
readonly remoteStorageState?: { [key: string]: ControllerApiResourcesWorkersV1RemoteStorageState; };
}
/**
* Check if a given object implements the ControllerApiResourcesWorkersV1Worker interface.
*/
export function instanceOfControllerApiResourcesWorkersV1Worker(value: object): value is ControllerApiResourcesWorkersV1Worker {
return true;
}
export function ControllerApiResourcesWorkersV1WorkerFromJSON(json: any): ControllerApiResourcesWorkersV1Worker {
return ControllerApiResourcesWorkersV1WorkerFromJSONTyped(json, false);
}
export function ControllerApiResourcesWorkersV1WorkerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ControllerApiResourcesWorkersV1Worker {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'scopeId': json['scope_id'] == null ? undefined : json['scope_id'],
'scope': json['scope'] == null ? undefined : ControllerApiResourcesScopesV1ScopeInfoFromJSON(json['scope']),
'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'],
'address': json['address'] == null ? undefined : json['address'],
'canonicalTags': json['canonical_tags'] == null ? undefined : json['canonical_tags'],
'configTags': json['config_tags'] == null ? undefined : json['config_tags'],
'lastStatusTime': json['last_status_time'] == null ? undefined : (new Date(json['last_status_time'])),
'workerGeneratedAuthToken': json['worker_generated_auth_token'] == null ? undefined : json['worker_generated_auth_token'],
'controllerGeneratedActivationToken': json['controller_generated_activation_token'] == null ? undefined : json['controller_generated_activation_token'],
'activeConnectionCount': json['active_connection_count'] == null ? undefined : json['active_connection_count'],
'type': json['type'] == null ? undefined : json['type'],
'apiTags': json['api_tags'] == null ? undefined : json['api_tags'],
'releaseVersion': json['release_version'] == null ? undefined : json['release_version'],
'directlyConnectedDownstreamWorkers': json['directly_connected_downstream_workers'] == null ? undefined : json['directly_connected_downstream_workers'],
'authorizedActions': json['authorized_actions'] == null ? undefined : json['authorized_actions'],
'localStorageState': json['local_storage_state'] == null ? undefined : json['local_storage_state'],
'remoteStorageState': json['remote_storage_state'] == null ? undefined : (mapValues(json['remote_storage_state'], ControllerApiResourcesWorkersV1RemoteStorageStateFromJSON)),
};
}
export function ControllerApiResourcesWorkersV1WorkerToJSON(json: any): ControllerApiResourcesWorkersV1Worker {
return ControllerApiResourcesWorkersV1WorkerToJSONTyped(json, false);
}
export function ControllerApiResourcesWorkersV1WorkerToJSONTyped(value?: Omit<ControllerApiResourcesWorkersV1Worker, 'id'|'created_time'|'updated_time'|'address'|'canonical_tags'|'config_tags'|'last_status_time'|'controller_generated_activation_token'|'active_connection_count'|'type'|'api_tags'|'release_version'|'directly_connected_downstream_workers'|'authorized_actions'|'local_storage_state'|'remote_storage_state'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'scope_id': value['scopeId'],
'scope': ControllerApiResourcesScopesV1ScopeInfoToJSON(value['scope']),
'name': value['name'],
'description': value['description'],
'version': value['version'],
'worker_generated_auth_token': value['workerGeneratedAuthToken'],
};
}