Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 17 additions & 36 deletions packages/@azure/arm-storage/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
## Azure StorageManagementClient SDK for JavaScript

# Azure StorageManagementClient SDK for JavaScript
This package contains an isomorphic SDK for StorageManagementClient.

### Currently supported environments

## Currently supported environments
- Node.js version 6.x.x or higher
- Browser JavaScript

### How to Install

## How to Install
```
npm install @azure/arm-storage
```

### How to use

#### nodejs - Authentication, client creation and list operations as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

```
npm install @azure/ms-rest-nodeauth
```
## How to use

##### Sample code
### nodejs - Authentication, client creation and list operations as an example written in TypeScript.

```ts
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
import { StorageManagementClient, StorageManagementModels, StorageManagementMappers } from "@azure/arm-storage";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

Expand All @@ -43,16 +33,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
});
```

#### browser - Authentication, client creation and list operations as an example written in JavaScript.

##### Install @azure/ms-rest-browserauth

```
npm install @azure/ms-rest-browserauth
```

##### Sample code

### browser - Authentication, client creation and list operations as an example written in JavaScript.
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.

- index.html
Expand All @@ -61,11 +42,11 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
<html lang="en">
<head>
<title>@azure/arm-storage sample</title>
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/arm-storage/dist/arm-storage.js"></script>
<script type="text/javascript">
<script>
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
Expand All @@ -87,10 +68,10 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
});
</script>
</head>
<body></body>
<body>
</body>
</html>
```

## Related projects

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
# Related projects
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export {
KeyVaultProperties,
NetworkRuleSet,
VirtualNetworkRule,
IPRule
IPRule,
GeoReplicationStats
} from "../models/mappers";

Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export {
KeyVaultProperties,
NetworkRuleSet,
VirtualNetworkRule,
IPRule
IPRule,
GeoReplicationStats
} from "../models/mappers";

83 changes: 81 additions & 2 deletions packages/@azure/arm-storage/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* regenerated.
*/

import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js";
import * as msRest from "@azure/ms-rest-js";
import { BaseResource, CloudError, AzureServiceClientOptions } from "ms-rest-azure-js";
import * as msRest from "ms-rest-js";

export { BaseResource, CloudError };

Expand Down Expand Up @@ -657,6 +657,46 @@ export interface Endpoints {
readonly dfs?: string;
}

/**
* @interface
* An interface representing GeoReplicationStats.
* Statistics related to replication for storage account's Blob, Table, Queue
* and File services. It is only available when geo-redundant replication is
* enabled for the storage account.
*
*/
export interface GeoReplicationStats {
/**
* @member {GeoReplicationStatus} [status] The status of the secondary
* location. Possible values are: - Live: Indicates that the secondary
* location is active and operational. - Bootstrap: Indicates initial
* synchronization from the primary location to the secondary location is in
* progress.This typically occurs when replication is first enabled. -
* Unavailable: Indicates that the secondary location is temporarily
* unavailable. Possible values include: 'Live', 'Bootstrap', 'Unavailable'
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly status?: GeoReplicationStatus;
/**
* @member {Date} [lastSyncTime] All primary writes preceding this UTC
* date/time value are guaranteed to be available for read operations.
* Primary writes following this point in time may or may not be available
* for reads. Element may be default value if value of LastSyncTime is not
* available, this can happen if secondary is offline or we are in bootstrap.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly lastSyncTime?: Date;
/**
* @member {boolean} [canFailover] A boolean flag which indicates whether or
* not account failover is supported for the account.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly canFailover?: boolean;
}

/**
* @interface
* An interface representing Resource.
Expand Down Expand Up @@ -845,6 +885,12 @@ export interface StorageAccount extends TrackedResource {
* sets to true.
*/
isHnsEnabled?: boolean;
/**
* @member {GeoReplicationStats} [geoReplicationStats] Geo Replication Stats
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly geoReplicationStats?: GeoReplicationStats;
/**
* @member {boolean} [failoverInProgress] If the failover is in progress, the
* value will be true, otherwise, it will be null.
Expand Down Expand Up @@ -1773,6 +1819,23 @@ export interface ManagementPoliciesRulesSetParameter {
policy?: any;
}

/**
* @interface
* An interface representing StorageAccountsGetPropertiesOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface StorageAccountsGetPropertiesOptionalParams extends msRest.RequestOptionsBase {
/**
* @member {StorageAccountExpand} [expand] May be used to expand the
* properties within account's properties. By default, data is not included
* when fecthing properties. Currently we only support geoReplicationStats.
* Possible values include: 'geoReplicationStats'
*/
expand?: StorageAccountExpand;
}

/**
* @interface
* An interface representing BlobContainersCreateOptionalParams.
Expand Down Expand Up @@ -2090,6 +2153,14 @@ export type DefaultAction = 'Allow' | 'Deny';
*/
export type AccessTier = 'Hot' | 'Cool';

/**
* Defines values for GeoReplicationStatus.
* Possible values include: 'Live', 'Bootstrap', 'Unavailable'
* @readonly
* @enum {string}
*/
export type GeoReplicationStatus = 'Live' | 'Bootstrap' | 'Unavailable';

/**
* Defines values for ProvisioningState.
* Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'
Expand Down Expand Up @@ -2211,6 +2282,14 @@ export type ImmutabilityPolicyState = 'Locked' | 'Unlocked';
*/
export type ImmutabilityPolicyUpdateType = 'put' | 'lock' | 'extend';

/**
* Defines values for StorageAccountExpand.
* Possible values include: 'geoReplicationStats'
* @readonly
* @enum {string}
*/
export type StorageAccountExpand = 'geoReplicationStats';

/**
* Contains response data for the list operation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export {
KeyVaultProperties,
NetworkRuleSet,
VirtualNetworkRule,
IPRule
IPRule,
GeoReplicationStats
} from "../models/mappers";

43 changes: 41 additions & 2 deletions packages/@azure/arm-storage/lib/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* regenerated.
*/

import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js";
import * as msRest from "@azure/ms-rest-js";
import { CloudErrorMapper, BaseResourceMapper } from "ms-rest-azure-js";
import * as msRest from "ms-rest-js";

export const CloudError = CloudErrorMapper;
export const BaseResource = BaseResourceMapper;
Expand Down Expand Up @@ -869,6 +869,37 @@ export const Endpoints: msRest.CompositeMapper = {
}
};

export const GeoReplicationStats: msRest.CompositeMapper = {
serializedName: "GeoReplicationStats",
type: {
name: "Composite",
className: "GeoReplicationStats",
modelProperties: {
status: {
readOnly: true,
serializedName: "status",
type: {
name: "String"
}
},
lastSyncTime: {
readOnly: true,
serializedName: "lastSyncTime",
type: {
name: "DateTime"
}
},
canFailover: {
readOnly: true,
serializedName: "canFailover",
type: {
name: "Boolean"
}
}
}
}
};

export const Resource: msRest.CompositeMapper = {
serializedName: "Resource",
type: {
Expand Down Expand Up @@ -1096,6 +1127,14 @@ export const StorageAccount: msRest.CompositeMapper = {
name: "Boolean"
}
},
geoReplicationStats: {
readOnly: true,
serializedName: "properties.geoReplicationStats",
type: {
name: "Composite",
className: "GeoReplicationStats"
}
},
failoverInProgress: {
readOnly: true,
serializedName: "properties.failoverInProgress",
Expand Down
17 changes: 16 additions & 1 deletion packages/@azure/arm-storage/lib/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";

export const acceptLanguage: msRest.OperationParameter = {
parameterPath: "acceptLanguage",
Expand Down Expand Up @@ -90,6 +90,21 @@ export const containerName: msRest.OperationURLParameter = {
}
}
};
export const expand: msRest.OperationQueryParameter = {
parameterPath: [
"options",
"expand"
],
mapper: {
serializedName: "$expand",
type: {
name: "Enum",
allowedValues: [
"geoReplicationStats"
]
}
}
};
export const ifMatch0: msRest.OperationParameter = {
parameterPath: [
"options",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export {
Resource,
BaseResource,
Endpoints,
GeoReplicationStats,
StorageAccountUpdateParameters,
StorageAccountListResult,
StorageAccountListKeysResult,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/blobContainersMappers";
import * as Parameters from "../models/parameters";
Expand Down
2 changes: 1 addition & 1 deletion packages/@azure/arm-storage/lib/operations/blobServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/blobServicesMappers";
import * as Parameters from "../models/parameters";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/managementPoliciesMappers";
import * as Parameters from "../models/parameters";
Expand Down
2 changes: 1 addition & 1 deletion packages/@azure/arm-storage/lib/operations/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/operationsMappers";
import * as Parameters from "../models/parameters";
Expand Down
2 changes: 1 addition & 1 deletion packages/@azure/arm-storage/lib/operations/skus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as msRest from "ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/skusMappers";
import * as Parameters from "../models/parameters";
Expand Down
Loading