Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
/// <reference lib="esnext.asynciterable" />
export * from "./models";
export { StorageManagementClient } from "./storageManagementClient";
export * from "./operationsInterfaces";
+34
View File
@@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
export class LroImpl<T> implements LongRunningOperation<T> {
constructor(
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
private args: Record<string, unknown>,
private spec: {
readonly requestBody?: unknown;
readonly path?: string;
readonly httpMethod: string;
} & Record<string, any>,
public requestPath: string = spec.path!,
public requestMethod: string = spec.httpMethod
) {}
public async sendInitialRequest(): Promise<LroResponse<T>> {
return this.sendOperationFn(this.args, this.spec);
}
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
const { requestBody, ...restSpec } = this.spec;
return this.sendOperationFn(this.args, {
...restSpec,
path,
httpMethod: "GET"
});
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+615
View File
@@ -0,0 +1,615 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
OperationParameter,
OperationURLParameter,
OperationQueryParameter
} from "@azure/core-client";
import {
StorageAccountCheckNameAvailabilityParameters as StorageAccountCheckNameAvailabilityParametersMapper,
StorageAccountCreateParameters as StorageAccountCreateParametersMapper,
StorageAccountUpdateParameters as StorageAccountUpdateParametersMapper,
StorageAccountRegenerateKeyParameters as StorageAccountRegenerateKeyParametersMapper,
AccountSasParameters as AccountSasParametersMapper,
ServiceSasParameters as ServiceSasParametersMapper,
BlobRestoreParameters as BlobRestoreParametersMapper,
ManagementPolicy as ManagementPolicyMapper,
BlobInventoryPolicy as BlobInventoryPolicyMapper,
PrivateEndpointConnection as PrivateEndpointConnectionMapper,
ObjectReplicationPolicy as ObjectReplicationPolicyMapper,
LocalUser as LocalUserMapper,
EncryptionScope as EncryptionScopeMapper,
BlobServiceProperties as BlobServicePropertiesMapper,
BlobContainer as BlobContainerMapper,
LegalHold as LegalHoldMapper,
ImmutabilityPolicy as ImmutabilityPolicyMapper,
LeaseContainerRequest as LeaseContainerRequestMapper,
FileServiceProperties as FileServicePropertiesMapper,
FileShare as FileShareMapper,
DeletedShare as DeletedShareMapper,
LeaseShareRequest as LeaseShareRequestMapper,
QueueServiceProperties as QueueServicePropertiesMapper,
StorageQueue as StorageQueueMapper,
TableServiceProperties as TableServicePropertiesMapper,
Table as TableMapper
} from "../models/mappers";
export const accept: OperationParameter = {
parameterPath: "accept",
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Accept",
type: {
name: "String"
}
}
};
export const $host: OperationURLParameter = {
parameterPath: "$host",
mapper: {
serializedName: "$host",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2021-09-01",
isConstant: true,
serializedName: "api-version",
type: {
name: "String"
}
}
};
export const subscriptionId: OperationURLParameter = {
parameterPath: "subscriptionId",
mapper: {
constraints: {
MinLength: 1
},
serializedName: "subscriptionId",
required: true,
type: {
name: "String"
}
}
};
export const contentType: OperationParameter = {
parameterPath: ["options", "contentType"],
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Content-Type",
type: {
name: "String"
}
}
};
export const accountName: OperationParameter = {
parameterPath: "accountName",
mapper: StorageAccountCheckNameAvailabilityParametersMapper
};
export const parameters: OperationParameter = {
parameterPath: "parameters",
mapper: StorageAccountCreateParametersMapper
};
export const resourceGroupName: OperationURLParameter = {
parameterPath: "resourceGroupName",
mapper: {
constraints: {
MaxLength: 90,
MinLength: 1
},
serializedName: "resourceGroupName",
required: true,
type: {
name: "String"
}
}
};
export const accountName1: OperationURLParameter = {
parameterPath: "accountName",
mapper: {
constraints: {
MaxLength: 24,
MinLength: 3
},
serializedName: "accountName",
required: true,
type: {
name: "String"
}
}
};
export const expand: OperationQueryParameter = {
parameterPath: ["options", "expand"],
mapper: {
serializedName: "$expand",
type: {
name: "Enum",
allowedValues: ["geoReplicationStats", "blobRestoreStatus"]
}
}
};
export const parameters1: OperationParameter = {
parameterPath: "parameters",
mapper: StorageAccountUpdateParametersMapper
};
export const expand1: OperationQueryParameter = {
parameterPath: ["options", "expand"],
mapper: {
defaultValue: "kerb",
isConstant: true,
serializedName: "$expand",
type: {
name: "String"
}
}
};
export const regenerateKey: OperationParameter = {
parameterPath: "regenerateKey",
mapper: StorageAccountRegenerateKeyParametersMapper
};
export const parameters2: OperationParameter = {
parameterPath: "parameters",
mapper: AccountSasParametersMapper
};
export const parameters3: OperationParameter = {
parameterPath: "parameters",
mapper: ServiceSasParametersMapper
};
export const requestType: OperationQueryParameter = {
parameterPath: "requestType",
mapper: {
serializedName: "requestType",
required: true,
type: {
name: "String"
}
}
};
export const parameters4: OperationParameter = {
parameterPath: "parameters",
mapper: BlobRestoreParametersMapper
};
export const nextLink: OperationURLParameter = {
parameterPath: "nextLink",
mapper: {
serializedName: "nextLink",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};
export const deletedAccountName: OperationURLParameter = {
parameterPath: "deletedAccountName",
mapper: {
constraints: {
MaxLength: 24,
MinLength: 3
},
serializedName: "deletedAccountName",
required: true,
type: {
name: "String"
}
}
};
export const location: OperationURLParameter = {
parameterPath: "location",
mapper: {
serializedName: "location",
required: true,
type: {
name: "String"
}
}
};
export const managementPolicyName: OperationURLParameter = {
parameterPath: "managementPolicyName",
mapper: {
serializedName: "managementPolicyName",
required: true,
type: {
name: "String"
}
}
};
export const properties: OperationParameter = {
parameterPath: "properties",
mapper: ManagementPolicyMapper
};
export const blobInventoryPolicyName: OperationURLParameter = {
parameterPath: "blobInventoryPolicyName",
mapper: {
serializedName: "blobInventoryPolicyName",
required: true,
type: {
name: "String"
}
}
};
export const properties1: OperationParameter = {
parameterPath: "properties",
mapper: BlobInventoryPolicyMapper
};
export const privateEndpointConnectionName: OperationURLParameter = {
parameterPath: "privateEndpointConnectionName",
mapper: {
serializedName: "privateEndpointConnectionName",
required: true,
type: {
name: "String"
}
}
};
export const properties2: OperationParameter = {
parameterPath: "properties",
mapper: PrivateEndpointConnectionMapper
};
export const objectReplicationPolicyId: OperationURLParameter = {
parameterPath: "objectReplicationPolicyId",
mapper: {
constraints: {
MinLength: 1
},
serializedName: "objectReplicationPolicyId",
required: true,
type: {
name: "String"
}
}
};
export const properties3: OperationParameter = {
parameterPath: "properties",
mapper: ObjectReplicationPolicyMapper
};
export const username: OperationURLParameter = {
parameterPath: "username",
mapper: {
constraints: {
MaxLength: 64,
MinLength: 3
},
serializedName: "username",
required: true,
type: {
name: "String"
}
}
};
export const properties4: OperationParameter = {
parameterPath: "properties",
mapper: LocalUserMapper
};
export const encryptionScope: OperationParameter = {
parameterPath: "encryptionScope",
mapper: EncryptionScopeMapper
};
export const encryptionScopeName: OperationURLParameter = {
parameterPath: "encryptionScopeName",
mapper: {
constraints: {
MaxLength: 63,
MinLength: 3
},
serializedName: "encryptionScopeName",
required: true,
type: {
name: "String"
}
}
};
export const parameters5: OperationParameter = {
parameterPath: "parameters",
mapper: BlobServicePropertiesMapper
};
export const blobServicesName: OperationURLParameter = {
parameterPath: "blobServicesName",
mapper: {
defaultValue: "default",
isConstant: true,
serializedName: "BlobServicesName",
type: {
name: "String"
}
}
};
export const maxpagesize: OperationQueryParameter = {
parameterPath: ["options", "maxpagesize"],
mapper: {
serializedName: "$maxpagesize",
type: {
name: "String"
}
}
};
export const filter: OperationQueryParameter = {
parameterPath: ["options", "filter"],
mapper: {
serializedName: "$filter",
type: {
name: "String"
}
}
};
export const include: OperationQueryParameter = {
parameterPath: ["options", "include"],
mapper: {
serializedName: "$include",
type: {
name: "String"
}
}
};
export const blobContainer: OperationParameter = {
parameterPath: "blobContainer",
mapper: BlobContainerMapper
};
export const containerName: OperationURLParameter = {
parameterPath: "containerName",
mapper: {
constraints: {
MaxLength: 63,
MinLength: 3
},
serializedName: "containerName",
required: true,
type: {
name: "String"
}
}
};
export const legalHold: OperationParameter = {
parameterPath: "legalHold",
mapper: LegalHoldMapper
};
export const parameters6: OperationParameter = {
parameterPath: ["options", "parameters"],
mapper: ImmutabilityPolicyMapper
};
export const immutabilityPolicyName: OperationURLParameter = {
parameterPath: "immutabilityPolicyName",
mapper: {
defaultValue: "default",
isConstant: true,
serializedName: "immutabilityPolicyName",
type: {
name: "String"
}
}
};
export const ifMatch: OperationParameter = {
parameterPath: ["options", "ifMatch"],
mapper: {
serializedName: "If-Match",
type: {
name: "String"
}
}
};
export const ifMatch1: OperationParameter = {
parameterPath: "ifMatch",
mapper: {
serializedName: "If-Match",
required: true,
type: {
name: "String"
}
}
};
export const parameters7: OperationParameter = {
parameterPath: ["options", "parameters"],
mapper: LeaseContainerRequestMapper
};
export const parameters8: OperationParameter = {
parameterPath: "parameters",
mapper: FileServicePropertiesMapper
};
export const fileServicesName: OperationURLParameter = {
parameterPath: "fileServicesName",
mapper: {
defaultValue: "default",
isConstant: true,
serializedName: "FileServicesName",
type: {
name: "String"
}
}
};
export const expand2: OperationQueryParameter = {
parameterPath: ["options", "expand"],
mapper: {
serializedName: "$expand",
type: {
name: "String"
}
}
};
export const fileShare: OperationParameter = {
parameterPath: "fileShare",
mapper: FileShareMapper
};
export const shareName: OperationURLParameter = {
parameterPath: "shareName",
mapper: {
constraints: {
MaxLength: 63,
MinLength: 3
},
serializedName: "shareName",
required: true,
type: {
name: "String"
}
}
};
export const xMsSnapshot: OperationParameter = {
parameterPath: ["options", "xMsSnapshot"],
mapper: {
serializedName: "x-ms-snapshot",
type: {
name: "String"
}
}
};
export const include1: OperationQueryParameter = {
parameterPath: ["options", "include"],
mapper: {
serializedName: "$include",
type: {
name: "String"
}
}
};
export const deletedShare: OperationParameter = {
parameterPath: "deletedShare",
mapper: DeletedShareMapper
};
export const parameters9: OperationParameter = {
parameterPath: ["options", "parameters"],
mapper: LeaseShareRequestMapper
};
export const parameters10: OperationParameter = {
parameterPath: "parameters",
mapper: QueueServicePropertiesMapper
};
export const queueServiceName: OperationURLParameter = {
parameterPath: "queueServiceName",
mapper: {
defaultValue: "default",
isConstant: true,
serializedName: "queueServiceName",
type: {
name: "String"
}
}
};
export const queue: OperationParameter = {
parameterPath: "queue",
mapper: StorageQueueMapper
};
export const queueName: OperationURLParameter = {
parameterPath: "queueName",
mapper: {
constraints: {
Pattern: new RegExp("^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$"),
MaxLength: 63,
MinLength: 3
},
serializedName: "queueName",
required: true,
type: {
name: "String"
}
}
};
export const parameters11: OperationParameter = {
parameterPath: "parameters",
mapper: TableServicePropertiesMapper
};
export const tableServiceName: OperationURLParameter = {
parameterPath: "tableServiceName",
mapper: {
defaultValue: "default",
isConstant: true,
serializedName: "tableServiceName",
type: {
name: "String"
}
}
};
export const parameters12: OperationParameter = {
parameterPath: ["options", "parameters"],
mapper: TableMapper
};
export const tableName: OperationURLParameter = {
parameterPath: "tableName",
mapper: {
constraints: {
Pattern: new RegExp("^[A-Za-z][A-Za-z0-9]{2,62}$"),
MaxLength: 63,
MinLength: 3
},
serializedName: "tableName",
required: true,
type: {
name: "String"
}
}
};
+952
View File
@@ -0,0 +1,952 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { BlobContainers } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
import { LroImpl } from "../lroImpl";
import {
ListContainerItem,
BlobContainersListNextOptionalParams,
BlobContainersListOptionalParams,
BlobContainersListResponse,
BlobContainer,
BlobContainersCreateOptionalParams,
BlobContainersCreateResponse,
BlobContainersUpdateOptionalParams,
BlobContainersUpdateResponse,
BlobContainersGetOptionalParams,
BlobContainersGetResponse,
BlobContainersDeleteOptionalParams,
LegalHold,
BlobContainersSetLegalHoldOptionalParams,
BlobContainersSetLegalHoldResponse,
BlobContainersClearLegalHoldOptionalParams,
BlobContainersClearLegalHoldResponse,
BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams,
BlobContainersCreateOrUpdateImmutabilityPolicyResponse,
BlobContainersGetImmutabilityPolicyOptionalParams,
BlobContainersGetImmutabilityPolicyResponse,
BlobContainersDeleteImmutabilityPolicyOptionalParams,
BlobContainersDeleteImmutabilityPolicyResponse,
BlobContainersLockImmutabilityPolicyOptionalParams,
BlobContainersLockImmutabilityPolicyResponse,
BlobContainersExtendImmutabilityPolicyOptionalParams,
BlobContainersExtendImmutabilityPolicyResponse,
BlobContainersLeaseOptionalParams,
BlobContainersLeaseResponse,
BlobContainersObjectLevelWormOptionalParams,
BlobContainersListNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing BlobContainers operations. */
export class BlobContainersImpl implements BlobContainers {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class BlobContainers class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Lists all containers and does not support a prefix like data plane. Also SRP today does not return
* continuation token.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
public list(
resourceGroupName: string,
accountName: string,
options?: BlobContainersListOptionalParams
): PagedAsyncIterableIterator<ListContainerItem> {
const iter = this.listPagingAll(resourceGroupName, accountName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(resourceGroupName, accountName, options);
}
};
}
private async *listPagingPage(
resourceGroupName: string,
accountName: string,
options?: BlobContainersListOptionalParams
): AsyncIterableIterator<ListContainerItem[]> {
let result = await this._list(resourceGroupName, accountName, options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listNext(
resourceGroupName,
accountName,
continuationToken,
options
);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listPagingAll(
resourceGroupName: string,
accountName: string,
options?: BlobContainersListOptionalParams
): AsyncIterableIterator<ListContainerItem> {
for await (const page of this.listPagingPage(
resourceGroupName,
accountName,
options
)) {
yield* page;
}
}
/**
* Lists all containers and does not support a prefix like data plane. Also SRP today does not return
* continuation token.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
private _list(
resourceGroupName: string,
accountName: string,
options?: BlobContainersListOptionalParams
): Promise<BlobContainersListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* Creates a new container under the specified account as described by request body. The container
* resource includes metadata and properties for that container. It does not include a list of the
* blobs contained by the container.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param blobContainer Properties of the blob container to create.
* @param options The options parameters.
*/
create(
resourceGroupName: string,
accountName: string,
containerName: string,
blobContainer: BlobContainer,
options?: BlobContainersCreateOptionalParams
): Promise<BlobContainersCreateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, blobContainer, options },
createOperationSpec
);
}
/**
* Updates container properties as specified in request body. Properties not mentioned in the request
* will be unchanged. Update fails if the specified container doesn't already exist.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param blobContainer Properties to update for the blob container.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
accountName: string,
containerName: string,
blobContainer: BlobContainer,
options?: BlobContainersUpdateOptionalParams
): Promise<BlobContainersUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, blobContainer, options },
updateOperationSpec
);
}
/**
* Gets properties of a specified container.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersGetOptionalParams
): Promise<BlobContainersGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, options },
getOperationSpec
);
}
/**
* Deletes specified container under its account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, options },
deleteOperationSpec
);
}
/**
* Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows
* an append pattern and does not clear out the existing tags that are not specified in the request.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param legalHold The LegalHold property that will be set to a blob container.
* @param options The options parameters.
*/
setLegalHold(
resourceGroupName: string,
accountName: string,
containerName: string,
legalHold: LegalHold,
options?: BlobContainersSetLegalHoldOptionalParams
): Promise<BlobContainersSetLegalHoldResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, legalHold, options },
setLegalHoldOperationSpec
);
}
/**
* Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation.
* ClearLegalHold clears out only the specified tags in the request.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param legalHold The LegalHold property that will be clear from a blob container.
* @param options The options parameters.
*/
clearLegalHold(
resourceGroupName: string,
accountName: string,
containerName: string,
legalHold: LegalHold,
options?: BlobContainersClearLegalHoldOptionalParams
): Promise<BlobContainersClearLegalHoldResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, legalHold, options },
clearLegalHoldOperationSpec
);
}
/**
* Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not
* required for this operation.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
createOrUpdateImmutabilityPolicy(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams
): Promise<BlobContainersCreateOrUpdateImmutabilityPolicyResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, options },
createOrUpdateImmutabilityPolicyOperationSpec
);
}
/**
* Gets the existing immutability policy along with the corresponding ETag in response headers and
* body.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
getImmutabilityPolicy(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersGetImmutabilityPolicyOptionalParams
): Promise<BlobContainersGetImmutabilityPolicyResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, options },
getImmutabilityPolicyOperationSpec
);
}
/**
* Aborts an unlocked immutability policy. The response of delete has
* immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation.
* Deleting a locked immutability policy is not allowed, the only way is to delete the container after
* deleting all expired blobs inside the policy locked container.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*"
* can be used to apply the operation only if the immutability policy already exists. If omitted, this
* operation will always be applied.
* @param options The options parameters.
*/
deleteImmutabilityPolicy(
resourceGroupName: string,
accountName: string,
containerName: string,
ifMatch: string,
options?: BlobContainersDeleteImmutabilityPolicyOptionalParams
): Promise<BlobContainersDeleteImmutabilityPolicyResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, ifMatch, options },
deleteImmutabilityPolicyOperationSpec
);
}
/**
* Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is
* ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*"
* can be used to apply the operation only if the immutability policy already exists. If omitted, this
* operation will always be applied.
* @param options The options parameters.
*/
lockImmutabilityPolicy(
resourceGroupName: string,
accountName: string,
containerName: string,
ifMatch: string,
options?: BlobContainersLockImmutabilityPolicyOptionalParams
): Promise<BlobContainersLockImmutabilityPolicyResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, ifMatch, options },
lockImmutabilityPolicyOperationSpec
);
}
/**
* Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action
* allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*"
* can be used to apply the operation only if the immutability policy already exists. If omitted, this
* operation will always be applied.
* @param options The options parameters.
*/
extendImmutabilityPolicy(
resourceGroupName: string,
accountName: string,
containerName: string,
ifMatch: string,
options?: BlobContainersExtendImmutabilityPolicyOptionalParams
): Promise<BlobContainersExtendImmutabilityPolicyResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, ifMatch, options },
extendImmutabilityPolicyOperationSpec
);
}
/**
* The Lease Container operation establishes and manages a lock on a container for delete operations.
* The lock duration can be 15 to 60 seconds, or can be infinite.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
lease(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersLeaseOptionalParams
): Promise<BlobContainersLeaseResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, containerName, options },
leaseOperationSpec
);
}
/**
* This operation migrates a blob container from container level WORM to object level immutability
* enabled container. Prerequisites require a container level immutability policy either in locked or
* unlocked state, Account level versioning must be enabled and there should be no Legal hold on the
* container.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
async beginObjectLevelWorm(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersObjectLevelWormOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise<void> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback
}
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON()
}
};
};
const lro = new LroImpl(
sendOperation,
{ resourceGroupName, accountName, containerName, options },
objectLevelWormOperationSpec
);
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "location"
});
await poller.poll();
return poller;
}
/**
* This operation migrates a blob container from container level WORM to object level immutability
* enabled container. Prerequisites require a container level immutability policy either in locked or
* unlocked state, Account level versioning must be enabled and there should be no Legal hold on the
* container.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
async beginObjectLevelWormAndWait(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersObjectLevelWormOptionalParams
): Promise<void> {
const poller = await this.beginObjectLevelWorm(
resourceGroupName,
accountName,
containerName,
options
);
return poller.pollUntilDone();
}
/**
* ListNext
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param nextLink The nextLink from the previous successful call to the List method.
* @param options The options parameters.
*/
private _listNext(
resourceGroupName: string,
accountName: string,
nextLink: string,
options?: BlobContainersListNextOptionalParams
): Promise<BlobContainersListNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, nextLink, options },
listNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListContainerItems
}
},
queryParameters: [
Parameters.apiVersion,
Parameters.maxpagesize,
Parameters.filter,
Parameters.include
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const createOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.BlobContainer
},
201: {
bodyMapper: Mappers.BlobContainer
}
},
requestBody: Parameters.blobContainer,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const updateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}",
httpMethod: "PATCH",
responses: {
200: {
bodyMapper: Mappers.BlobContainer
}
},
requestBody: Parameters.blobContainer,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BlobContainer
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName
],
headerParameters: [Parameters.accept],
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}",
httpMethod: "DELETE",
responses: { 200: {}, 204: {} },
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName
],
serializer
};
const setLegalHoldOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.LegalHold
}
},
requestBody: Parameters.legalHold,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const clearLegalHoldOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.LegalHold
}
},
requestBody: Parameters.legalHold,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const createOrUpdateImmutabilityPolicyOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.ImmutabilityPolicy,
headersMapper:
Mappers.BlobContainersCreateOrUpdateImmutabilityPolicyHeaders
}
},
requestBody: Parameters.parameters6,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName,
Parameters.immutabilityPolicyName
],
headerParameters: [
Parameters.accept,
Parameters.contentType,
Parameters.ifMatch
],
mediaType: "json",
serializer
};
const getImmutabilityPolicyOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ImmutabilityPolicy,
headersMapper: Mappers.BlobContainersGetImmutabilityPolicyHeaders
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName,
Parameters.immutabilityPolicyName
],
headerParameters: [Parameters.accept, Parameters.ifMatch],
serializer
};
const deleteImmutabilityPolicyOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}",
httpMethod: "DELETE",
responses: {
200: {
bodyMapper: Mappers.ImmutabilityPolicy,
headersMapper: Mappers.BlobContainersDeleteImmutabilityPolicyHeaders
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName,
Parameters.immutabilityPolicyName
],
headerParameters: [Parameters.accept, Parameters.ifMatch1],
serializer
};
const lockImmutabilityPolicyOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.ImmutabilityPolicy,
headersMapper: Mappers.BlobContainersLockImmutabilityPolicyHeaders
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName
],
headerParameters: [Parameters.accept, Parameters.ifMatch1],
serializer
};
const extendImmutabilityPolicyOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.ImmutabilityPolicy,
headersMapper: Mappers.BlobContainersExtendImmutabilityPolicyHeaders
}
},
requestBody: Parameters.parameters6,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName
],
headerParameters: [
Parameters.accept,
Parameters.contentType,
Parameters.ifMatch1
],
mediaType: "json",
serializer
};
const leaseOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.LeaseContainerResponse
}
},
requestBody: Parameters.parameters7,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const objectLevelWormOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate",
httpMethod: "POST",
responses: {
200: {},
201: {},
202: {},
204: {},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.containerName
],
headerParameters: [Parameters.accept],
serializer
};
const listNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListContainerItems
}
},
queryParameters: [
Parameters.apiVersion,
Parameters.maxpagesize,
Parameters.filter,
Parameters.include
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
+282
View File
@@ -0,0 +1,282 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { BlobInventoryPolicies } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
BlobInventoryPolicy,
BlobInventoryPoliciesListOptionalParams,
BlobInventoryPolicyName,
BlobInventoryPoliciesGetOptionalParams,
BlobInventoryPoliciesGetResponse,
BlobInventoryPoliciesCreateOrUpdateOptionalParams,
BlobInventoryPoliciesCreateOrUpdateResponse,
BlobInventoryPoliciesDeleteOptionalParams,
BlobInventoryPoliciesListResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing BlobInventoryPolicies operations. */
export class BlobInventoryPoliciesImpl implements BlobInventoryPolicies {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class BlobInventoryPolicies class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Gets the blob inventory policy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
public list(
resourceGroupName: string,
accountName: string,
options?: BlobInventoryPoliciesListOptionalParams
): PagedAsyncIterableIterator<BlobInventoryPolicy> {
const iter = this.listPagingAll(resourceGroupName, accountName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(resourceGroupName, accountName, options);
}
};
}
private async *listPagingPage(
resourceGroupName: string,
accountName: string,
options?: BlobInventoryPoliciesListOptionalParams
): AsyncIterableIterator<BlobInventoryPolicy[]> {
let result = await this._list(resourceGroupName, accountName, options);
yield result.value || [];
}
private async *listPagingAll(
resourceGroupName: string,
accountName: string,
options?: BlobInventoryPoliciesListOptionalParams
): AsyncIterableIterator<BlobInventoryPolicy> {
for await (const page of this.listPagingPage(
resourceGroupName,
accountName,
options
)) {
yield* page;
}
}
/**
* Gets the blob inventory policy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should
* always be 'default'
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
blobInventoryPolicyName: BlobInventoryPolicyName,
options?: BlobInventoryPoliciesGetOptionalParams
): Promise<BlobInventoryPoliciesGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, blobInventoryPolicyName, options },
getOperationSpec
);
}
/**
* Sets the blob inventory policy to the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should
* always be 'default'
* @param properties The blob inventory policy set to a storage account.
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
accountName: string,
blobInventoryPolicyName: BlobInventoryPolicyName,
properties: BlobInventoryPolicy,
options?: BlobInventoryPoliciesCreateOrUpdateOptionalParams
): Promise<BlobInventoryPoliciesCreateOrUpdateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
accountName,
blobInventoryPolicyName,
properties,
options
},
createOrUpdateOperationSpec
);
}
/**
* Deletes the blob inventory policy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should
* always be 'default'
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
blobInventoryPolicyName: BlobInventoryPolicyName,
options?: BlobInventoryPoliciesDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, blobInventoryPolicyName, options },
deleteOperationSpec
);
}
/**
* Gets the blob inventory policy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
private _list(
resourceGroupName: string,
accountName: string,
options?: BlobInventoryPoliciesListOptionalParams
): Promise<BlobInventoryPoliciesListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BlobInventoryPolicy
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.blobInventoryPolicyName
],
headerParameters: [Parameters.accept],
serializer
};
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.BlobInventoryPolicy
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.properties1,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.blobInventoryPolicyName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.blobInventoryPolicyName
],
headerParameters: [Parameters.accept],
serializer
};
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListBlobInventoryPolicy
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
+217
View File
@@ -0,0 +1,217 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { BlobServices } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
BlobServiceProperties,
BlobServicesListOptionalParams,
BlobServicesListResponse,
BlobServicesSetServicePropertiesOptionalParams,
BlobServicesSetServicePropertiesResponse,
BlobServicesGetServicePropertiesOptionalParams,
BlobServicesGetServicePropertiesResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing BlobServices operations. */
export class BlobServicesImpl implements BlobServices {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class BlobServices class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* List blob services of storage account. It returns a collection of one object named default.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
public list(
resourceGroupName: string,
accountName: string,
options?: BlobServicesListOptionalParams
): PagedAsyncIterableIterator<BlobServiceProperties> {
const iter = this.listPagingAll(resourceGroupName, accountName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(resourceGroupName, accountName, options);
}
};
}
private async *listPagingPage(
resourceGroupName: string,
accountName: string,
options?: BlobServicesListOptionalParams
): AsyncIterableIterator<BlobServiceProperties[]> {
let result = await this._list(resourceGroupName, accountName, options);
yield result.value || [];
}
private async *listPagingAll(
resourceGroupName: string,
accountName: string,
options?: BlobServicesListOptionalParams
): AsyncIterableIterator<BlobServiceProperties> {
for await (const page of this.listPagingPage(
resourceGroupName,
accountName,
options
)) {
yield* page;
}
}
/**
* List blob services of storage account. It returns a collection of one object named default.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
private _list(
resourceGroupName: string,
accountName: string,
options?: BlobServicesListOptionalParams
): Promise<BlobServicesListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* Sets the properties of a storage accounts Blob service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The properties of a storage accounts Blob service, including properties for
* Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
* @param options The options parameters.
*/
setServiceProperties(
resourceGroupName: string,
accountName: string,
parameters: BlobServiceProperties,
options?: BlobServicesSetServicePropertiesOptionalParams
): Promise<BlobServicesSetServicePropertiesResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, parameters, options },
setServicePropertiesOperationSpec
);
}
/**
* Gets the properties of a storage accounts Blob service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
getServiceProperties(
resourceGroupName: string,
accountName: string,
options?: BlobServicesGetServicePropertiesOptionalParams
): Promise<BlobServicesGetServicePropertiesResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
getServicePropertiesOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BlobServiceItems
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const setServicePropertiesOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.BlobServiceProperties
}
},
requestBody: Parameters.parameters5,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.blobServicesName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getServicePropertiesOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.BlobServiceProperties
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.blobServicesName
],
headerParameters: [Parameters.accept],
serializer
};
+183
View File
@@ -0,0 +1,183 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { DeletedAccounts } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
DeletedAccount,
DeletedAccountsListNextOptionalParams,
DeletedAccountsListOptionalParams,
DeletedAccountsListResponse,
DeletedAccountsGetOptionalParams,
DeletedAccountsGetResponse,
DeletedAccountsListNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing DeletedAccounts operations. */
export class DeletedAccountsImpl implements DeletedAccounts {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class DeletedAccounts class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Lists deleted accounts under the subscription.
* @param options The options parameters.
*/
public list(
options?: DeletedAccountsListOptionalParams
): PagedAsyncIterableIterator<DeletedAccount> {
const iter = this.listPagingAll(options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(options);
}
};
}
private async *listPagingPage(
options?: DeletedAccountsListOptionalParams
): AsyncIterableIterator<DeletedAccount[]> {
let result = await this._list(options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listNext(continuationToken, options);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listPagingAll(
options?: DeletedAccountsListOptionalParams
): AsyncIterableIterator<DeletedAccount> {
for await (const page of this.listPagingPage(options)) {
yield* page;
}
}
/**
* Lists deleted accounts under the subscription.
* @param options The options parameters.
*/
private _list(
options?: DeletedAccountsListOptionalParams
): Promise<DeletedAccountsListResponse> {
return this.client.sendOperationRequest({ options }, listOperationSpec);
}
/**
* Get properties of specified deleted account resource.
* @param deletedAccountName Name of the deleted storage account.
* @param location The location of the deleted storage account.
* @param options The options parameters.
*/
get(
deletedAccountName: string,
location: string,
options?: DeletedAccountsGetOptionalParams
): Promise<DeletedAccountsGetResponse> {
return this.client.sendOperationRequest(
{ deletedAccountName, location, options },
getOperationSpec
);
}
/**
* ListNext
* @param nextLink The nextLink from the previous successful call to the List method.
* @param options The options parameters.
*/
private _listNext(
nextLink: string,
options?: DeletedAccountsListNextOptionalParams
): Promise<DeletedAccountsListNextResponse> {
return this.client.sendOperationRequest(
{ nextLink, options },
listNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.DeletedAccountListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.subscriptionId],
headerParameters: [Parameters.accept],
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.DeletedAccount
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.deletedAccountName,
Parameters.location
],
headerParameters: [Parameters.accept],
serializer
};
const listNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.DeletedAccountListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
+356
View File
@@ -0,0 +1,356 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { EncryptionScopes } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
EncryptionScope,
EncryptionScopesListNextOptionalParams,
EncryptionScopesListOptionalParams,
EncryptionScopesPutOptionalParams,
EncryptionScopesPutResponse,
EncryptionScopesPatchOptionalParams,
EncryptionScopesPatchResponse,
EncryptionScopesGetOptionalParams,
EncryptionScopesGetResponse,
EncryptionScopesListResponse,
EncryptionScopesListNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing EncryptionScopes operations. */
export class EncryptionScopesImpl implements EncryptionScopes {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class EncryptionScopes class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Lists all the encryption scopes available under the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
public list(
resourceGroupName: string,
accountName: string,
options?: EncryptionScopesListOptionalParams
): PagedAsyncIterableIterator<EncryptionScope> {
const iter = this.listPagingAll(resourceGroupName, accountName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(resourceGroupName, accountName, options);
}
};
}
private async *listPagingPage(
resourceGroupName: string,
accountName: string,
options?: EncryptionScopesListOptionalParams
): AsyncIterableIterator<EncryptionScope[]> {
let result = await this._list(resourceGroupName, accountName, options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listNext(
resourceGroupName,
accountName,
continuationToken,
options
);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listPagingAll(
resourceGroupName: string,
accountName: string,
options?: EncryptionScopesListOptionalParams
): AsyncIterableIterator<EncryptionScope> {
for await (const page of this.listPagingPage(
resourceGroupName,
accountName,
options
)) {
yield* page;
}
}
/**
* Synchronously creates or updates an encryption scope under the specified storage account. If an
* encryption scope is already created and a subsequent request is issued with different properties,
* the encryption scope properties will be updated per the specified request.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param encryptionScopeName The name of the encryption scope within the specified storage account.
* Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case
* letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a
* letter or number.
* @param encryptionScope Encryption scope properties to be used for the create or update.
* @param options The options parameters.
*/
put(
resourceGroupName: string,
accountName: string,
encryptionScopeName: string,
encryptionScope: EncryptionScope,
options?: EncryptionScopesPutOptionalParams
): Promise<EncryptionScopesPutResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
accountName,
encryptionScopeName,
encryptionScope,
options
},
putOperationSpec
);
}
/**
* Update encryption scope properties as specified in the request body. Update fails if the specified
* encryption scope does not already exist.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param encryptionScopeName The name of the encryption scope within the specified storage account.
* Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case
* letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a
* letter or number.
* @param encryptionScope Encryption scope properties to be used for the update.
* @param options The options parameters.
*/
patch(
resourceGroupName: string,
accountName: string,
encryptionScopeName: string,
encryptionScope: EncryptionScope,
options?: EncryptionScopesPatchOptionalParams
): Promise<EncryptionScopesPatchResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
accountName,
encryptionScopeName,
encryptionScope,
options
},
patchOperationSpec
);
}
/**
* Returns the properties for the specified encryption scope.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param encryptionScopeName The name of the encryption scope within the specified storage account.
* Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case
* letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a
* letter or number.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
encryptionScopeName: string,
options?: EncryptionScopesGetOptionalParams
): Promise<EncryptionScopesGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, encryptionScopeName, options },
getOperationSpec
);
}
/**
* Lists all the encryption scopes available under the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
private _list(
resourceGroupName: string,
accountName: string,
options?: EncryptionScopesListOptionalParams
): Promise<EncryptionScopesListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* ListNext
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param nextLink The nextLink from the previous successful call to the List method.
* @param options The options parameters.
*/
private _listNext(
resourceGroupName: string,
accountName: string,
nextLink: string,
options?: EncryptionScopesListNextOptionalParams
): Promise<EncryptionScopesListNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, nextLink, options },
listNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const putOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.EncryptionScope
},
201: {
bodyMapper: Mappers.EncryptionScope
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.encryptionScope,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.encryptionScopeName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const patchOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}",
httpMethod: "PATCH",
responses: {
200: {
bodyMapper: Mappers.EncryptionScope
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.encryptionScope,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.encryptionScopeName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.EncryptionScope
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.encryptionScopeName
],
headerParameters: [Parameters.accept],
serializer
};
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.EncryptionScopeListResult
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const listNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.EncryptionScopeListResult
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
+173
View File
@@ -0,0 +1,173 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { FileServices } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
FileServicesListOptionalParams,
FileServicesListResponse,
FileServiceProperties,
FileServicesSetServicePropertiesOptionalParams,
FileServicesSetServicePropertiesResponse,
FileServicesGetServicePropertiesOptionalParams,
FileServicesGetServicePropertiesResponse
} from "../models";
/** Class containing FileServices operations. */
export class FileServicesImpl implements FileServices {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class FileServices class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* List all file services in storage accounts
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: FileServicesListOptionalParams
): Promise<FileServicesListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
* Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin
* Resource Sharing) rules.
* @param options The options parameters.
*/
setServiceProperties(
resourceGroupName: string,
accountName: string,
parameters: FileServiceProperties,
options?: FileServicesSetServicePropertiesOptionalParams
): Promise<FileServicesSetServicePropertiesResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, parameters, options },
setServicePropertiesOperationSpec
);
}
/**
* Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
* Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
getServiceProperties(
resourceGroupName: string,
accountName: string,
options?: FileServicesGetServicePropertiesOptionalParams
): Promise<FileServicesGetServicePropertiesResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
getServicePropertiesOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.FileServiceItems
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const setServicePropertiesOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.FileServiceProperties
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.parameters8,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.fileServicesName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getServicePropertiesOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.FileServiceProperties
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.fileServicesName
],
headerParameters: [Parameters.accept],
serializer
};
+513
View File
@@ -0,0 +1,513 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { FileShares } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
FileShareItem,
FileSharesListNextOptionalParams,
FileSharesListOptionalParams,
FileSharesListResponse,
FileShare,
FileSharesCreateOptionalParams,
FileSharesCreateResponse,
FileSharesUpdateOptionalParams,
FileSharesUpdateResponse,
FileSharesGetOptionalParams,
FileSharesGetResponse,
FileSharesDeleteOptionalParams,
DeletedShare,
FileSharesRestoreOptionalParams,
FileSharesLeaseOptionalParams,
FileSharesLeaseResponse,
FileSharesListNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing FileShares operations. */
export class FileSharesImpl implements FileShares {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class FileShares class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Lists all shares.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
public list(
resourceGroupName: string,
accountName: string,
options?: FileSharesListOptionalParams
): PagedAsyncIterableIterator<FileShareItem> {
const iter = this.listPagingAll(resourceGroupName, accountName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(resourceGroupName, accountName, options);
}
};
}
private async *listPagingPage(
resourceGroupName: string,
accountName: string,
options?: FileSharesListOptionalParams
): AsyncIterableIterator<FileShareItem[]> {
let result = await this._list(resourceGroupName, accountName, options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listNext(
resourceGroupName,
accountName,
continuationToken,
options
);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listPagingAll(
resourceGroupName: string,
accountName: string,
options?: FileSharesListOptionalParams
): AsyncIterableIterator<FileShareItem> {
for await (const page of this.listPagingPage(
resourceGroupName,
accountName,
options
)) {
yield* page;
}
}
/**
* Lists all shares.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
private _list(
resourceGroupName: string,
accountName: string,
options?: FileSharesListOptionalParams
): Promise<FileSharesListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* Creates a new share under the specified account as described by request body. The share resource
* includes metadata and properties for that share. It does not include a list of the files contained
* by the share.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param fileShare Properties of the file share to create.
* @param options The options parameters.
*/
create(
resourceGroupName: string,
accountName: string,
shareName: string,
fileShare: FileShare,
options?: FileSharesCreateOptionalParams
): Promise<FileSharesCreateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, shareName, fileShare, options },
createOperationSpec
);
}
/**
* Updates share properties as specified in request body. Properties not mentioned in the request will
* not be changed. Update fails if the specified share does not already exist.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param fileShare Properties to update for the file share.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
accountName: string,
shareName: string,
fileShare: FileShare,
options?: FileSharesUpdateOptionalParams
): Promise<FileSharesUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, shareName, fileShare, options },
updateOperationSpec
);
}
/**
* Gets properties of a specified share.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
shareName: string,
options?: FileSharesGetOptionalParams
): Promise<FileSharesGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, shareName, options },
getOperationSpec
);
}
/**
* Deletes specified share under its account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
shareName: string,
options?: FileSharesDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, shareName, options },
deleteOperationSpec
);
}
/**
* Restore a file share within a valid retention days if share soft delete is enabled
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param deletedShare The deleted share to be restored.
* @param options The options parameters.
*/
restore(
resourceGroupName: string,
accountName: string,
shareName: string,
deletedShare: DeletedShare,
options?: FileSharesRestoreOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, shareName, deletedShare, options },
restoreOperationSpec
);
}
/**
* The Lease Share operation establishes and manages a lock on a share for delete operations. The lock
* duration can be 15 to 60 seconds, or can be infinite.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param options The options parameters.
*/
lease(
resourceGroupName: string,
accountName: string,
shareName: string,
options?: FileSharesLeaseOptionalParams
): Promise<FileSharesLeaseResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, shareName, options },
leaseOperationSpec
);
}
/**
* ListNext
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param nextLink The nextLink from the previous successful call to the List method.
* @param options The options parameters.
*/
private _listNext(
resourceGroupName: string,
accountName: string,
nextLink: string,
options?: FileSharesListNextOptionalParams
): Promise<FileSharesListNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, nextLink, options },
listNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.FileShareItems
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [
Parameters.apiVersion,
Parameters.maxpagesize,
Parameters.filter,
Parameters.expand2
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const createOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.FileShare
},
201: {
bodyMapper: Mappers.FileShare
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.fileShare,
queryParameters: [Parameters.apiVersion, Parameters.expand2],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.shareName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const updateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}",
httpMethod: "PATCH",
responses: {
200: {
bodyMapper: Mappers.FileShare
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.fileShare,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.shareName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.FileShare
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion, Parameters.expand2],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.shareName
],
headerParameters: [Parameters.accept, Parameters.xMsSnapshot],
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion, Parameters.include1],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.shareName
],
headerParameters: [Parameters.accept, Parameters.xMsSnapshot],
serializer
};
const restoreOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore",
httpMethod: "POST",
responses: {
200: {},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.deletedShare,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.shareName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const leaseOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.LeaseShareResponse,
headersMapper: Mappers.FileSharesLeaseHeaders
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.parameters9,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.shareName
],
headerParameters: [
Parameters.accept,
Parameters.contentType,
Parameters.xMsSnapshot
],
mediaType: "json",
serializer
};
const listNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.FileShareItems
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [
Parameters.apiVersion,
Parameters.maxpagesize,
Parameters.filter,
Parameters.expand2
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./operations";
export * from "./skus";
export * from "./storageAccounts";
export * from "./deletedAccounts";
export * from "./usages";
export * from "./managementPolicies";
export * from "./blobInventoryPolicies";
export * from "./privateEndpointConnections";
export * from "./privateLinkResources";
export * from "./objectReplicationPoliciesOperations";
export * from "./localUsersOperations";
export * from "./encryptionScopes";
export * from "./blobServices";
export * from "./blobContainers";
export * from "./fileServices";
export * from "./fileShares";
export * from "./queueServices";
export * from "./queue";
export * from "./tableServices";
export * from "./tableOperations";
+371
View File
@@ -0,0 +1,371 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { LocalUsersOperations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
LocalUser,
LocalUsersListOptionalParams,
LocalUsersListResponse,
LocalUsersGetOptionalParams,
LocalUsersGetResponse,
LocalUsersCreateOrUpdateOptionalParams,
LocalUsersCreateOrUpdateResponse,
LocalUsersDeleteOptionalParams,
LocalUsersListKeysOptionalParams,
LocalUsersListKeysResponse,
LocalUsersRegeneratePasswordOptionalParams,
LocalUsersRegeneratePasswordResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing LocalUsersOperations operations. */
export class LocalUsersOperationsImpl implements LocalUsersOperations {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class LocalUsersOperations class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* List the local users associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
public list(
resourceGroupName: string,
accountName: string,
options?: LocalUsersListOptionalParams
): PagedAsyncIterableIterator<LocalUser> {
const iter = this.listPagingAll(resourceGroupName, accountName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(resourceGroupName, accountName, options);
}
};
}
private async *listPagingPage(
resourceGroupName: string,
accountName: string,
options?: LocalUsersListOptionalParams
): AsyncIterableIterator<LocalUser[]> {
let result = await this._list(resourceGroupName, accountName, options);
yield result.value || [];
}
private async *listPagingAll(
resourceGroupName: string,
accountName: string,
options?: LocalUsersListOptionalParams
): AsyncIterableIterator<LocalUser> {
for await (const page of this.listPagingPage(
resourceGroupName,
accountName,
options
)) {
yield* page;
}
}
/**
* List the local users associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
private _list(
resourceGroupName: string,
accountName: string,
options?: LocalUsersListOptionalParams
): Promise<LocalUsersListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* Get the local user of the storage account by username.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param username The name of local user. The username must contain lowercase letters and numbers
* only. It must be unique only within the storage account.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
username: string,
options?: LocalUsersGetOptionalParams
): Promise<LocalUsersGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, username, options },
getOperationSpec
);
}
/**
* Create or update the properties of a local user associated with the storage account
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param username The name of local user. The username must contain lowercase letters and numbers
* only. It must be unique only within the storage account.
* @param properties The local user associated with a storage account.
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
accountName: string,
username: string,
properties: LocalUser,
options?: LocalUsersCreateOrUpdateOptionalParams
): Promise<LocalUsersCreateOrUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, username, properties, options },
createOrUpdateOperationSpec
);
}
/**
* Deletes the local user associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param username The name of local user. The username must contain lowercase letters and numbers
* only. It must be unique only within the storage account.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
username: string,
options?: LocalUsersDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, username, options },
deleteOperationSpec
);
}
/**
* List SSH authorized keys and shared key of the local user.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param username The name of local user. The username must contain lowercase letters and numbers
* only. It must be unique only within the storage account.
* @param options The options parameters.
*/
listKeys(
resourceGroupName: string,
accountName: string,
username: string,
options?: LocalUsersListKeysOptionalParams
): Promise<LocalUsersListKeysResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, username, options },
listKeysOperationSpec
);
}
/**
* Regenerate the local user SSH password.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param username The name of local user. The username must contain lowercase letters and numbers
* only. It must be unique only within the storage account.
* @param options The options parameters.
*/
regeneratePassword(
resourceGroupName: string,
accountName: string,
username: string,
options?: LocalUsersRegeneratePasswordOptionalParams
): Promise<LocalUsersRegeneratePasswordResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, username, options },
regeneratePasswordOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LocalUsers
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.LocalUser
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.username
],
headerParameters: [Parameters.accept],
serializer
};
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.LocalUser
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.properties4,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.username
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.username
],
headerParameters: [Parameters.accept],
serializer
};
const listKeysOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.LocalUserKeys
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.username
],
headerParameters: [Parameters.accept],
serializer
};
const regeneratePasswordOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.LocalUserRegeneratePasswordResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.username
],
headerParameters: [Parameters.accept],
serializer
};
+172
View File
@@ -0,0 +1,172 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { ManagementPolicies } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
ManagementPolicyName,
ManagementPoliciesGetOptionalParams,
ManagementPoliciesGetResponse,
ManagementPolicy,
ManagementPoliciesCreateOrUpdateOptionalParams,
ManagementPoliciesCreateOrUpdateResponse,
ManagementPoliciesDeleteOptionalParams
} from "../models";
/** Class containing ManagementPolicies operations. */
export class ManagementPoliciesImpl implements ManagementPolicies {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class ManagementPolicies class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Gets the managementpolicy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param managementPolicyName The name of the Storage Account Management Policy. It should always be
* 'default'
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
managementPolicyName: ManagementPolicyName,
options?: ManagementPoliciesGetOptionalParams
): Promise<ManagementPoliciesGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, managementPolicyName, options },
getOperationSpec
);
}
/**
* Sets the managementpolicy to the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param managementPolicyName The name of the Storage Account Management Policy. It should always be
* 'default'
* @param properties The ManagementPolicy set to a storage account.
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
accountName: string,
managementPolicyName: ManagementPolicyName,
properties: ManagementPolicy,
options?: ManagementPoliciesCreateOrUpdateOptionalParams
): Promise<ManagementPoliciesCreateOrUpdateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
accountName,
managementPolicyName,
properties,
options
},
createOrUpdateOperationSpec
);
}
/**
* Deletes the managementpolicy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param managementPolicyName The name of the Storage Account Management Policy. It should always be
* 'default'
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
managementPolicyName: ManagementPolicyName,
options?: ManagementPoliciesDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, managementPolicyName, options },
deleteOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ManagementPolicy
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.managementPolicyName
],
headerParameters: [Parameters.accept],
serializer
};
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.ManagementPolicy
}
},
requestBody: Parameters.properties,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.managementPolicyName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}",
httpMethod: "DELETE",
responses: { 200: {}, 204: {} },
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.managementPolicyName
],
serializer
};
@@ -0,0 +1,289 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { ObjectReplicationPoliciesOperations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
ObjectReplicationPolicy,
ObjectReplicationPoliciesListOptionalParams,
ObjectReplicationPoliciesListResponse,
ObjectReplicationPoliciesGetOptionalParams,
ObjectReplicationPoliciesGetResponse,
ObjectReplicationPoliciesCreateOrUpdateOptionalParams,
ObjectReplicationPoliciesCreateOrUpdateResponse,
ObjectReplicationPoliciesDeleteOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing ObjectReplicationPoliciesOperations operations. */
export class ObjectReplicationPoliciesOperationsImpl
implements ObjectReplicationPoliciesOperations {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class ObjectReplicationPoliciesOperations class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* List the object replication policies associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
public list(
resourceGroupName: string,
accountName: string,
options?: ObjectReplicationPoliciesListOptionalParams
): PagedAsyncIterableIterator<ObjectReplicationPolicy> {
const iter = this.listPagingAll(resourceGroupName, accountName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(resourceGroupName, accountName, options);
}
};
}
private async *listPagingPage(
resourceGroupName: string,
accountName: string,
options?: ObjectReplicationPoliciesListOptionalParams
): AsyncIterableIterator<ObjectReplicationPolicy[]> {
let result = await this._list(resourceGroupName, accountName, options);
yield result.value || [];
}
private async *listPagingAll(
resourceGroupName: string,
accountName: string,
options?: ObjectReplicationPoliciesListOptionalParams
): AsyncIterableIterator<ObjectReplicationPolicy> {
for await (const page of this.listPagingPage(
resourceGroupName,
accountName,
options
)) {
yield* page;
}
}
/**
* List the object replication policies associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
private _list(
resourceGroupName: string,
accountName: string,
options?: ObjectReplicationPoliciesListOptionalParams
): Promise<ObjectReplicationPoliciesListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* Get the object replication policy of the storage account by policy ID.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure
* the policy on the destination account first. For the source account, provide the value of the policy
* ID that is returned when you download the policy that was defined on the destination account. The
* policy is downloaded as a JSON file.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
objectReplicationPolicyId: string,
options?: ObjectReplicationPoliciesGetOptionalParams
): Promise<ObjectReplicationPoliciesGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, objectReplicationPolicyId, options },
getOperationSpec
);
}
/**
* Create or update the object replication policy of the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure
* the policy on the destination account first. For the source account, provide the value of the policy
* ID that is returned when you download the policy that was defined on the destination account. The
* policy is downloaded as a JSON file.
* @param properties The object replication policy set to a storage account. A unique policy ID will be
* created if absent.
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
accountName: string,
objectReplicationPolicyId: string,
properties: ObjectReplicationPolicy,
options?: ObjectReplicationPoliciesCreateOrUpdateOptionalParams
): Promise<ObjectReplicationPoliciesCreateOrUpdateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
accountName,
objectReplicationPolicyId,
properties,
options
},
createOrUpdateOperationSpec
);
}
/**
* Deletes the object replication policy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure
* the policy on the destination account first. For the source account, provide the value of the policy
* ID that is returned when you download the policy that was defined on the destination account. The
* policy is downloaded as a JSON file.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
objectReplicationPolicyId: string,
options?: ObjectReplicationPoliciesDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, objectReplicationPolicyId, options },
deleteOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ObjectReplicationPolicies
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ObjectReplicationPolicy
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.objectReplicationPolicyId
],
headerParameters: [Parameters.accept],
serializer
};
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.ObjectReplicationPolicy
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.properties3,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.objectReplicationPolicyId
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.objectReplicationPolicyId
],
headerParameters: [Parameters.accept],
serializer
};
+95
View File
@@ -0,0 +1,95 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { Operations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
Operation,
OperationsListOptionalParams,
OperationsListResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing Operations operations. */
export class OperationsImpl implements Operations {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class Operations class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Lists all of the available Storage Rest API operations.
* @param options The options parameters.
*/
public list(
options?: OperationsListOptionalParams
): PagedAsyncIterableIterator<Operation> {
const iter = this.listPagingAll(options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(options);
}
};
}
private async *listPagingPage(
options?: OperationsListOptionalParams
): AsyncIterableIterator<Operation[]> {
let result = await this._list(options);
yield result.value || [];
}
private async *listPagingAll(
options?: OperationsListOptionalParams
): AsyncIterableIterator<Operation> {
for await (const page of this.listPagingPage(options)) {
yield* page;
}
}
/**
* Lists all of the available Storage Rest API operations.
* @param options The options parameters.
*/
private _list(
options?: OperationsListOptionalParams
): Promise<OperationsListResponse> {
return this.client.sendOperationRequest({ options }, listOperationSpec);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Storage/operations",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.OperationListResult
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
@@ -0,0 +1,289 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { PrivateEndpointConnections } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
PrivateEndpointConnection,
PrivateEndpointConnectionsListOptionalParams,
PrivateEndpointConnectionsListResponse,
PrivateEndpointConnectionsGetOptionalParams,
PrivateEndpointConnectionsGetResponse,
PrivateEndpointConnectionsPutOptionalParams,
PrivateEndpointConnectionsPutResponse,
PrivateEndpointConnectionsDeleteOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing PrivateEndpointConnections operations. */
export class PrivateEndpointConnectionsImpl
implements PrivateEndpointConnections {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class PrivateEndpointConnections class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* List all the private endpoint connections associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
public list(
resourceGroupName: string,
accountName: string,
options?: PrivateEndpointConnectionsListOptionalParams
): PagedAsyncIterableIterator<PrivateEndpointConnection> {
const iter = this.listPagingAll(resourceGroupName, accountName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(resourceGroupName, accountName, options);
}
};
}
private async *listPagingPage(
resourceGroupName: string,
accountName: string,
options?: PrivateEndpointConnectionsListOptionalParams
): AsyncIterableIterator<PrivateEndpointConnection[]> {
let result = await this._list(resourceGroupName, accountName, options);
yield result.value || [];
}
private async *listPagingAll(
resourceGroupName: string,
accountName: string,
options?: PrivateEndpointConnectionsListOptionalParams
): AsyncIterableIterator<PrivateEndpointConnection> {
for await (const page of this.listPagingPage(
resourceGroupName,
accountName,
options
)) {
yield* page;
}
}
/**
* List all the private endpoint connections associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
private _list(
resourceGroupName: string,
accountName: string,
options?: PrivateEndpointConnectionsListOptionalParams
): Promise<PrivateEndpointConnectionsListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* Gets the specified private endpoint connection associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the
* Azure resource
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsGetOptionalParams
): Promise<PrivateEndpointConnectionsGetResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
accountName,
privateEndpointConnectionName,
options
},
getOperationSpec
);
}
/**
* Update the state of specified private endpoint connection associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the
* Azure resource
* @param properties The private endpoint connection properties.
* @param options The options parameters.
*/
put(
resourceGroupName: string,
accountName: string,
privateEndpointConnectionName: string,
properties: PrivateEndpointConnection,
options?: PrivateEndpointConnectionsPutOptionalParams
): Promise<PrivateEndpointConnectionsPutResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
accountName,
privateEndpointConnectionName,
properties,
options
},
putOperationSpec
);
}
/**
* Deletes the specified private endpoint connection associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the
* Azure resource
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{
resourceGroupName,
accountName,
privateEndpointConnectionName,
options
},
deleteOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnectionListResult
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnection
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.privateEndpointConnectionName
],
headerParameters: [Parameters.accept],
serializer
};
const putOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnection
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.properties2,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.privateEndpointConnectionName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
httpMethod: "DELETE",
responses: {
200: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.privateEndpointConnectionName
],
headerParameters: [Parameters.accept],
serializer
};
+72
View File
@@ -0,0 +1,72 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PrivateLinkResources } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
PrivateLinkResourcesListByStorageAccountOptionalParams,
PrivateLinkResourcesListByStorageAccountResponse
} from "../models";
/** Class containing PrivateLinkResources operations. */
export class PrivateLinkResourcesImpl implements PrivateLinkResources {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class PrivateLinkResources class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Gets the private link resources that need to be created for a storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
listByStorageAccount(
resourceGroupName: string,
accountName: string,
options?: PrivateLinkResourcesListByStorageAccountOptionalParams
): Promise<PrivateLinkResourcesListByStorageAccountResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listByStorageAccountOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listByStorageAccountOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PrivateLinkResourceListResult
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
+396
View File
@@ -0,0 +1,396 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { Queue } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
ListQueue,
QueueListNextOptionalParams,
QueueListOptionalParams,
StorageQueue,
QueueCreateOptionalParams,
QueueCreateResponse,
QueueUpdateOptionalParams,
QueueUpdateResponse,
QueueGetOptionalParams,
QueueGetResponse,
QueueDeleteOptionalParams,
QueueListResponse,
QueueListNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing Queue operations. */
export class QueueImpl implements Queue {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class Queue class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Gets a list of all the queues under the specified storage account
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
public list(
resourceGroupName: string,
accountName: string,
options?: QueueListOptionalParams
): PagedAsyncIterableIterator<ListQueue> {
const iter = this.listPagingAll(resourceGroupName, accountName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(resourceGroupName, accountName, options);
}
};
}
private async *listPagingPage(
resourceGroupName: string,
accountName: string,
options?: QueueListOptionalParams
): AsyncIterableIterator<ListQueue[]> {
let result = await this._list(resourceGroupName, accountName, options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listNext(
resourceGroupName,
accountName,
continuationToken,
options
);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listPagingAll(
resourceGroupName: string,
accountName: string,
options?: QueueListOptionalParams
): AsyncIterableIterator<ListQueue> {
for await (const page of this.listPagingPage(
resourceGroupName,
accountName,
options
)) {
yield* page;
}
}
/**
* Creates a new queue with the specified queue name, under the specified account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param queueName A queue name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should
* begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.
* @param queue Queue properties and metadata to be created with
* @param options The options parameters.
*/
create(
resourceGroupName: string,
accountName: string,
queueName: string,
queue: StorageQueue,
options?: QueueCreateOptionalParams
): Promise<QueueCreateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, queueName, queue, options },
createOperationSpec
);
}
/**
* Creates a new queue with the specified queue name, under the specified account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param queueName A queue name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should
* begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.
* @param queue Queue properties and metadata to be created with
* @param options The options parameters.
*/
update(
resourceGroupName: string,
accountName: string,
queueName: string,
queue: StorageQueue,
options?: QueueUpdateOptionalParams
): Promise<QueueUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, queueName, queue, options },
updateOperationSpec
);
}
/**
* Gets the queue with the specified queue name, under the specified account if it exists.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param queueName A queue name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should
* begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
queueName: string,
options?: QueueGetOptionalParams
): Promise<QueueGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, queueName, options },
getOperationSpec
);
}
/**
* Deletes the queue with the specified queue name, under the specified account if it exists.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param queueName A queue name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should
* begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
queueName: string,
options?: QueueDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, queueName, options },
deleteOperationSpec
);
}
/**
* Gets a list of all the queues under the specified storage account
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
private _list(
resourceGroupName: string,
accountName: string,
options?: QueueListOptionalParams
): Promise<QueueListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* ListNext
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param nextLink The nextLink from the previous successful call to the List method.
* @param options The options parameters.
*/
private _listNext(
resourceGroupName: string,
accountName: string,
nextLink: string,
options?: QueueListNextOptionalParams
): Promise<QueueListNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, nextLink, options },
listNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const createOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.StorageQueue
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.queue,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.queueName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const updateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}",
httpMethod: "PATCH",
responses: {
200: {
bodyMapper: Mappers.StorageQueue
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.queue,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.queueName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.StorageQueue
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.queueName
],
headerParameters: [Parameters.accept],
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}",
httpMethod: "DELETE",
responses: {
204: {},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.queueName
],
headerParameters: [Parameters.accept],
serializer
};
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListQueueResource
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [
Parameters.apiVersion,
Parameters.maxpagesize,
Parameters.filter
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const listNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListQueueResource
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [
Parameters.apiVersion,
Parameters.maxpagesize,
Parameters.filter
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
+173
View File
@@ -0,0 +1,173 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { QueueServices } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
QueueServicesListOptionalParams,
QueueServicesListResponse,
QueueServiceProperties,
QueueServicesSetServicePropertiesOptionalParams,
QueueServicesSetServicePropertiesResponse,
QueueServicesGetServicePropertiesOptionalParams,
QueueServicesGetServicePropertiesResponse
} from "../models";
/** Class containing QueueServices operations. */
export class QueueServicesImpl implements QueueServices {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class QueueServices class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* List all queue services for the storage account
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: QueueServicesListOptionalParams
): Promise<QueueServicesListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* Sets the properties of a storage accounts Queue service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The properties of a storage accounts Queue service, only properties for Storage
* Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified.
* @param options The options parameters.
*/
setServiceProperties(
resourceGroupName: string,
accountName: string,
parameters: QueueServiceProperties,
options?: QueueServicesSetServicePropertiesOptionalParams
): Promise<QueueServicesSetServicePropertiesResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, parameters, options },
setServicePropertiesOperationSpec
);
}
/**
* Gets the properties of a storage accounts Queue service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
getServiceProperties(
resourceGroupName: string,
accountName: string,
options?: QueueServicesGetServicePropertiesOptionalParams
): Promise<QueueServicesGetServicePropertiesResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
getServicePropertiesOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListQueueServices
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const setServicePropertiesOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.QueueServiceProperties
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.parameters10,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.queueServiceName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getServicePropertiesOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.QueueServiceProperties
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.queueServiceName
],
headerParameters: [Parameters.accept],
serializer
};
+93
View File
@@ -0,0 +1,93 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { Skus } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
SkuInformation,
SkusListOptionalParams,
SkusListResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing Skus operations. */
export class SkusImpl implements Skus {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class Skus class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Lists the available SKUs supported by Microsoft.Storage for given subscription.
* @param options The options parameters.
*/
public list(
options?: SkusListOptionalParams
): PagedAsyncIterableIterator<SkuInformation> {
const iter = this.listPagingAll(options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(options);
}
};
}
private async *listPagingPage(
options?: SkusListOptionalParams
): AsyncIterableIterator<SkuInformation[]> {
let result = await this._list(options);
yield result.value || [];
}
private async *listPagingAll(
options?: SkusListOptionalParams
): AsyncIterableIterator<SkuInformation> {
for await (const page of this.listPagingPage(options)) {
yield* page;
}
}
/**
* Lists the available SKUs supported by Microsoft.Storage for given subscription.
* @param options The options parameters.
*/
private _list(options?: SkusListOptionalParams): Promise<SkusListResponse> {
return this.client.sendOperationRequest({ options }, listOperationSpec);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path: "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.StorageSkuListResult
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.subscriptionId],
headerParameters: [Parameters.accept],
serializer
};
File diff suppressed because it is too large Load Diff
+383
View File
@@ -0,0 +1,383 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { TableOperations } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
Table,
TableListNextOptionalParams,
TableListOptionalParams,
TableCreateOptionalParams,
TableCreateResponse,
TableUpdateOptionalParams,
TableUpdateResponse,
TableGetOptionalParams,
TableGetResponse,
TableDeleteOptionalParams,
TableListResponse,
TableListNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing TableOperations operations. */
export class TableOperationsImpl implements TableOperations {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class TableOperations class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Gets a list of all the tables under the specified storage account
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
public list(
resourceGroupName: string,
accountName: string,
options?: TableListOptionalParams
): PagedAsyncIterableIterator<Table> {
const iter = this.listPagingAll(resourceGroupName, accountName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listPagingPage(resourceGroupName, accountName, options);
}
};
}
private async *listPagingPage(
resourceGroupName: string,
accountName: string,
options?: TableListOptionalParams
): AsyncIterableIterator<Table[]> {
let result = await this._list(resourceGroupName, accountName, options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listNext(
resourceGroupName,
accountName,
continuationToken,
options
);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listPagingAll(
resourceGroupName: string,
accountName: string,
options?: TableListOptionalParams
): AsyncIterableIterator<Table> {
for await (const page of this.listPagingPage(
resourceGroupName,
accountName,
options
)) {
yield* page;
}
}
/**
* Creates a new table with the specified table name, under the specified account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param tableName A table name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric
* character.
* @param options The options parameters.
*/
create(
resourceGroupName: string,
accountName: string,
tableName: string,
options?: TableCreateOptionalParams
): Promise<TableCreateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, tableName, options },
createOperationSpec
);
}
/**
* Creates a new table with the specified table name, under the specified account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param tableName A table name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric
* character.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
accountName: string,
tableName: string,
options?: TableUpdateOptionalParams
): Promise<TableUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, tableName, options },
updateOperationSpec
);
}
/**
* Gets the table with the specified table name, under the specified account if it exists.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param tableName A table name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric
* character.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
tableName: string,
options?: TableGetOptionalParams
): Promise<TableGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, tableName, options },
getOperationSpec
);
}
/**
* Deletes the table with the specified table name, under the specified account if it exists.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param tableName A table name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric
* character.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
tableName: string,
options?: TableDeleteOptionalParams
): Promise<void> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, tableName, options },
deleteOperationSpec
);
}
/**
* Gets a list of all the tables under the specified storage account
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
private _list(
resourceGroupName: string,
accountName: string,
options?: TableListOptionalParams
): Promise<TableListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* ListNext
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param nextLink The nextLink from the previous successful call to the List method.
* @param options The options parameters.
*/
private _listNext(
resourceGroupName: string,
accountName: string,
nextLink: string,
options?: TableListNextOptionalParams
): Promise<TableListNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, nextLink, options },
listNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const createOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.Table
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.parameters12,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.tableName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const updateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}",
httpMethod: "PATCH",
responses: {
200: {
bodyMapper: Mappers.Table
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.parameters12,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.tableName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Table
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.tableName
],
headerParameters: [Parameters.accept],
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}",
httpMethod: "DELETE",
responses: {
204: {},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.tableName
],
headerParameters: [Parameters.accept],
serializer
};
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListTableResource
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const listNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListTableResource
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
+173
View File
@@ -0,0 +1,173 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { TableServices } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
TableServicesListOptionalParams,
TableServicesListResponse,
TableServiceProperties,
TableServicesSetServicePropertiesOptionalParams,
TableServicesSetServicePropertiesResponse,
TableServicesGetServicePropertiesOptionalParams,
TableServicesGetServicePropertiesResponse
} from "../models";
/** Class containing TableServices operations. */
export class TableServicesImpl implements TableServices {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class TableServices class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* List all table services for the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: TableServicesListOptionalParams
): Promise<TableServicesListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
}
/**
* Sets the properties of a storage accounts Table service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The properties of a storage accounts Table service, only properties for Storage
* Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified.
* @param options The options parameters.
*/
setServiceProperties(
resourceGroupName: string,
accountName: string,
parameters: TableServiceProperties,
options?: TableServicesSetServicePropertiesOptionalParams
): Promise<TableServicesSetServicePropertiesResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, parameters, options },
setServicePropertiesOperationSpec
);
}
/**
* Gets the properties of a storage accounts Table service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
getServiceProperties(
resourceGroupName: string,
accountName: string,
options?: TableServicesGetServicePropertiesOptionalParams
): Promise<TableServicesGetServicePropertiesResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
getServicePropertiesOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ListTableServices
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1
],
headerParameters: [Parameters.accept],
serializer
};
const setServicePropertiesOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.TableServiceProperties
},
default: {
bodyMapper: Mappers.CloudError
}
},
requestBody: Parameters.parameters11,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.tableServiceName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getServicePropertiesOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.TableServiceProperties
},
default: {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.accountName1,
Parameters.tableServiceName
],
headerParameters: [Parameters.accept],
serializer
};
+109
View File
@@ -0,0 +1,109 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { Usages } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { StorageManagementClient } from "../storageManagementClient";
import {
Usage,
UsagesListByLocationOptionalParams,
UsagesListByLocationResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing Usages operations. */
export class UsagesImpl implements Usages {
private readonly client: StorageManagementClient;
/**
* Initialize a new instance of the class Usages class.
* @param client Reference to the service client
*/
constructor(client: StorageManagementClient) {
this.client = client;
}
/**
* Gets the current usage count and the limit for the resources of the location under the subscription.
* @param location The location of the Azure Storage resource.
* @param options The options parameters.
*/
public listByLocation(
location: string,
options?: UsagesListByLocationOptionalParams
): PagedAsyncIterableIterator<Usage> {
const iter = this.listByLocationPagingAll(location, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listByLocationPagingPage(location, options);
}
};
}
private async *listByLocationPagingPage(
location: string,
options?: UsagesListByLocationOptionalParams
): AsyncIterableIterator<Usage[]> {
let result = await this._listByLocation(location, options);
yield result.value || [];
}
private async *listByLocationPagingAll(
location: string,
options?: UsagesListByLocationOptionalParams
): AsyncIterableIterator<Usage> {
for await (const page of this.listByLocationPagingPage(location, options)) {
yield* page;
}
}
/**
* Gets the current usage count and the limit for the resources of the location under the subscription.
* @param location The location of the Azure Storage resource.
* @param options The options parameters.
*/
private _listByLocation(
location: string,
options?: UsagesListByLocationOptionalParams
): Promise<UsagesListByLocationResponse> {
return this.client.sendOperationRequest(
{ location, options },
listByLocationOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listByLocationOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.UsageListResult
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.location
],
headerParameters: [Parameters.accept],
serializer
};
@@ -0,0 +1,365 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { PollerLike, PollOperationState } from "@azure/core-lro";
import {
ListContainerItem,
BlobContainersListOptionalParams,
BlobContainer,
BlobContainersCreateOptionalParams,
BlobContainersCreateResponse,
BlobContainersUpdateOptionalParams,
BlobContainersUpdateResponse,
BlobContainersGetOptionalParams,
BlobContainersGetResponse,
BlobContainersDeleteOptionalParams,
LegalHold,
BlobContainersSetLegalHoldOptionalParams,
BlobContainersSetLegalHoldResponse,
BlobContainersClearLegalHoldOptionalParams,
BlobContainersClearLegalHoldResponse,
BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams,
BlobContainersCreateOrUpdateImmutabilityPolicyResponse,
BlobContainersGetImmutabilityPolicyOptionalParams,
BlobContainersGetImmutabilityPolicyResponse,
BlobContainersDeleteImmutabilityPolicyOptionalParams,
BlobContainersDeleteImmutabilityPolicyResponse,
BlobContainersLockImmutabilityPolicyOptionalParams,
BlobContainersLockImmutabilityPolicyResponse,
BlobContainersExtendImmutabilityPolicyOptionalParams,
BlobContainersExtendImmutabilityPolicyResponse,
BlobContainersLeaseOptionalParams,
BlobContainersLeaseResponse,
BlobContainersObjectLevelWormOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a BlobContainers. */
export interface BlobContainers {
/**
* Lists all containers and does not support a prefix like data plane. Also SRP today does not return
* continuation token.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: BlobContainersListOptionalParams
): PagedAsyncIterableIterator<ListContainerItem>;
/**
* Creates a new container under the specified account as described by request body. The container
* resource includes metadata and properties for that container. It does not include a list of the
* blobs contained by the container.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param blobContainer Properties of the blob container to create.
* @param options The options parameters.
*/
create(
resourceGroupName: string,
accountName: string,
containerName: string,
blobContainer: BlobContainer,
options?: BlobContainersCreateOptionalParams
): Promise<BlobContainersCreateResponse>;
/**
* Updates container properties as specified in request body. Properties not mentioned in the request
* will be unchanged. Update fails if the specified container doesn't already exist.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param blobContainer Properties to update for the blob container.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
accountName: string,
containerName: string,
blobContainer: BlobContainer,
options?: BlobContainersUpdateOptionalParams
): Promise<BlobContainersUpdateResponse>;
/**
* Gets properties of a specified container.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersGetOptionalParams
): Promise<BlobContainersGetResponse>;
/**
* Deletes specified container under its account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersDeleteOptionalParams
): Promise<void>;
/**
* Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows
* an append pattern and does not clear out the existing tags that are not specified in the request.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param legalHold The LegalHold property that will be set to a blob container.
* @param options The options parameters.
*/
setLegalHold(
resourceGroupName: string,
accountName: string,
containerName: string,
legalHold: LegalHold,
options?: BlobContainersSetLegalHoldOptionalParams
): Promise<BlobContainersSetLegalHoldResponse>;
/**
* Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation.
* ClearLegalHold clears out only the specified tags in the request.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param legalHold The LegalHold property that will be clear from a blob container.
* @param options The options parameters.
*/
clearLegalHold(
resourceGroupName: string,
accountName: string,
containerName: string,
legalHold: LegalHold,
options?: BlobContainersClearLegalHoldOptionalParams
): Promise<BlobContainersClearLegalHoldResponse>;
/**
* Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not
* required for this operation.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
createOrUpdateImmutabilityPolicy(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams
): Promise<BlobContainersCreateOrUpdateImmutabilityPolicyResponse>;
/**
* Gets the existing immutability policy along with the corresponding ETag in response headers and
* body.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
getImmutabilityPolicy(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersGetImmutabilityPolicyOptionalParams
): Promise<BlobContainersGetImmutabilityPolicyResponse>;
/**
* Aborts an unlocked immutability policy. The response of delete has
* immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation.
* Deleting a locked immutability policy is not allowed, the only way is to delete the container after
* deleting all expired blobs inside the policy locked container.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*"
* can be used to apply the operation only if the immutability policy already exists. If omitted, this
* operation will always be applied.
* @param options The options parameters.
*/
deleteImmutabilityPolicy(
resourceGroupName: string,
accountName: string,
containerName: string,
ifMatch: string,
options?: BlobContainersDeleteImmutabilityPolicyOptionalParams
): Promise<BlobContainersDeleteImmutabilityPolicyResponse>;
/**
* Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is
* ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*"
* can be used to apply the operation only if the immutability policy already exists. If omitted, this
* operation will always be applied.
* @param options The options parameters.
*/
lockImmutabilityPolicy(
resourceGroupName: string,
accountName: string,
containerName: string,
ifMatch: string,
options?: BlobContainersLockImmutabilityPolicyOptionalParams
): Promise<BlobContainersLockImmutabilityPolicyResponse>;
/**
* Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action
* allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*"
* can be used to apply the operation only if the immutability policy already exists. If omitted, this
* operation will always be applied.
* @param options The options parameters.
*/
extendImmutabilityPolicy(
resourceGroupName: string,
accountName: string,
containerName: string,
ifMatch: string,
options?: BlobContainersExtendImmutabilityPolicyOptionalParams
): Promise<BlobContainersExtendImmutabilityPolicyResponse>;
/**
* The Lease Container operation establishes and manages a lock on a container for delete operations.
* The lock duration can be 15 to 60 seconds, or can be infinite.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
lease(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersLeaseOptionalParams
): Promise<BlobContainersLeaseResponse>;
/**
* This operation migrates a blob container from container level WORM to object level immutability
* enabled container. Prerequisites require a container level immutability policy either in locked or
* unlocked state, Account level versioning must be enabled and there should be no Legal hold on the
* container.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
beginObjectLevelWorm(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersObjectLevelWormOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>>;
/**
* This operation migrates a blob container from container level WORM to object level immutability
* enabled container. Prerequisites require a container level immutability policy either in locked or
* unlocked state, Account level versioning must be enabled and there should be no Legal hold on the
* container.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param containerName The name of the blob container within the specified storage account. Blob
* container names must be between 3 and 63 characters in length and use numbers, lower-case letters
* and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or
* number.
* @param options The options parameters.
*/
beginObjectLevelWormAndWait(
resourceGroupName: string,
accountName: string,
containerName: string,
options?: BlobContainersObjectLevelWormOptionalParams
): Promise<void>;
}
@@ -0,0 +1,91 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
BlobInventoryPolicy,
BlobInventoryPoliciesListOptionalParams,
BlobInventoryPolicyName,
BlobInventoryPoliciesGetOptionalParams,
BlobInventoryPoliciesGetResponse,
BlobInventoryPoliciesCreateOrUpdateOptionalParams,
BlobInventoryPoliciesCreateOrUpdateResponse,
BlobInventoryPoliciesDeleteOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a BlobInventoryPolicies. */
export interface BlobInventoryPolicies {
/**
* Gets the blob inventory policy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: BlobInventoryPoliciesListOptionalParams
): PagedAsyncIterableIterator<BlobInventoryPolicy>;
/**
* Gets the blob inventory policy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should
* always be 'default'
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
blobInventoryPolicyName: BlobInventoryPolicyName,
options?: BlobInventoryPoliciesGetOptionalParams
): Promise<BlobInventoryPoliciesGetResponse>;
/**
* Sets the blob inventory policy to the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should
* always be 'default'
* @param properties The blob inventory policy set to a storage account.
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
accountName: string,
blobInventoryPolicyName: BlobInventoryPolicyName,
properties: BlobInventoryPolicy,
options?: BlobInventoryPoliciesCreateOrUpdateOptionalParams
): Promise<BlobInventoryPoliciesCreateOrUpdateResponse>;
/**
* Deletes the blob inventory policy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should
* always be 'default'
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
blobInventoryPolicyName: BlobInventoryPolicyName,
options?: BlobInventoryPoliciesDeleteOptionalParams
): Promise<void>;
}
@@ -0,0 +1,69 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
BlobServiceProperties,
BlobServicesListOptionalParams,
BlobServicesSetServicePropertiesOptionalParams,
BlobServicesSetServicePropertiesResponse,
BlobServicesGetServicePropertiesOptionalParams,
BlobServicesGetServicePropertiesResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a BlobServices. */
export interface BlobServices {
/**
* List blob services of storage account. It returns a collection of one object named default.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: BlobServicesListOptionalParams
): PagedAsyncIterableIterator<BlobServiceProperties>;
/**
* Sets the properties of a storage accounts Blob service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The properties of a storage accounts Blob service, including properties for
* Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
* @param options The options parameters.
*/
setServiceProperties(
resourceGroupName: string,
accountName: string,
parameters: BlobServiceProperties,
options?: BlobServicesSetServicePropertiesOptionalParams
): Promise<BlobServicesSetServicePropertiesResponse>;
/**
* Gets the properties of a storage accounts Blob service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
getServiceProperties(
resourceGroupName: string,
accountName: string,
options?: BlobServicesGetServicePropertiesOptionalParams
): Promise<BlobServicesGetServicePropertiesResponse>;
}
@@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
DeletedAccount,
DeletedAccountsListOptionalParams,
DeletedAccountsGetOptionalParams,
DeletedAccountsGetResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a DeletedAccounts. */
export interface DeletedAccounts {
/**
* Lists deleted accounts under the subscription.
* @param options The options parameters.
*/
list(
options?: DeletedAccountsListOptionalParams
): PagedAsyncIterableIterator<DeletedAccount>;
/**
* Get properties of specified deleted account resource.
* @param deletedAccountName Name of the deleted storage account.
* @param location The location of the deleted storage account.
* @param options The options parameters.
*/
get(
deletedAccountName: string,
location: string,
options?: DeletedAccountsGetOptionalParams
): Promise<DeletedAccountsGetResponse>;
}
@@ -0,0 +1,102 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
EncryptionScope,
EncryptionScopesListOptionalParams,
EncryptionScopesPutOptionalParams,
EncryptionScopesPutResponse,
EncryptionScopesPatchOptionalParams,
EncryptionScopesPatchResponse,
EncryptionScopesGetOptionalParams,
EncryptionScopesGetResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a EncryptionScopes. */
export interface EncryptionScopes {
/**
* Lists all the encryption scopes available under the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: EncryptionScopesListOptionalParams
): PagedAsyncIterableIterator<EncryptionScope>;
/**
* Synchronously creates or updates an encryption scope under the specified storage account. If an
* encryption scope is already created and a subsequent request is issued with different properties,
* the encryption scope properties will be updated per the specified request.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param encryptionScopeName The name of the encryption scope within the specified storage account.
* Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case
* letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a
* letter or number.
* @param encryptionScope Encryption scope properties to be used for the create or update.
* @param options The options parameters.
*/
put(
resourceGroupName: string,
accountName: string,
encryptionScopeName: string,
encryptionScope: EncryptionScope,
options?: EncryptionScopesPutOptionalParams
): Promise<EncryptionScopesPutResponse>;
/**
* Update encryption scope properties as specified in the request body. Update fails if the specified
* encryption scope does not already exist.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param encryptionScopeName The name of the encryption scope within the specified storage account.
* Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case
* letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a
* letter or number.
* @param encryptionScope Encryption scope properties to be used for the update.
* @param options The options parameters.
*/
patch(
resourceGroupName: string,
accountName: string,
encryptionScopeName: string,
encryptionScope: EncryptionScope,
options?: EncryptionScopesPatchOptionalParams
): Promise<EncryptionScopesPatchResponse>;
/**
* Returns the properties for the specified encryption scope.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param encryptionScopeName The name of the encryption scope within the specified storage account.
* Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case
* letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a
* letter or number.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
encryptionScopeName: string,
options?: EncryptionScopesGetOptionalParams
): Promise<EncryptionScopesGetResponse>;
}
@@ -0,0 +1,68 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
FileServicesListOptionalParams,
FileServicesListResponse,
FileServiceProperties,
FileServicesSetServicePropertiesOptionalParams,
FileServicesSetServicePropertiesResponse,
FileServicesGetServicePropertiesOptionalParams,
FileServicesGetServicePropertiesResponse
} from "../models";
/** Interface representing a FileServices. */
export interface FileServices {
/**
* List all file services in storage accounts
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: FileServicesListOptionalParams
): Promise<FileServicesListResponse>;
/**
* Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
* Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin
* Resource Sharing) rules.
* @param options The options parameters.
*/
setServiceProperties(
resourceGroupName: string,
accountName: string,
parameters: FileServiceProperties,
options?: FileServicesSetServicePropertiesOptionalParams
): Promise<FileServicesSetServicePropertiesResponse>;
/**
* Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
* Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
getServiceProperties(
resourceGroupName: string,
accountName: string,
options?: FileServicesGetServicePropertiesOptionalParams
): Promise<FileServicesGetServicePropertiesResponse>;
}
+162
View File
@@ -0,0 +1,162 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
FileShareItem,
FileSharesListOptionalParams,
FileShare,
FileSharesCreateOptionalParams,
FileSharesCreateResponse,
FileSharesUpdateOptionalParams,
FileSharesUpdateResponse,
FileSharesGetOptionalParams,
FileSharesGetResponse,
FileSharesDeleteOptionalParams,
DeletedShare,
FileSharesRestoreOptionalParams,
FileSharesLeaseOptionalParams,
FileSharesLeaseResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a FileShares. */
export interface FileShares {
/**
* Lists all shares.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: FileSharesListOptionalParams
): PagedAsyncIterableIterator<FileShareItem>;
/**
* Creates a new share under the specified account as described by request body. The share resource
* includes metadata and properties for that share. It does not include a list of the files contained
* by the share.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param fileShare Properties of the file share to create.
* @param options The options parameters.
*/
create(
resourceGroupName: string,
accountName: string,
shareName: string,
fileShare: FileShare,
options?: FileSharesCreateOptionalParams
): Promise<FileSharesCreateResponse>;
/**
* Updates share properties as specified in request body. Properties not mentioned in the request will
* not be changed. Update fails if the specified share does not already exist.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param fileShare Properties to update for the file share.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
accountName: string,
shareName: string,
fileShare: FileShare,
options?: FileSharesUpdateOptionalParams
): Promise<FileSharesUpdateResponse>;
/**
* Gets properties of a specified share.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
shareName: string,
options?: FileSharesGetOptionalParams
): Promise<FileSharesGetResponse>;
/**
* Deletes specified share under its account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
shareName: string,
options?: FileSharesDeleteOptionalParams
): Promise<void>;
/**
* Restore a file share within a valid retention days if share soft delete is enabled
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param deletedShare The deleted share to be restored.
* @param options The options parameters.
*/
restore(
resourceGroupName: string,
accountName: string,
shareName: string,
deletedShare: DeletedShare,
options?: FileSharesRestoreOptionalParams
): Promise<void>;
/**
* The Lease Share operation establishes and manages a lock on a share for delete operations. The lock
* duration can be 15 to 60 seconds, or can be infinite.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param shareName The name of the file share within the specified storage account. File share names
* must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a letter or number.
* @param options The options parameters.
*/
lease(
resourceGroupName: string,
accountName: string,
shareName: string,
options?: FileSharesLeaseOptionalParams
): Promise<FileSharesLeaseResponse>;
}
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./operations";
export * from "./skus";
export * from "./storageAccounts";
export * from "./deletedAccounts";
export * from "./usages";
export * from "./managementPolicies";
export * from "./blobInventoryPolicies";
export * from "./privateEndpointConnections";
export * from "./privateLinkResources";
export * from "./objectReplicationPoliciesOperations";
export * from "./localUsersOperations";
export * from "./encryptionScopes";
export * from "./blobServices";
export * from "./blobContainers";
export * from "./fileServices";
export * from "./fileShares";
export * from "./queueServices";
export * from "./queue";
export * from "./tableServices";
export * from "./tableOperations";
@@ -0,0 +1,128 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
LocalUser,
LocalUsersListOptionalParams,
LocalUsersGetOptionalParams,
LocalUsersGetResponse,
LocalUsersCreateOrUpdateOptionalParams,
LocalUsersCreateOrUpdateResponse,
LocalUsersDeleteOptionalParams,
LocalUsersListKeysOptionalParams,
LocalUsersListKeysResponse,
LocalUsersRegeneratePasswordOptionalParams,
LocalUsersRegeneratePasswordResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a LocalUsersOperations. */
export interface LocalUsersOperations {
/**
* List the local users associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: LocalUsersListOptionalParams
): PagedAsyncIterableIterator<LocalUser>;
/**
* Get the local user of the storage account by username.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param username The name of local user. The username must contain lowercase letters and numbers
* only. It must be unique only within the storage account.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
username: string,
options?: LocalUsersGetOptionalParams
): Promise<LocalUsersGetResponse>;
/**
* Create or update the properties of a local user associated with the storage account
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param username The name of local user. The username must contain lowercase letters and numbers
* only. It must be unique only within the storage account.
* @param properties The local user associated with a storage account.
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
accountName: string,
username: string,
properties: LocalUser,
options?: LocalUsersCreateOrUpdateOptionalParams
): Promise<LocalUsersCreateOrUpdateResponse>;
/**
* Deletes the local user associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param username The name of local user. The username must contain lowercase letters and numbers
* only. It must be unique only within the storage account.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
username: string,
options?: LocalUsersDeleteOptionalParams
): Promise<void>;
/**
* List SSH authorized keys and shared key of the local user.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param username The name of local user. The username must contain lowercase letters and numbers
* only. It must be unique only within the storage account.
* @param options The options parameters.
*/
listKeys(
resourceGroupName: string,
accountName: string,
username: string,
options?: LocalUsersListKeysOptionalParams
): Promise<LocalUsersListKeysResponse>;
/**
* Regenerate the local user SSH password.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param username The name of local user. The username must contain lowercase letters and numbers
* only. It must be unique only within the storage account.
* @param options The options parameters.
*/
regeneratePassword(
resourceGroupName: string,
accountName: string,
username: string,
options?: LocalUsersRegeneratePasswordOptionalParams
): Promise<LocalUsersRegeneratePasswordResponse>;
}
@@ -0,0 +1,74 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
ManagementPolicyName,
ManagementPoliciesGetOptionalParams,
ManagementPoliciesGetResponse,
ManagementPolicy,
ManagementPoliciesCreateOrUpdateOptionalParams,
ManagementPoliciesCreateOrUpdateResponse,
ManagementPoliciesDeleteOptionalParams
} from "../models";
/** Interface representing a ManagementPolicies. */
export interface ManagementPolicies {
/**
* Gets the managementpolicy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param managementPolicyName The name of the Storage Account Management Policy. It should always be
* 'default'
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
managementPolicyName: ManagementPolicyName,
options?: ManagementPoliciesGetOptionalParams
): Promise<ManagementPoliciesGetResponse>;
/**
* Sets the managementpolicy to the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param managementPolicyName The name of the Storage Account Management Policy. It should always be
* 'default'
* @param properties The ManagementPolicy set to a storage account.
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
accountName: string,
managementPolicyName: ManagementPolicyName,
properties: ManagementPolicy,
options?: ManagementPoliciesCreateOrUpdateOptionalParams
): Promise<ManagementPoliciesCreateOrUpdateResponse>;
/**
* Deletes the managementpolicy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param managementPolicyName The name of the Storage Account Management Policy. It should always be
* 'default'
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
managementPolicyName: ManagementPolicyName,
options?: ManagementPoliciesDeleteOptionalParams
): Promise<void>;
}
@@ -0,0 +1,97 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
ObjectReplicationPolicy,
ObjectReplicationPoliciesListOptionalParams,
ObjectReplicationPoliciesGetOptionalParams,
ObjectReplicationPoliciesGetResponse,
ObjectReplicationPoliciesCreateOrUpdateOptionalParams,
ObjectReplicationPoliciesCreateOrUpdateResponse,
ObjectReplicationPoliciesDeleteOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a ObjectReplicationPoliciesOperations. */
export interface ObjectReplicationPoliciesOperations {
/**
* List the object replication policies associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: ObjectReplicationPoliciesListOptionalParams
): PagedAsyncIterableIterator<ObjectReplicationPolicy>;
/**
* Get the object replication policy of the storage account by policy ID.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure
* the policy on the destination account first. For the source account, provide the value of the policy
* ID that is returned when you download the policy that was defined on the destination account. The
* policy is downloaded as a JSON file.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
objectReplicationPolicyId: string,
options?: ObjectReplicationPoliciesGetOptionalParams
): Promise<ObjectReplicationPoliciesGetResponse>;
/**
* Create or update the object replication policy of the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure
* the policy on the destination account first. For the source account, provide the value of the policy
* ID that is returned when you download the policy that was defined on the destination account. The
* policy is downloaded as a JSON file.
* @param properties The object replication policy set to a storage account. A unique policy ID will be
* created if absent.
* @param options The options parameters.
*/
createOrUpdate(
resourceGroupName: string,
accountName: string,
objectReplicationPolicyId: string,
properties: ObjectReplicationPolicy,
options?: ObjectReplicationPoliciesCreateOrUpdateOptionalParams
): Promise<ObjectReplicationPoliciesCreateOrUpdateResponse>;
/**
* Deletes the object replication policy associated with the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure
* the policy on the destination account first. For the source account, provide the value of the policy
* ID that is returned when you download the policy that was defined on the destination account. The
* policy is downloaded as a JSON file.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
objectReplicationPolicyId: string,
options?: ObjectReplicationPoliciesDeleteOptionalParams
): Promise<void>;
}
+22
View File
@@ -0,0 +1,22 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { Operation, OperationsListOptionalParams } from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a Operations. */
export interface Operations {
/**
* Lists all of the available Storage Rest API operations.
* @param options The options parameters.
*/
list(
options?: OperationsListOptionalParams
): PagedAsyncIterableIterator<Operation>;
}
@@ -0,0 +1,90 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
PrivateEndpointConnection,
PrivateEndpointConnectionsListOptionalParams,
PrivateEndpointConnectionsGetOptionalParams,
PrivateEndpointConnectionsGetResponse,
PrivateEndpointConnectionsPutOptionalParams,
PrivateEndpointConnectionsPutResponse,
PrivateEndpointConnectionsDeleteOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a PrivateEndpointConnections. */
export interface PrivateEndpointConnections {
/**
* List all the private endpoint connections associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: PrivateEndpointConnectionsListOptionalParams
): PagedAsyncIterableIterator<PrivateEndpointConnection>;
/**
* Gets the specified private endpoint connection associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the
* Azure resource
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsGetOptionalParams
): Promise<PrivateEndpointConnectionsGetResponse>;
/**
* Update the state of specified private endpoint connection associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the
* Azure resource
* @param properties The private endpoint connection properties.
* @param options The options parameters.
*/
put(
resourceGroupName: string,
accountName: string,
privateEndpointConnectionName: string,
properties: PrivateEndpointConnection,
options?: PrivateEndpointConnectionsPutOptionalParams
): Promise<PrivateEndpointConnectionsPutResponse>;
/**
* Deletes the specified private endpoint connection associated with the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param privateEndpointConnectionName The name of the private endpoint connection associated with the
* Azure resource
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
privateEndpointConnectionName: string,
options?: PrivateEndpointConnectionsDeleteOptionalParams
): Promise<void>;
}
@@ -0,0 +1,30 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
PrivateLinkResourcesListByStorageAccountOptionalParams,
PrivateLinkResourcesListByStorageAccountResponse
} from "../models";
/** Interface representing a PrivateLinkResources. */
export interface PrivateLinkResources {
/**
* Gets the private link resources that need to be created for a storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
listByStorageAccount(
resourceGroupName: string,
accountName: string,
options?: PrivateLinkResourcesListByStorageAccountOptionalParams
): Promise<PrivateLinkResourcesListByStorageAccountResponse>;
}
+116
View File
@@ -0,0 +1,116 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
ListQueue,
QueueListOptionalParams,
StorageQueue,
QueueCreateOptionalParams,
QueueCreateResponse,
QueueUpdateOptionalParams,
QueueUpdateResponse,
QueueGetOptionalParams,
QueueGetResponse,
QueueDeleteOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a Queue. */
export interface Queue {
/**
* Gets a list of all the queues under the specified storage account
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: QueueListOptionalParams
): PagedAsyncIterableIterator<ListQueue>;
/**
* Creates a new queue with the specified queue name, under the specified account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param queueName A queue name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should
* begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.
* @param queue Queue properties and metadata to be created with
* @param options The options parameters.
*/
create(
resourceGroupName: string,
accountName: string,
queueName: string,
queue: StorageQueue,
options?: QueueCreateOptionalParams
): Promise<QueueCreateResponse>;
/**
* Creates a new queue with the specified queue name, under the specified account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param queueName A queue name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should
* begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.
* @param queue Queue properties and metadata to be created with
* @param options The options parameters.
*/
update(
resourceGroupName: string,
accountName: string,
queueName: string,
queue: StorageQueue,
options?: QueueUpdateOptionalParams
): Promise<QueueUpdateResponse>;
/**
* Gets the queue with the specified queue name, under the specified account if it exists.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param queueName A queue name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should
* begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
queueName: string,
options?: QueueGetOptionalParams
): Promise<QueueGetResponse>;
/**
* Deletes the queue with the specified queue name, under the specified account if it exists.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param queueName A queue name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should
* begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
queueName: string,
options?: QueueDeleteOptionalParams
): Promise<void>;
}
@@ -0,0 +1,68 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
QueueServicesListOptionalParams,
QueueServicesListResponse,
QueueServiceProperties,
QueueServicesSetServicePropertiesOptionalParams,
QueueServicesSetServicePropertiesResponse,
QueueServicesGetServicePropertiesOptionalParams,
QueueServicesGetServicePropertiesResponse
} from "../models";
/** Interface representing a QueueServices. */
export interface QueueServices {
/**
* List all queue services for the storage account
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: QueueServicesListOptionalParams
): Promise<QueueServicesListResponse>;
/**
* Sets the properties of a storage accounts Queue service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The properties of a storage accounts Queue service, only properties for Storage
* Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified.
* @param options The options parameters.
*/
setServiceProperties(
resourceGroupName: string,
accountName: string,
parameters: QueueServiceProperties,
options?: QueueServicesSetServicePropertiesOptionalParams
): Promise<QueueServicesSetServicePropertiesResponse>;
/**
* Gets the properties of a storage accounts Queue service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
getServiceProperties(
resourceGroupName: string,
accountName: string,
options?: QueueServicesGetServicePropertiesOptionalParams
): Promise<QueueServicesGetServicePropertiesResponse>;
}
+22
View File
@@ -0,0 +1,22 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { SkuInformation, SkusListOptionalParams } from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a Skus. */
export interface Skus {
/**
* Lists the available SKUs supported by Microsoft.Storage for given subscription.
* @param options The options parameters.
*/
list(
options?: SkusListOptionalParams
): PagedAsyncIterableIterator<SkuInformation>;
}
@@ -0,0 +1,387 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { PollerLike, PollOperationState } from "@azure/core-lro";
import {
StorageAccount,
StorageAccountsListOptionalParams,
StorageAccountsListByResourceGroupOptionalParams,
StorageAccountCheckNameAvailabilityParameters,
StorageAccountsCheckNameAvailabilityOptionalParams,
StorageAccountsCheckNameAvailabilityResponse,
StorageAccountCreateParameters,
StorageAccountsCreateOptionalParams,
StorageAccountsCreateResponse,
StorageAccountsDeleteOptionalParams,
StorageAccountsGetPropertiesOptionalParams,
StorageAccountsGetPropertiesResponse,
StorageAccountUpdateParameters,
StorageAccountsUpdateOptionalParams,
StorageAccountsUpdateResponse,
StorageAccountsListKeysOptionalParams,
StorageAccountsListKeysResponse,
StorageAccountRegenerateKeyParameters,
StorageAccountsRegenerateKeyOptionalParams,
StorageAccountsRegenerateKeyResponse,
AccountSasParameters,
StorageAccountsListAccountSASOptionalParams,
StorageAccountsListAccountSASResponse,
ServiceSasParameters,
StorageAccountsListServiceSASOptionalParams,
StorageAccountsListServiceSASResponse,
StorageAccountsFailoverOptionalParams,
StorageAccountsHierarchicalNamespaceMigrationOptionalParams,
StorageAccountsAbortHierarchicalNamespaceMigrationOptionalParams,
BlobRestoreParameters,
StorageAccountsRestoreBlobRangesOptionalParams,
StorageAccountsRestoreBlobRangesResponse,
StorageAccountsRevokeUserDelegationKeysOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a StorageAccounts. */
export interface StorageAccounts {
/**
* Lists all the storage accounts available under the subscription. Note that storage keys are not
* returned; use the ListKeys operation for this.
* @param options The options parameters.
*/
list(
options?: StorageAccountsListOptionalParams
): PagedAsyncIterableIterator<StorageAccount>;
/**
* Lists all the storage accounts available under the given resource group. Note that storage keys are
* not returned; use the ListKeys operation for this.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param options The options parameters.
*/
listByResourceGroup(
resourceGroupName: string,
options?: StorageAccountsListByResourceGroupOptionalParams
): PagedAsyncIterableIterator<StorageAccount>;
/**
* Checks that the storage account name is valid and is not already in use.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
checkNameAvailability(
accountName: StorageAccountCheckNameAvailabilityParameters,
options?: StorageAccountsCheckNameAvailabilityOptionalParams
): Promise<StorageAccountsCheckNameAvailabilityResponse>;
/**
* Asynchronously creates a new storage account with the specified parameters. If an account is already
* created and a subsequent create request is issued with different properties, the account properties
* will be updated. If an account is already created and a subsequent create or update request is
* issued with the exact same set of properties, the request will succeed.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The parameters to provide for the created account.
* @param options The options parameters.
*/
beginCreate(
resourceGroupName: string,
accountName: string,
parameters: StorageAccountCreateParameters,
options?: StorageAccountsCreateOptionalParams
): Promise<
PollerLike<
PollOperationState<StorageAccountsCreateResponse>,
StorageAccountsCreateResponse
>
>;
/**
* Asynchronously creates a new storage account with the specified parameters. If an account is already
* created and a subsequent create request is issued with different properties, the account properties
* will be updated. If an account is already created and a subsequent create or update request is
* issued with the exact same set of properties, the request will succeed.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The parameters to provide for the created account.
* @param options The options parameters.
*/
beginCreateAndWait(
resourceGroupName: string,
accountName: string,
parameters: StorageAccountCreateParameters,
options?: StorageAccountsCreateOptionalParams
): Promise<StorageAccountsCreateResponse>;
/**
* Deletes a storage account in Microsoft Azure.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
options?: StorageAccountsDeleteOptionalParams
): Promise<void>;
/**
* Returns the properties for the specified storage account including but not limited to name, SKU
* name, location, and account status. The ListKeys operation should be used to retrieve storage keys.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
getProperties(
resourceGroupName: string,
accountName: string,
options?: StorageAccountsGetPropertiesOptionalParams
): Promise<StorageAccountsGetPropertiesResponse>;
/**
* The update operation can be used to update the SKU, encryption, access tier, or tags for a storage
* account. It can also be used to map the account to a custom domain. Only one custom domain is
* supported per storage account; the replacement/change of custom domain is not supported. In order to
* replace an old custom domain, the old value must be cleared/unregistered before a new value can be
* set. The update of multiple properties is supported. This call does not change the storage keys for
* the account. If you want to change the storage account keys, use the regenerate keys operation. The
* location and name of the storage account cannot be changed after creation.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The parameters to provide for the updated account.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
accountName: string,
parameters: StorageAccountUpdateParameters,
options?: StorageAccountsUpdateOptionalParams
): Promise<StorageAccountsUpdateResponse>;
/**
* Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage
* account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
listKeys(
resourceGroupName: string,
accountName: string,
options?: StorageAccountsListKeysOptionalParams
): Promise<StorageAccountsListKeysResponse>;
/**
* Regenerates one of the access keys or Kerberos keys for the specified storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1,
* kerb2.
* @param options The options parameters.
*/
regenerateKey(
resourceGroupName: string,
accountName: string,
regenerateKey: StorageAccountRegenerateKeyParameters,
options?: StorageAccountsRegenerateKeyOptionalParams
): Promise<StorageAccountsRegenerateKeyResponse>;
/**
* List SAS credentials of a storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The parameters to provide to list SAS credentials for the storage account.
* @param options The options parameters.
*/
listAccountSAS(
resourceGroupName: string,
accountName: string,
parameters: AccountSasParameters,
options?: StorageAccountsListAccountSASOptionalParams
): Promise<StorageAccountsListAccountSASResponse>;
/**
* List service SAS credentials of a specific resource.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The parameters to provide to list service SAS credentials.
* @param options The options parameters.
*/
listServiceSAS(
resourceGroupName: string,
accountName: string,
parameters: ServiceSasParameters,
options?: StorageAccountsListServiceSASOptionalParams
): Promise<StorageAccountsListServiceSASResponse>;
/**
* Failover request can be triggered for a storage account in case of availability issues. The failover
* occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The
* secondary cluster will become primary after failover.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
beginFailover(
resourceGroupName: string,
accountName: string,
options?: StorageAccountsFailoverOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>>;
/**
* Failover request can be triggered for a storage account in case of availability issues. The failover
* occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The
* secondary cluster will become primary after failover.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
beginFailoverAndWait(
resourceGroupName: string,
accountName: string,
options?: StorageAccountsFailoverOptionalParams
): Promise<void>;
/**
* Live Migration of storage account to enable Hns
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param requestType Required. Hierarchical namespace migration type can either be a hierarchical
* namespace validation request 'HnsOnValidationRequest' or a hydration request
* 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the hydration
* request will migrate the account.
* @param options The options parameters.
*/
beginHierarchicalNamespaceMigration(
resourceGroupName: string,
accountName: string,
requestType: string,
options?: StorageAccountsHierarchicalNamespaceMigrationOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>>;
/**
* Live Migration of storage account to enable Hns
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param requestType Required. Hierarchical namespace migration type can either be a hierarchical
* namespace validation request 'HnsOnValidationRequest' or a hydration request
* 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the hydration
* request will migrate the account.
* @param options The options parameters.
*/
beginHierarchicalNamespaceMigrationAndWait(
resourceGroupName: string,
accountName: string,
requestType: string,
options?: StorageAccountsHierarchicalNamespaceMigrationOptionalParams
): Promise<void>;
/**
* Abort live Migration of storage account to enable Hns
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
beginAbortHierarchicalNamespaceMigration(
resourceGroupName: string,
accountName: string,
options?: StorageAccountsAbortHierarchicalNamespaceMigrationOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>>;
/**
* Abort live Migration of storage account to enable Hns
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
beginAbortHierarchicalNamespaceMigrationAndWait(
resourceGroupName: string,
accountName: string,
options?: StorageAccountsAbortHierarchicalNamespaceMigrationOptionalParams
): Promise<void>;
/**
* Restore blobs in the specified blob ranges
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The parameters to provide for restore blob ranges.
* @param options The options parameters.
*/
beginRestoreBlobRanges(
resourceGroupName: string,
accountName: string,
parameters: BlobRestoreParameters,
options?: StorageAccountsRestoreBlobRangesOptionalParams
): Promise<
PollerLike<
PollOperationState<StorageAccountsRestoreBlobRangesResponse>,
StorageAccountsRestoreBlobRangesResponse
>
>;
/**
* Restore blobs in the specified blob ranges
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The parameters to provide for restore blob ranges.
* @param options The options parameters.
*/
beginRestoreBlobRangesAndWait(
resourceGroupName: string,
accountName: string,
parameters: BlobRestoreParameters,
options?: StorageAccountsRestoreBlobRangesOptionalParams
): Promise<StorageAccountsRestoreBlobRangesResponse>;
/**
* Revoke user delegation keys.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
revokeUserDelegationKeys(
resourceGroupName: string,
accountName: string,
options?: StorageAccountsRevokeUserDelegationKeysOptionalParams
): Promise<void>;
}
@@ -0,0 +1,111 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import {
Table,
TableListOptionalParams,
TableCreateOptionalParams,
TableCreateResponse,
TableUpdateOptionalParams,
TableUpdateResponse,
TableGetOptionalParams,
TableGetResponse,
TableDeleteOptionalParams
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a TableOperations. */
export interface TableOperations {
/**
* Gets a list of all the tables under the specified storage account
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: TableListOptionalParams
): PagedAsyncIterableIterator<Table>;
/**
* Creates a new table with the specified table name, under the specified account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param tableName A table name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric
* character.
* @param options The options parameters.
*/
create(
resourceGroupName: string,
accountName: string,
tableName: string,
options?: TableCreateOptionalParams
): Promise<TableCreateResponse>;
/**
* Creates a new table with the specified table name, under the specified account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param tableName A table name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric
* character.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
accountName: string,
tableName: string,
options?: TableUpdateOptionalParams
): Promise<TableUpdateResponse>;
/**
* Gets the table with the specified table name, under the specified account if it exists.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param tableName A table name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric
* character.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
accountName: string,
tableName: string,
options?: TableGetOptionalParams
): Promise<TableGetResponse>;
/**
* Deletes the table with the specified table name, under the specified account if it exists.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param tableName A table name must be unique within a storage account and must be between 3 and 63
* characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric
* character.
* @param options The options parameters.
*/
delete(
resourceGroupName: string,
accountName: string,
tableName: string,
options?: TableDeleteOptionalParams
): Promise<void>;
}
@@ -0,0 +1,68 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
TableServicesListOptionalParams,
TableServicesListResponse,
TableServiceProperties,
TableServicesSetServicePropertiesOptionalParams,
TableServicesSetServicePropertiesResponse,
TableServicesGetServicePropertiesOptionalParams,
TableServicesGetServicePropertiesResponse
} from "../models";
/** Interface representing a TableServices. */
export interface TableServices {
/**
* List all table services for the storage account.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
list(
resourceGroupName: string,
accountName: string,
options?: TableServicesListOptionalParams
): Promise<TableServicesListResponse>;
/**
* Sets the properties of a storage accounts Table service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param parameters The properties of a storage accounts Table service, only properties for Storage
* Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified.
* @param options The options parameters.
*/
setServiceProperties(
resourceGroupName: string,
accountName: string,
parameters: TableServiceProperties,
options?: TableServicesSetServicePropertiesOptionalParams
): Promise<TableServicesSetServicePropertiesResponse>;
/**
* Gets the properties of a storage accounts Table service, including properties for Storage Analytics
* and CORS (Cross-Origin Resource Sharing) rules.
* @param resourceGroupName The name of the resource group within the user's subscription. The name is
* case insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage
* account names must be between 3 and 24 characters in length and use numbers and lower-case letters
* only.
* @param options The options parameters.
*/
getServiceProperties(
resourceGroupName: string,
accountName: string,
options?: TableServicesGetServicePropertiesOptionalParams
): Promise<TableServicesGetServicePropertiesResponse>;
}
+24
View File
@@ -0,0 +1,24 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { Usage, UsagesListByLocationOptionalParams } from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a Usages. */
export interface Usages {
/**
* Gets the current usage count and the limit for the resources of the location under the subscription.
* @param location The location of the Azure Storage resource.
* @param options The options parameters.
*/
listByLocation(
location: string,
options?: UsagesListByLocationOptionalParams
): PagedAsyncIterableIterator<Usage>;
}
+216
View File
@@ -0,0 +1,216 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreClient from "@azure/core-client";
import * as coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import {
OperationsImpl,
SkusImpl,
StorageAccountsImpl,
DeletedAccountsImpl,
UsagesImpl,
ManagementPoliciesImpl,
BlobInventoryPoliciesImpl,
PrivateEndpointConnectionsImpl,
PrivateLinkResourcesImpl,
ObjectReplicationPoliciesOperationsImpl,
LocalUsersOperationsImpl,
EncryptionScopesImpl,
BlobServicesImpl,
BlobContainersImpl,
FileServicesImpl,
FileSharesImpl,
QueueServicesImpl,
QueueImpl,
TableServicesImpl,
TableOperationsImpl
} from "./operations";
import {
Operations,
Skus,
StorageAccounts,
DeletedAccounts,
Usages,
ManagementPolicies,
BlobInventoryPolicies,
PrivateEndpointConnections,
PrivateLinkResources,
ObjectReplicationPoliciesOperations,
LocalUsersOperations,
EncryptionScopes,
BlobServices,
BlobContainers,
FileServices,
FileShares,
QueueServices,
Queue,
TableServices,
TableOperations
} from "./operationsInterfaces";
import { StorageManagementClientOptionalParams } from "./models";
export class StorageManagementClient extends coreClient.ServiceClient {
$host: string;
apiVersion: string;
subscriptionId: string;
/**
* Initializes a new instance of the StorageManagementClient class.
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param subscriptionId The ID of the target subscription.
* @param options The parameter options
*/
constructor(
credentials: coreAuth.TokenCredential,
subscriptionId: string,
options?: StorageManagementClientOptionalParams
) {
if (credentials === undefined) {
throw new Error("'credentials' cannot be null");
}
if (subscriptionId === undefined) {
throw new Error("'subscriptionId' cannot be null");
}
// Initializing default values for options
if (!options) {
options = {};
}
const defaults: StorageManagementClientOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
};
const packageDetails = `azsdk-js-arm-storage/17.2.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;
if (!options.credentialScopes) {
options.credentialScopes = ["https://management.azure.com/.default"];
}
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
},
baseUri:
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
};
super(optionsWithDefaults);
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName
);
if (!bearerTokenAuthenticationPolicyFound) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
scopes: `${optionsWithDefaults.baseUri}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
}
}
// Parameter assignments
this.subscriptionId = subscriptionId;
// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2021-09-01";
this.operations = new OperationsImpl(this);
this.skus = new SkusImpl(this);
this.storageAccounts = new StorageAccountsImpl(this);
this.deletedAccounts = new DeletedAccountsImpl(this);
this.usages = new UsagesImpl(this);
this.managementPolicies = new ManagementPoliciesImpl(this);
this.blobInventoryPolicies = new BlobInventoryPoliciesImpl(this);
this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
this.privateLinkResources = new PrivateLinkResourcesImpl(this);
this.objectReplicationPoliciesOperations = new ObjectReplicationPoliciesOperationsImpl(
this
);
this.localUsersOperations = new LocalUsersOperationsImpl(this);
this.encryptionScopes = new EncryptionScopesImpl(this);
this.blobServices = new BlobServicesImpl(this);
this.blobContainers = new BlobContainersImpl(this);
this.fileServices = new FileServicesImpl(this);
this.fileShares = new FileSharesImpl(this);
this.queueServices = new QueueServicesImpl(this);
this.queue = new QueueImpl(this);
this.tableServices = new TableServicesImpl(this);
this.tableOperations = new TableOperationsImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
}
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
private addCustomApiVersionPolicy(apiVersion?: string) {
if (!apiVersion) {
return;
}
const apiVersionPolicy = {
name: "CustomApiVersionPolicy",
async sendRequest(
request: PipelineRequest,
next: SendRequest
): Promise<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
const newParams = param[1].split("&").map((item) => {
if (item.indexOf("api-version") > -1) {
return item.replace(/(?<==).*$/, apiVersion);
} else {
return item;
}
});
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
};
this.pipeline.addPolicy(apiVersionPolicy);
}
operations: Operations;
skus: Skus;
storageAccounts: StorageAccounts;
deletedAccounts: DeletedAccounts;
usages: Usages;
managementPolicies: ManagementPolicies;
blobInventoryPolicies: BlobInventoryPolicies;
privateEndpointConnections: PrivateEndpointConnections;
privateLinkResources: PrivateLinkResources;
objectReplicationPoliciesOperations: ObjectReplicationPoliciesOperations;
localUsersOperations: LocalUsersOperations;
encryptionScopes: EncryptionScopes;
blobServices: BlobServices;
blobContainers: BlobContainers;
fileServices: FileServices;
fileShares: FileShares;
queueServices: QueueServices;
queue: Queue;
tableServices: TableServices;
tableOperations: TableOperations;
}