@azure/ms-rest-azure-js
- Version 2.1.0
- Published
- 314 kB
- 3 dependencies
- MIT license
Install
npm i @azure/ms-rest-azure-js
yarn add @azure/ms-rest-azure-js
pnpm add @azure/ms-rest-azure-js
Overview
Isomorphic Azure client runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest
Index
Variables
Functions
Classes
Interfaces
Type Aliases
Variables
variable BaseResourceMapper
const BaseResourceMapper: CompositeMapper;
variable CloudErrorMapper
const CloudErrorMapper: CompositeMapper;
variable DEFAULT_LANGUAGE
const DEFAULT_LANGUAGE: string;
The default language in the request header.
{string}
variable msRestAzureVersion
const msRestAzureVersion: string;
The ms-rest-azure version. {string}
Functions
function createLROPollerFromInitialResponse
createLROPollerFromInitialResponse: ( azureServiceClient: AzureServiceClient, initialResponse: HttpOperationResponse, options?: RequestOptionsBase) => LROPoller;
function createLROPollerFromPollState
createLROPollerFromPollState: ( azureServiceClient: AzureServiceClient, lroMemento: LROPollState) => LROPoller;
function getDefaultUserAgentValue
getDefaultUserAgentValue: () => string;
Classes
class AzureServiceClient
class AzureServiceClient extends ServiceClient {}
Initializes a new instance of the AzureServiceClient class.
Parameter credentials
ApplicationTokenCredentials or UserTokenCredentials object used for authentication.
Parameter options
The parameter options used by AzureServiceClient
constructor
constructor(credentials: any, options?: AzureServiceClientOptions);
property acceptLanguage
acceptLanguage: string;
property longRunningOperationRetryTimeout
longRunningOperationRetryTimeout?: number;
The retry timeout in seconds for Long Running Operations. Default value is 30.
method beginLongRunningRequest
beginLongRunningRequest: ( request: RequestPrepareOptions | WebResource, options?: RequestOptionsBase) => Promise<LROPoller>;
Send the initial request of a LRO (long running operation) and get back an HttpLongRunningOperationResponse that provides methods for polling the LRO and checking if the LRO is finished.
Parameter request
The request object
Parameter options
Additional options to be sent while making the request
Returns
{Promise} The HttpLongRunningOperationResponse that provides methods for interacting with the LRO.
method restoreLROPoller
restoreLROPoller: (lroPollState: LROPollState) => LROPoller;
Restore an LROPoller from the provided LROPollState. This method can be used to recreate an LROPoller on a different process or machine.
method sendLongRunningRequest
sendLongRunningRequest: ( request: RequestPrepareOptions | WebResource, options?: RequestOptionsBase) => Promise<HttpOperationResponse>;
Provides a mechanism to make a request that will poll and provide the final result.
Parameter request
The request object
Parameter options
Additional options to be sent while making the request
Returns
{Promise<msRest.HttpOperationResponse>} The HttpOperationResponse containing the final polling request, response and the responseBody.
method sendLRORequest
sendLRORequest: ( operationArguments: OperationArguments, operationSpec: OperationSpec, options?: RequestOptionsBase) => Promise<LROPoller>;
Send the initial request of a LRO (long running operation) and get back an LROPoller that provides methods for polling the LRO and checking if the LRO is finished.
Parameter operationArguments
The arguments to the operation.
Parameter operationSpec
The specification for the operation.
Parameter options
Additional options to be sent while making the request.
Returns
The LROPoller object that provides methods for interacting with the LRO.
class CognitiveServicesCredentials
class CognitiveServicesCredentials extends ApiKeyCredentials {}
Creates a new CognitiveServicesCredentials object.
Parameter subscriptionKey
The CognitiveServices subscription key
constructor
constructor(subscriptionKey: string);
class LROPoller
class LROPoller {}
An HTTP operation response that provides special methods for interacting with LROs (long running operations).
constructor
constructor( _lroPollStrategy: LROPollStrategy, _initialResponse: HttpOperationResponse);
Create a new HttpLongRunningOperationResponse.
Parameter _lroPollStrategy
The LROPollStrategy that this HttpLongRunningOperationResponse will use to interact with the LRO.
method getInitialResponse
getInitialResponse: () => HttpOperationResponse;
Get the first response that the service sent back when the LRO was initiated.
method getMostRecentResponse
getMostRecentResponse: () => HttpOperationResponse;
Get the most recent response that the service sent back during this LRO.
method getOperationResponse
getOperationResponse: () => Promise<HttpOperationResponse | undefined>;
If the LRO is finished and in an acceptable state, then return the HttpOperationResponse. If the LRO is finished and not in an acceptable state, then throw the error that the LRO produced. If the LRO is not finished, then return undefined.
method getOperationStatus
getOperationStatus: () => LongRunningOperationStates;
Get the current status of the LRO.
method getPollState
getPollState: () => LROPollState | undefined;
Get an LROPollState object that can be used to poll this LRO in a different context (such as on a different process or a different machine). If the LRO couldn't produce an LRO polling strategy, then this will return undefined.
method isFinalStatusAcceptable
isFinalStatusAcceptable: () => boolean | undefined;
Get whether or not the LRO is finished and its final state is acceptable. If the LRO has not finished yet, then undefined will be returned. An "acceptable" final state is determined by the LRO strategy that the Azure service uses to perform long running operations.
method isFinished
isFinished: () => boolean;
Get whether or not the LRO is finished.
method poll
poll: () => Promise<LongRunningOperationStates>;
Send a single poll request and return the LRO's state.
method pollUntilFinished
pollUntilFinished: () => Promise<RestResponse>;
Send poll requests that check the LRO's status until it is determined that the LRO is finished.
Interfaces
interface AzureServiceClientOptions
interface AzureServiceClientOptions extends ServiceClientOptions {}
Options to be provided while creating the client.
property acceptLanguage
acceptLanguage?: string;
{string} [options.acceptLanguage] - Gets or sets the preferred language for the response. Default value is: "en-US".
property longRunningOperationRetryTimeout
longRunningOperationRetryTimeout?: number;
{number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
interface BaseResource
interface BaseResource {}
An empty interface.
interface CloudError
interface CloudError extends Error {}
Provides additional information about an http error response returned from a Microsoft Azure service.
property additionalInfo
additionalInfo?: AdditionalInfoElement;
{AdditionalInfoElement} [innerError] The additional error information
property code
code: string;
{string} code The error code parsed from the body of the http error response.
property details
details?: Array<CloudError>;
{Array} [details] An array of CloudError objects specifying the details.
property innerError
innerError?: any;
{any} [innerError] The inner error parsed from the body of the http error response
property message
message: string;
{string} message The error message parsed from the body of the http error response.
property target
target?: string;
{string} [target] The target of the error.
Type Aliases
type LongRunningOperationStates
type LongRunningOperationStates = | 'InProgress' | 'Succeeded' | 'Failed' | 'Canceled' | 'Cancelled';
Defines constants for long running operation states.
{string}
Package Files (7)
Dependencies (3)
Dev Dependencies (22)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@azure/ms-rest-azure-js
.
- Markdown[](https://www.jsdocs.io/package/@azure/ms-rest-azure-js)
- HTML<a href="https://www.jsdocs.io/package/@azure/ms-rest-azure-js"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4738 ms. - Missing or incorrect documentation? Open an issue for this package.