@ibm-cloud/platform-services
Version:
Node.js client library for IBM Cloud Platform Services
839 lines (838 loc) • 59.7 kB
TypeScript
/**
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/// <reference types="node" />
import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http';
import { BaseService, UserOptions } from 'ibm-cloud-sdk-core';
/**
* With the Context Based Restrictions API, you can:
* * Create, list, get, replace, and delete network zones
* * Create, list, get, replace, and delete context-based restriction rules
* * Get account settings
*
* API Version: 1.0.1
*/
declare class ContextBasedRestrictionsV1 extends BaseService {
static DEFAULT_SERVICE_URL: string;
static DEFAULT_SERVICE_NAME: string;
/*************************
* Factory method
************************/
/**
* Constructs an instance of ContextBasedRestrictionsV1 with passed in options and external configuration.
*
* @param {UserOptions} [options] - The parameters to send to the service.
* @param {string} [options.serviceName] - The name of the service to configure
* @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service
* @param {string} [options.serviceUrl] - The base URL for the service
* @returns {ContextBasedRestrictionsV1}
*/
static newInstance(options: UserOptions): ContextBasedRestrictionsV1;
/**
* Construct a ContextBasedRestrictionsV1 object.
*
* @param {Object} options - Options for the service.
* @param {string} [options.serviceUrl] - The base URL for the service
* @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service.
* @param {Authenticator} options.authenticator - The Authenticator object used to authenticate requests to the service
* @constructor
* @returns {ContextBasedRestrictionsV1}
*/
constructor(options: UserOptions);
/*************************
* zones
************************/
/**
* Create a network zone.
*
* This operation creates a network zone for the specified account.
*
* @param {Object} [params] - The parameters to send to the service.
* @param {string} [params.name] - The name of the zone.
* @param {string} [params.accountId] - The id of the account owning this zone.
* @param {Address[]} [params.addresses] - The list of addresses in the zone.
* @param {string} [params.description] - The description of the zone.
* @param {Address[]} [params.excluded] - The list of excluded addresses in the zone. Only addresses of type
* `ipAddress`, `ipRange`, and `subnet` can be excluded.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Zone>>}
*/
createZone(params?: ContextBasedRestrictionsV1.CreateZoneParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Zone>>;
/**
* List network zones.
*
* This operation lists network zones in the specified account.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.accountId - The ID of the managing account.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {string} [params.name] - The name of the zone.
* @param {string} [params.sort] - Sorts results by using a valid sort field. To learn more, see
* [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting).
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.ZoneList>>}
*/
listZones(params: ContextBasedRestrictionsV1.ListZonesParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.ZoneList>>;
/**
* Get a network zone.
*
* This operation retrieves the network zone identified by the specified zone ID.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.zoneId - The ID of a zone.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Zone>>}
*/
getZone(params: ContextBasedRestrictionsV1.GetZoneParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Zone>>;
/**
* Replace a network zone.
*
* This operation replaces the network zone identified by the specified zone ID. Partial updates are not supported.
* The entire network zone object must be replaced.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.zoneId - The ID of a zone.
* @param {string} params.ifMatch - The current revision of the resource being updated. This can be found in the
* Create/Get/Update resource response ETag header.
* @param {string} [params.name] - The name of the zone.
* @param {string} [params.accountId] - The id of the account owning this zone.
* @param {Address[]} [params.addresses] - The list of addresses in the zone.
* @param {string} [params.description] - The description of the zone.
* @param {Address[]} [params.excluded] - The list of excluded addresses in the zone. Only addresses of type
* `ipAddress`, `ipRange`, and `subnet` can be excluded.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Zone>>}
*/
replaceZone(params: ContextBasedRestrictionsV1.ReplaceZoneParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Zone>>;
/**
* Delete a network zone.
*
* This operation deletes the network zone identified by the specified zone ID.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.zoneId - The ID of a zone.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.EmptyObject>>}
*/
deleteZone(params: ContextBasedRestrictionsV1.DeleteZoneParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.EmptyObject>>;
/**
* List available service reference targets.
*
* This operation lists all available service reference targets.
*
* @param {Object} [params] - The parameters to send to the service.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {string} [params.type] - Specifies the types of services to retrieve.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.ServiceRefTargetList>>}
*/
listAvailableServicerefTargets(params?: ContextBasedRestrictionsV1.ListAvailableServicerefTargetsParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.ServiceRefTargetList>>;
/**
* Get service reference target for a specified service name.
*
* This operation gets the service reference target for a specified service name.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.serviceName - The name of a service.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.ServiceRefTarget>>}
*/
getServicerefTarget(params: ContextBasedRestrictionsV1.GetServicerefTargetParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.ServiceRefTarget>>;
/*************************
* rules
************************/
/**
* Create a rule.
*
* This operation creates a rule for the specified account.
*
* @param {Object} [params] - The parameters to send to the service.
* @param {RuleContext[]} [params.contexts] - The contexts this rule applies to.
* @param {Resource[]} [params.resources] - The resources this rule apply to.
* @param {string} [params.description] - The description of the rule.
* @param {NewRuleOperations} [params.operations] - The operations this rule applies to.
* @param {string} [params.enforcementMode] - The rule enforcement mode:
* * `enabled` - The restrictions are enforced and reported. This is the default.
* * `disabled` - The restrictions are disabled. Nothing is enforced or reported.
* * `report` - The restrictions are evaluated and reported, but not enforced.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Rule>>}
*/
createRule(params?: ContextBasedRestrictionsV1.CreateRuleParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Rule>>;
/**
* List rules.
*
* This operation lists rules in the specified account.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.accountId - The ID of the managing account.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {string} [params.region] - The `region` resource attribute.
* @param {string} [params.resource] - The `resource` resource attribute.
* @param {string} [params.resourceType] - The `resourceType` resource attribute.
* @param {string} [params.serviceInstance] - The `serviceInstance` resource attribute.
* @param {string} [params.serviceName] - The `serviceName` resource attribute.
* @param {string} [params.serviceType] - The rule's `serviceType` resource attribute.
* @param {string} [params.serviceGroupId] - The rule's `service_group_id` resource attribute.
* @param {string} [params.zoneId] - The globally unique ID of the zone.
* @param {string} [params.sort] - Sorts results by using a valid sort field. To learn more, see
* [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting).
* @param {string} [params.enforcementMode] - The rule's `enforcement_mode` attribute.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.RuleList>>}
*/
listRules(params: ContextBasedRestrictionsV1.ListRulesParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.RuleList>>;
/**
* Get a rule.
*
* This operation retrieves the rule identified by the specified rule ID.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.ruleId - The ID of a rule.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Rule>>}
*/
getRule(params: ContextBasedRestrictionsV1.GetRuleParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Rule>>;
/**
* Replace a rule.
*
* This operation replaces the rule identified by the specified rule ID. Partial updates are not supported. The entire
* rule object must be replaced.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.ruleId - The ID of a rule.
* @param {string} params.ifMatch - The current revision of the resource being updated. This can be found in the
* Create/Get/Update resource response ETag header.
* @param {RuleContext[]} [params.contexts] - The contexts this rule applies to.
* @param {Resource[]} [params.resources] - The resources this rule apply to.
* @param {string} [params.description] - The description of the rule.
* @param {NewRuleOperations} [params.operations] - The operations this rule applies to.
* @param {string} [params.enforcementMode] - The rule enforcement mode:
* * `enabled` - The restrictions are enforced and reported. This is the default.
* * `disabled` - The restrictions are disabled. Nothing is enforced or reported.
* * `report` - The restrictions are evaluated and reported, but not enforced.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Rule>>}
*/
replaceRule(params: ContextBasedRestrictionsV1.ReplaceRuleParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.Rule>>;
/**
* Delete a rule.
*
* This operation deletes the rule identified by the specified rule ID.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.ruleId - The ID of a rule.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.EmptyObject>>}
*/
deleteRule(params: ContextBasedRestrictionsV1.DeleteRuleParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.EmptyObject>>;
/*************************
* accountSettings
************************/
/**
* Get account settings.
*
* This operation retrieves the settings for the specified account ID.
*
* @param {Object} params - The parameters to send to the service.
* @param {string} params.accountId - The ID of the account the settings are for.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.AccountSettings>>}
*/
getAccountSettings(params: ContextBasedRestrictionsV1.GetAccountSettingsParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.AccountSettings>>;
/*************************
* operations
************************/
/**
* List available service operations.
*
* This operation lists all available service operations.
*
* @param {Object} [params] - The parameters to send to the service.
* @param {string} [params.xCorrelationId] - The supplied or generated value of this header is logged for a request
* and repeated in a response header for the corresponding response. The same value is used for downstream requests
* and retries of those requests. If a value of this headers is not supplied in a request, the service generates a
* random (version 4) UUID.
* @param {string} [params.transactionId] - Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id`
* header. It is supported for backward compatibility with other IBM platform services that support the
* `Transaction-Id` header only. If both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has
* the precedence over `Transaction-Id`.
* @param {string} [params.serviceName] - The name of the service.
* @param {string} [params.serviceGroupId] - The id of the service group.
* @param {string} [params.resourceType] - The type of resource.
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
* @returns {Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.OperationsList>>}
*/
listAvailableServiceOperations(params?: ContextBasedRestrictionsV1.ListAvailableServiceOperationsParams): Promise<ContextBasedRestrictionsV1.Response<ContextBasedRestrictionsV1.OperationsList>>;
}
/*************************
* interfaces
************************/
declare namespace ContextBasedRestrictionsV1 {
/** An operation response. */
interface Response<T = any> {
result: T;
status: number;
statusText: string;
headers: IncomingHttpHeaders;
}
/** The callback for a service request. */
type Callback<T> = (error: any, response?: Response<T>) => void;
/** The body of a service request that returns no response data. */
interface EmptyObject {
}
/** A standard JS object, defined to avoid the limitations of `Object` and `object` */
interface JsonObject {
[key: string]: any;
}
/*************************
* request interfaces
************************/
/** Parameters for the `createZone` operation. */
interface CreateZoneParams {
/** The name of the zone. */
name?: string;
/** The id of the account owning this zone. */
accountId?: string;
/** The list of addresses in the zone. */
addresses?: Address[];
/** The description of the zone. */
description?: string;
/** The list of excluded addresses in the zone. Only addresses of type `ipAddress`, `ipRange`, and `subnet` can
* be excluded.
*/
excluded?: Address[];
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
headers?: OutgoingHttpHeaders;
}
/** Parameters for the `listZones` operation. */
interface ListZonesParams {
/** The ID of the managing account. */
accountId: string;
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
/** The name of the zone. */
name?: string;
/** Sorts results by using a valid sort field. To learn more, see
* [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting).
*/
sort?: string;
headers?: OutgoingHttpHeaders;
}
/** Parameters for the `getZone` operation. */
interface GetZoneParams {
/** The ID of a zone. */
zoneId: string;
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
headers?: OutgoingHttpHeaders;
}
/** Parameters for the `replaceZone` operation. */
interface ReplaceZoneParams {
/** The ID of a zone. */
zoneId: string;
/** The current revision of the resource being updated. This can be found in the Create/Get/Update resource
* response ETag header.
*/
ifMatch: string;
/** The name of the zone. */
name?: string;
/** The id of the account owning this zone. */
accountId?: string;
/** The list of addresses in the zone. */
addresses?: Address[];
/** The description of the zone. */
description?: string;
/** The list of excluded addresses in the zone. Only addresses of type `ipAddress`, `ipRange`, and `subnet` can
* be excluded.
*/
excluded?: Address[];
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
headers?: OutgoingHttpHeaders;
}
/** Parameters for the `deleteZone` operation. */
interface DeleteZoneParams {
/** The ID of a zone. */
zoneId: string;
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
headers?: OutgoingHttpHeaders;
}
/** Parameters for the `listAvailableServicerefTargets` operation. */
interface ListAvailableServicerefTargetsParams {
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
/** Specifies the types of services to retrieve. */
type?: ListAvailableServicerefTargetsConstants.Type | string;
headers?: OutgoingHttpHeaders;
}
/** Constants for the `listAvailableServicerefTargets` operation. */
namespace ListAvailableServicerefTargetsConstants {
/** Specifies the types of services to retrieve. */
enum Type {
ALL = "all",
PLATFORM_SERVICE = "platform_service"
}
}
/** Parameters for the `getServicerefTarget` operation. */
interface GetServicerefTargetParams {
/** The name of a service. */
serviceName: string;
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
headers?: OutgoingHttpHeaders;
}
/** Parameters for the `createRule` operation. */
interface CreateRuleParams {
/** The contexts this rule applies to. */
contexts?: RuleContext[];
/** The resources this rule apply to. */
resources?: Resource[];
/** The description of the rule. */
description?: string;
/** The operations this rule applies to. */
operations?: NewRuleOperations;
/** The rule enforcement mode:
* * `enabled` - The restrictions are enforced and reported. This is the default.
* * `disabled` - The restrictions are disabled. Nothing is enforced or reported.
* * `report` - The restrictions are evaluated and reported, but not enforced.
*/
enforcementMode?: CreateRuleConstants.EnforcementMode | string;
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
headers?: OutgoingHttpHeaders;
}
/** Constants for the `createRule` operation. */
namespace CreateRuleConstants {
/** The rule enforcement mode: * `enabled` - The restrictions are enforced and reported. This is the default. * `disabled` - The restrictions are disabled. Nothing is enforced or reported. * `report` - The restrictions are evaluated and reported, but not enforced. */
enum EnforcementMode {
ENABLED = "enabled",
DISABLED = "disabled",
REPORT = "report"
}
}
/** Parameters for the `listRules` operation. */
interface ListRulesParams {
/** The ID of the managing account. */
accountId: string;
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
/** The `region` resource attribute. */
region?: string;
/** The `resource` resource attribute. */
resource?: string;
/** The `resourceType` resource attribute. */
resourceType?: string;
/** The `serviceInstance` resource attribute. */
serviceInstance?: string;
/** The `serviceName` resource attribute. */
serviceName?: string;
/** The rule's `serviceType` resource attribute. */
serviceType?: string;
/** The rule's `service_group_id` resource attribute. */
serviceGroupId?: string;
/** The globally unique ID of the zone. */
zoneId?: string;
/** Sorts results by using a valid sort field. To learn more, see
* [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting).
*/
sort?: string;
/** The rule's `enforcement_mode` attribute. */
enforcementMode?: ListRulesConstants.EnforcementMode | string;
headers?: OutgoingHttpHeaders;
}
/** Constants for the `listRules` operation. */
namespace ListRulesConstants {
/** The rule's `enforcement_mode` attribute. */
enum EnforcementMode {
ENABLED = "enabled",
DISABLED = "disabled",
REPORT = "report"
}
}
/** Parameters for the `getRule` operation. */
interface GetRuleParams {
/** The ID of a rule. */
ruleId: string;
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
headers?: OutgoingHttpHeaders;
}
/** Parameters for the `replaceRule` operation. */
interface ReplaceRuleParams {
/** The ID of a rule. */
ruleId: string;
/** The current revision of the resource being updated. This can be found in the Create/Get/Update resource
* response ETag header.
*/
ifMatch: string;
/** The contexts this rule applies to. */
contexts?: RuleContext[];
/** The resources this rule apply to. */
resources?: Resource[];
/** The description of the rule. */
description?: string;
/** The operations this rule applies to. */
operations?: NewRuleOperations;
/** The rule enforcement mode:
* * `enabled` - The restrictions are enforced and reported. This is the default.
* * `disabled` - The restrictions are disabled. Nothing is enforced or reported.
* * `report` - The restrictions are evaluated and reported, but not enforced.
*/
enforcementMode?: ReplaceRuleConstants.EnforcementMode | string;
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
headers?: OutgoingHttpHeaders;
}
/** Constants for the `replaceRule` operation. */
namespace ReplaceRuleConstants {
/** The rule enforcement mode: * `enabled` - The restrictions are enforced and reported. This is the default. * `disabled` - The restrictions are disabled. Nothing is enforced or reported. * `report` - The restrictions are evaluated and reported, but not enforced. */
enum EnforcementMode {
ENABLED = "enabled",
DISABLED = "disabled",
REPORT = "report"
}
}
/** Parameters for the `deleteRule` operation. */
interface DeleteRuleParams {
/** The ID of a rule. */
ruleId: string;
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
headers?: OutgoingHttpHeaders;
}
/** Parameters for the `getAccountSettings` operation. */
interface GetAccountSettingsParams {
/** The ID of the account the settings are for. */
accountId: string;
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
headers?: OutgoingHttpHeaders;
}
/** Parameters for the `listAvailableServiceOperations` operation. */
interface ListAvailableServiceOperationsParams {
/** The supplied or generated value of this header is logged for a request and repeated in a response header for
* the corresponding response. The same value is used for downstream requests and retries of those requests. If a
* value of this headers is not supplied in a request, the service generates a random (version 4) UUID.
*/
xCorrelationId?: string;
/** Deprecated: The `Transaction-Id` header behaves as the `X-Correlation-Id` header. It is supported for
* backward compatibility with other IBM platform services that support the `Transaction-Id` header only. If both
* `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over
* `Transaction-Id`.
*/
transactionId?: string;
/** The name of the service. */
serviceName?: string;
/** The id of the service group. */
serviceGroupId?: string;
/** The type of resource. */
resourceType?: string;
headers?: OutgoingHttpHeaders;
}
/*************************
* model interfaces
************************/
/** Service API Type details. */
interface APIType {
/** The id of the API type. */
api_type_id: string;
/** The displayed name of the API type. */
display_name: string;
/** The description of the API type. */
description: string;
/** The type of the API type. */
type: string;
/** The actions available for the API type. */
actions: Action[];
/** The enforcement modes supported by the API type. */
enforcement_modes?: string[];
}
/** An output account settings. */
interface AccountSettings {
/** The globally unique ID of the account settings. */
id: string;
/** The account settings CRN. */
crn: string;
/** the max number of rules allowed for the account. */
rule_count_limit: number;
/** the max number of zones allowed for the account. */
zone_count_limit: number;
/** the max number of rules with tags allowed for the account. */
tags_rule_count_limit?: number;
/** the current number of rules used by the account. */
current_rule_count: number;
/** the current number of zones used by the account. */
current_zone_count: number;
/** the current number of rules with tags used by the account. */
current_tags_rule_count?: number;
/** The href link to the resource. */
href: string;
/** The time the resource was created. */
created_at: string;
/** IAM ID of the user or service which created the resource. */
created_by_id: string;
/** The last time the resource was modified. */
last_modified_at: string;
/** IAM ID of the user or service which modified the resource. */
last_modified_by_id: string;
}
/** Service API Type actions. */
interface Action {
/** The id of the action. */
action_id: string;
/** The description of the action. */
description: string;
}
/** A zone address. */
interface Address {
/** The type of address. */
type?: Address.Constants.Type | string;
}
namespace Address {
namespace Constants {
/** The type of address. */
enum Type {
IPADDRESS = "ipAddress",
IPRANGE = "ipRange",
SUBNET = "subnet",
VPC = "vpc",
SERVICEREF = "serviceRef"
}
}
}
/** The operations this rule applies to. */
interface NewRuleOperations {
/** The API types this rule applies to. */