go.mod: update osbuild/images to v0.156.0

tag v0.155.0
Tagger: imagebuilder-bot <imagebuilder-bots+imagebuilder-bot@redhat.com>

Changes with 0.155.0

----------------
  * Fedora 43: add shadow-utils when LockRoot is enabled, update cloud-init service name (osbuild/images#1618)
    * Author: Achilleas Koutsou, Reviewers: Gianluca Zuccarelli, Michael Vogt
  * Update osbuild dependency commit ID to latest (osbuild/images#1609)
    * Author: SchutzBot, Reviewers: Achilleas Koutsou, Simon de Vlieger, Tomáš Hozza
  * Update snapshots to 20250626 (osbuild/images#1623)
    * Author: SchutzBot, Reviewers: Achilleas Koutsou, Simon de Vlieger
  * distro/rhel9: xz compress azure-cvm image type [HMS-8587] (osbuild/images#1620)
    * Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza
  * distro/rhel: introduce new image type: Azure SAP Apps [HMS-8738] (osbuild/images#1612)
    * Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza
  * distro/rhel: move ansible-core to sap_extras_pkgset (osbuild/images#1624)
    * Author: Achilleas Koutsou, Reviewers: Brian C. Lane, Tomáš Hozza
  * github/create-tag: allow passing the version when run manually (osbuild/images#1621)
    * Author: Achilleas Koutsou, Reviewers: Lukáš Zapletal, Tomáš Hozza
  * rhel9: move image-config into pure YAML (HMS-8593) (osbuild/images#1616)
    * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger
  * test: split manifest checksums into separate files (osbuild/images#1625)
    * Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza

— Somewhere on the Internet, 2025-06-30

---

tag v0.156.0
Tagger: imagebuilder-bot <imagebuilder-bots+imagebuilder-bot@redhat.com>

Changes with 0.156.0

----------------
  * Many: delete repositories for EOL distributions (HMS-7044) (osbuild/images#1607)
    * Author: Tomáš Hozza, Reviewers: Michael Vogt, Simon de Vlieger
  * RHSM/facts: add 'image-builder CLI' API type (osbuild/images#1640)
    * Author: Tomáš Hozza, Reviewers: Brian C. Lane, Simon de Vlieger
  * Update dependencies 2025-06-29 (osbuild/images#1628)
    * Author: SchutzBot, Reviewers: Simon de Vlieger, Tomáš Hozza
  * Update osbuild dependency commit ID to latest (osbuild/images#1627)
    * Author: SchutzBot, Reviewers: Simon de Vlieger, Tomáš Hozza
  * [RFC] image: drop `InstallWeakDeps` from image.DiskImage (osbuild/images#1642)
    * Author: Michael Vogt, Reviewers: Brian C. Lane, Simon de Vlieger, Tomáš Hozza
  * build(deps): bump the go-deps group across 1 directory with 3 updates (osbuild/images#1632)
    * Author: dependabot[bot], Reviewers: SchutzBot, Tomáš Hozza
  * distro/rhel10: xz compress azure-cvm image type (osbuild/images#1638)
    * Author: Achilleas Koutsou, Reviewers: Brian C. Lane, Simon de Vlieger
  * distro: cleanup/refactor distro/{defs,generic} (HMS-8744) (osbuild/images#1570)
    * Author: Michael Vogt, Reviewers: Simon de Vlieger, Tomáš Hozza
  * distro: remove some hardcoded values from generic/images.go (osbuild/images#1636)
    * Author: Michael Vogt, Reviewers: Simon de Vlieger, Tomáš Hozza
  * distro: small tweaks for the YAML based imagetypes (osbuild/images#1622)
    * Author: Michael Vogt, Reviewers: Brian C. Lane, Simon de Vlieger
  * fedora/wsl: packages and locale (osbuild/images#1635)
    * Author: Simon de Vlieger, Reviewers: Michael Vogt, Tomáš Hozza
  * image/many: make compression more generic (osbuild/images#1634)
    * Author: Simon de Vlieger, Reviewers: Brian C. Lane, Michael Vogt
  * manifest: handle content template name with spaces (osbuild/images#1641)
    * Author: Bryttanie, Reviewers: Brian C. Lane, Michael Vogt, Tomáš Hozza
  * many: implement gzip (osbuild/images#1633)
    * Author: Simon de Vlieger, Reviewers: Michael Vogt, Tomáš Hozza
  * rhel/azure: set GRUB_TERMINAL based on architecture [RHEL-91383] (osbuild/images#1626)
    * Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza

— Somewhere on the Internet, 2025-07-07

---
This commit is contained in:
Achilleas Koutsou 2025-07-10 16:14:25 +02:00
parent 60c5f10af8
commit 3fd7092db5
1486 changed files with 124742 additions and 82516 deletions

View file

@ -1,5 +1,19 @@
# Release History
## 1.18.0 (2025-04-03)
### Features Added
* Added `AccessToken.RefreshOn` and updated `BearerTokenPolicy` to consider nonzero values of it when deciding whether to request a new token
## 1.17.1 (2025-03-20)
### Other Changes
* Upgraded to Go 1.23
* Upgraded dependencies
## 1.17.0 (2025-01-07)
### Features Added

View file

@ -47,8 +47,13 @@ func HasStatusCode(resp *http.Response, statusCodes ...int) bool {
// AccessToken represents an Azure service bearer access token with expiry information.
// Exported as azcore.AccessToken.
type AccessToken struct {
Token string
// Token is the access token
Token string
// ExpiresOn indicates when the token expires
ExpiresOn time.Time
// RefreshOn is a suggested time to refresh the token.
// Clients should ignore this value when it's zero.
RefreshOn time.Time
}
// TokenRequestOptions contain specific parameter that may be used by credentials types when attempting to get a token.

View file

@ -40,5 +40,5 @@ const (
Module = "azcore"
// Version is the semantic version (see http://semver.org) of this module.
Version = "v1.17.0"
Version = "v1.18.0"
)

View file

@ -51,6 +51,15 @@ func acquire(state acquiringResourceState) (newResource exported.AccessToken, ne
return tk, tk.ExpiresOn, nil
}
// shouldRefresh determines whether the token should be refreshed. It's a variable so tests can replace it.
var shouldRefresh = func(tk exported.AccessToken, _ acquiringResourceState) bool {
if tk.RefreshOn.IsZero() {
return tk.ExpiresOn.Add(-5 * time.Minute).Before(time.Now())
}
// no offset in this case because the authority suggested a refresh window--between RefreshOn and ExpiresOn
return tk.RefreshOn.Before(time.Now())
}
// NewBearerTokenPolicy creates a policy object that authorizes requests with bearer tokens.
// cred: an azcore.TokenCredential implementation such as a credential object from azidentity
// scopes: the list of permission scopes required for the token.
@ -69,11 +78,14 @@ func NewBearerTokenPolicy(cred exported.TokenCredential, scopes []string, opts *
return authNZ(policy.TokenRequestOptions{Scopes: scopes})
}
}
mr := temporal.NewResourceWithOptions(acquire, temporal.ResourceOptions[exported.AccessToken, acquiringResourceState]{
ShouldRefresh: shouldRefresh,
})
return &BearerTokenPolicy{
authzHandler: ah,
cred: cred,
scopes: scopes,
mainResource: temporal.NewResource(acquire),
mainResource: mr,
allowHTTP: opts.InsecureAllowCredentialWithHTTP,
}
}

View file

@ -1,5 +1,15 @@
# Breaking Changes
## v1.8.0
### New errors from `NewManagedIdentityCredential` in some environments
`NewManagedIdentityCredential` now returns an error when `ManagedIdentityCredentialOptions.ID` is set in a hosting environment whose managed identity API doesn't support user-assigned identities. `ManagedIdentityCredential.GetToken()` formerly logged a warning in these cases. Returning an error instead prevents the credential authenticating an unexpected identity. The affected hosting environments are:
* Azure Arc
* Azure ML (when a resource or object ID is specified; client IDs are supported)
* Cloud Shell
* Service Fabric
## v1.6.0
### Behavioral change to `DefaultAzureCredential` in IMDS managed identity scenarios

View file

@ -1,5 +1,36 @@
# Release History
## 1.9.0 (2025-04-08)
### Features Added
* `GetToken()` sets `AccessToken.RefreshOn` when the token provider specifies a value
### Other Changes
* `NewManagedIdentityCredential` logs the configured user-assigned identity, if any
* Deprecated `UsernamePasswordCredential` because it can't support multifactor
authentication (MFA), which Microsoft Entra ID requires for most tenants. See
https://aka.ms/azsdk/identity/mfa for migration guidance.
* Updated dependencies
## 1.8.2 (2025-02-12)
### Other Changes
* Upgraded dependencies
## 1.8.1 (2025-01-15)
### Bugs Fixed
* User credential types inconsistently log access token scopes
* `DefaultAzureCredential` skips managed identity in Azure Container Instances
* Credentials having optional tenant IDs such as `AzureCLICredential` and
`InteractiveBrowserCredential` require setting `AdditionallyAllowedTenants`
when used with some clients
### Other Changes
* `ChainedTokenCredential` and `DefaultAzureCredential` continue to their next
credential after `ManagedIdentityCredential` receives an unexpected response
from IMDS, indicating the response is from something else such as a proxy
## 1.8.0 (2024-10-08)
### Other Changes

View file

@ -304,4 +304,4 @@ client := subscriptions.NewClient()
client.Authorizer = azidext.NewTokenCredentialAdapter(cred, []string{"https://management.azure.com//.default"})
```
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-go%2Fsdk%2Fazidentity%2FMIGRATION.png)

View file

@ -21,7 +21,7 @@ go get -u github.com/Azure/azure-sdk-for-go/sdk/azidentity
## Prerequisites
- an [Azure subscription](https://azure.microsoft.com/free/)
- Go 1.18
- [Supported](https://aka.ms/azsdk/go/supported-versions) version of Go
### Authenticating during local development
@ -54,17 +54,7 @@ The `azidentity` module focuses on OAuth authentication with Microsoft Entra ID.
### DefaultAzureCredential
`DefaultAzureCredential` simplifies authentication while developing applications that deploy to Azure by combining credentials used in Azure hosting environments and credentials used in local development. In production, it's better to use a specific credential type so authentication is more predictable and easier to debug. `DefaultAzureCredential` attempts to authenticate via the following mechanisms in this order, stopping when one succeeds:
![DefaultAzureCredential authentication flow](img/mermaidjs/DefaultAzureCredentialAuthFlow.svg)
1. **Environment** - `DefaultAzureCredential` will read account information specified via [environment variables](#environment-variables) and use it to authenticate.
1. **Workload Identity** - If the app is deployed on Kubernetes with environment variables set by the workload identity webhook, `DefaultAzureCredential` will authenticate the configured identity.
1. **Managed Identity** - If the app is deployed to an Azure host with managed identity enabled, `DefaultAzureCredential` will authenticate with it.
1. **Azure CLI** - If a user or service principal has authenticated via the Azure CLI `az login` command, `DefaultAzureCredential` will authenticate that identity.
1. **Azure Developer CLI** - If the developer has authenticated via the Azure Developer CLI `azd auth login` command, the `DefaultAzureCredential` will authenticate with that account.
> Note: `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types.
`DefaultAzureCredential` simplifies authentication while developing apps that deploy to Azure by combining credentials used in Azure hosting environments with credentials used in local development. For more information, see [DefaultAzureCredential overview][dac_overview].
## Managed Identity
@ -128,10 +118,10 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
### Credential chains
|Credential|Usage
|-|-
|[DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential)|Simplified authentication experience for getting started developing Azure apps
|[ChainedTokenCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ChainedTokenCredential)|Define custom authentication flows, composing multiple credentials
|Credential|Usage|Reference
|-|-|-
|[DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential)|Simplified authentication experience for getting started developing Azure apps|[DefaultAzureCredential overview][dac_overview]|
|[ChainedTokenCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ChainedTokenCredential)|Define custom authentication flows, composing multiple credentials|[ChainedTokenCredential overview][ctc_overview]|
### Authenticating Azure-Hosted Applications
@ -156,7 +146,6 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
|-|-
|[InteractiveBrowserCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#InteractiveBrowserCredential)|Interactively authenticate a user with the default web browser
|[DeviceCodeCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DeviceCodeCredential)|Interactively authenticate a user on a device with limited UI
|[UsernamePasswordCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#UsernamePasswordCredential)|Authenticate a user with a username and password
### Authenticating via Development Tools
@ -169,7 +158,7 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
`DefaultAzureCredential` and `EnvironmentCredential` can be configured with environment variables. Each type of authentication requires values for specific variables:
#### Service principal with secret
### Service principal with secret
|variable name|value
|-|-
@ -177,7 +166,7 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
|`AZURE_TENANT_ID`|ID of the application's Microsoft Entra tenant
|`AZURE_CLIENT_SECRET`|one of the application's client secrets
#### Service principal with certificate
### Service principal with certificate
|variable name|value
|-|-
@ -186,16 +175,7 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
|`AZURE_CLIENT_CERTIFICATE_PATH`|path to a certificate file including private key
|`AZURE_CLIENT_CERTIFICATE_PASSWORD`|password of the certificate file, if any
#### Username and password
|variable name|value
|-|-
|`AZURE_CLIENT_ID`|ID of a Microsoft Entra application
|`AZURE_USERNAME`|a username (usually an email address)
|`AZURE_PASSWORD`|that user's password
Configuration is attempted in the above order. For example, if values for a
client secret and certificate are both present, the client secret will be used.
Configuration is attempted in the above order. For example, if values for a client secret and certificate are both present, the client secret will be used.
## Token caching
@ -260,4 +240,8 @@ For more information, see the
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
additional questions or comments.
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-go%2Fsdk%2Fazidentity%2FREADME.png)
<!-- LINKS -->
[ctc_overview]: https://aka.ms/azsdk/go/identity/credential-chains#chainedtokencredential-overview
[dac_overview]: https://aka.ms/azsdk/go/identity/credential-chains#defaultazurecredential-overview

View file

@ -22,13 +22,12 @@ Some credential types support opt-in persistent token caching (see [the below ta
Persistent caches are encrypted at rest using a mechanism that depends on the operating system:
| Operating system | Encryption facility |
|------------------|---------------------------------------|
| Linux | kernel key retention service (keyctl) |
| macOS | Keychain |
| Windows | Data Protection API (DPAPI) |
Persistent caching requires encryption. When the required encryption facility is unuseable, or the application is running on an unsupported OS, the persistent cache constructor returns an error. This doesn't mean that authentication is impossible, only that credentials can't persist authentication data and the application will need to reauthenticate the next time it runs. See the [package documentation][example] for example code showing how to configure persistent caching and access cached data.
| Operating system | Encryption facility | Limitations |
| ---------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Linux | kernel key retention service (keyctl) | Cache data is lost on system shutdown because kernel keys are stored in memory. Depending on kernel compile options, data may also be lost on logout, or storage may be impossible because the key retention service isn't available. |
| macOS | Keychain | Building requires cgo and native build tools. Keychain access requires a graphical session, so persistent caching isn't possible in a headless environment such as an SSH session (macOS as host). |
| Windows | Data Protection API (DPAPI) | No specific limitations. |
Persistent caching requires encryption. When the required encryption facility is unuseable, or the application is running on an unsupported OS, the persistent cache constructor returns an error. This doesn't mean that authentication is impossible, only that credentials can't persist authentication data and the application will need to reauthenticate the next time it runs. See the package documentation for examples showing how to configure persistent caching and access cached data for [users][user_example] and [service principals][sp_example].
### Credentials supporting token caching
@ -37,7 +36,7 @@ The following table indicates the state of in-memory and persistent caching in e
**Note:** in-memory caching is enabled by default for every type supporting it. Persistent token caching must be enabled explicitly. See the [package documentation][user_example] for an example showing how to do this for credential types authenticating users. For types that authenticate service principals, set the `Cache` field on the constructor's options as shown in [this example][sp_example].
| Credential | In-memory token caching | Persistent token caching |
|--------------------------------|---------------------------------------------------------------------|--------------------------|
| ------------------------------ | ------------------------------------------------------------------- | ------------------------ |
| `AzureCLICredential` | Not Supported | Not Supported |
| `AzureDeveloperCLICredential` | Not Supported | Not Supported |
| `AzurePipelinesCredential` | Supported | Supported |

View file

@ -8,6 +8,7 @@ This troubleshooting guide covers failure investigation techniques, common error
- [Permission issues](#permission-issues)
- [Find relevant information in errors](#find-relevant-information-in-errors)
- [Enable and configure logging](#enable-and-configure-logging)
- [Troubleshoot persistent token caching issues](#troubleshoot-persistent-token-caching-issues)
- [Troubleshoot AzureCLICredential authentication issues](#troubleshoot-azureclicredential-authentication-issues)
- [Troubleshoot AzureDeveloperCLICredential authentication issues](#troubleshoot-azuredeveloperclicredential-authentication-issues)
- [Troubleshoot AzurePipelinesCredential authentication issues](#troubleshoot-azurepipelinescredential-authentication-issues)
@ -236,6 +237,29 @@ azd auth token --output json --scope https://management.core.windows.net/.defaul
| No service connection found with identifier |The `serviceConnectionID` argument to `NewAzurePipelinesCredential` is incorrect| Verify the service connection ID. This parameter refers to the `resourceId` of the Azure Service Connection. It can also be found in the query string of the service connection's configuration in Azure DevOps. [Azure Pipelines documentation](https://learn.microsoft.com/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml) has more information about service connections.|
|401 (Unauthorized) response from OIDC endpoint|The `systemAccessToken` argument to `NewAzurePipelinesCredential` is incorrect|Check pipeline configuration. This value comes from the predefined variable `System.AccessToken` [as described in Azure Pipelines documentation](https://learn.microsoft.com/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#systemaccesstoken).|
## Troubleshoot persistent token caching issues
### macOS
[azidentity/cache](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache) encrypts persistent caches with the system Keychain on macOS. You may see build and runtime errors there because calling the Keychain API requires cgo and macOS prohibits Keychain access in some scenarios.
#### Build errors
Build errors about undefined `accessor` symbols indicate that cgo wasn't enabled. For example:
```
$ GOOS=darwin go build
# github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache
../../go/pkg/mod/github.com/!azure/azure-sdk-for-go/sdk/azidentity/cache@v0.3.0/darwin.go:18:19: undefined: accessor.New
../../go/pkg/mod/github.com/!azure/azure-sdk-for-go/sdk/azidentity/cache@v0.3.0/darwin.go:18:38: undefined: accessor.WithAccount
```
Try `go build` again with `CGO_ENABLED=1`. You may need to install native build tools.
#### Runtime errors
macOS prohibits Keychain access from environments without a GUI such as SSH sessions. If your application calls the persistent cache constructor ([cache.New](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache#New)) from an SSH session on a macOS host, you'll see an error like
`persistent storage isn't available due to error "User interaction is not allowed. (-25308)"`. This doesn't mean authentication is impossible, only that credentials can't persist data and the application must reauthenticate the next time it runs.
## Get additional help
Additional information on ways to reach out for support can be found in [SUPPORT.md](https://github.com/Azure/azure-sdk-for-go/blob/main/SUPPORT.md).

View file

@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/azidentity",
"Tag": "go/azidentity_c55452bbf6"
"Tag": "go/azidentity_191110b0dd"
}

View file

@ -22,6 +22,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/public"
)
@ -42,6 +43,8 @@ const (
developerSignOnClientID = "04b07795-8ddb-461a-bbee-02f9e1bf7b46"
defaultSuffix = "/.default"
scopeLogFmt = "%s.GetToken() acquired a token for scope %q"
traceNamespace = "Microsoft.Entra"
traceOpGetToken = "GetToken"
traceOpAuthenticate = "Authenticate"
@ -103,7 +106,16 @@ func resolveAdditionalTenants(tenants []string) []string {
return cp
}
// resolveTenant returns the correct tenant for a token request
// resolveTenant returns the correct tenant for a token request, or "" when the calling credential doesn't
// have an explicitly configured tenant and the caller didn't specify a tenant for the token request.
//
// - defaultTenant: tenant set when constructing the credential, if any. "" is valid for credentials
// having an optional or implicit tenant such as dev tool and interactive user credentials. Those
// default to the tool's configured tenant or the user's home tenant, respectively.
// - specified: tenant specified for this token request i.e., TokenRequestOptions.TenantID. May be "".
// - credName: name of the calling credential type; for error messages
// - additionalTenants: optional allow list of tenants the credential may acquire tokens from in
// addition to defaultTenant i.e., the credential's AdditionallyAllowedTenants option
func resolveTenant(defaultTenant, specified, credName string, additionalTenants []string) (string, error) {
if specified == "" || specified == defaultTenant {
return defaultTenant, nil
@ -119,6 +131,17 @@ func resolveTenant(defaultTenant, specified, credName string, additionalTenants
return specified, nil
}
}
if len(additionalTenants) == 0 {
switch defaultTenant {
case "", organizationsTenantID:
// The application didn't specify a tenant or allow list when constructing the credential. Allow the
// tenant specified for this token request because we have nothing to compare it to (i.e., it vacuously
// satisfies the credential's configuration); don't know whether the application is multitenant; and
// don't want to return an error in the common case that the specified tenant matches the credential's
// default tenant determined elsewhere e.g., in some dev tool's configuration.
return specified, nil
}
}
return "", fmt.Errorf(`%s isn't configured to acquire tokens for tenant %q. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to allow acquiring tokens for any tenant`, credName, specified)
}
@ -186,6 +209,10 @@ type msalConfidentialClient interface {
AcquireTokenOnBehalfOf(ctx context.Context, userAssertion string, scopes []string, options ...confidential.AcquireOnBehalfOfOption) (confidential.AuthResult, error)
}
type msalManagedIdentityClient interface {
AcquireToken(context.Context, string, ...managedidentity.AcquireTokenOption) (managedidentity.AuthResult, error)
}
// enables fakes for test scenarios
type msalPublicClient interface {
AcquireTokenSilent(ctx context.Context, scopes []string, options ...public.AcquireSilentOption) (public.AuthResult, error)

View file

@ -30,9 +30,9 @@ type azTokenProvider func(ctx context.Context, scopes []string, tenant, subscrip
// AzureCLICredentialOptions contains optional parameters for AzureCLICredential.
type AzureCLICredentialOptions struct {
// AdditionallyAllowedTenants specifies tenants for which the credential may acquire tokens, in addition
// to TenantID. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the
// logged in account can access.
// AdditionallyAllowedTenants specifies tenants to which the credential may authenticate, in addition to
// TenantID. When TenantID is empty, this option has no effect and the credential will authenticate to
// any requested tenant. Add the wildcard value "*" to allow the credential to authenticate to any tenant.
AdditionallyAllowedTenants []string
// Subscription is the name or ID of a subscription. Set this to acquire tokens for an account other
@ -70,7 +70,11 @@ func NewAzureCLICredential(options *AzureCLICredentialOptions) (*AzureCLICredent
}
for _, r := range cp.Subscription {
if !(alphanumeric(r) || r == '-' || r == '_' || r == ' ' || r == '.') {
return nil, fmt.Errorf("%s: invalid Subscription %q", credNameAzureCLI, cp.Subscription)
return nil, fmt.Errorf(
"%s: Subscription %q contains invalid characters. If this is the name of a subscription, use its ID instead",
credNameAzureCLI,
cp.Subscription,
)
}
}
if cp.TenantID != "" && !validTenantID(cp.TenantID) {

View file

@ -30,9 +30,9 @@ type azdTokenProvider func(ctx context.Context, scopes []string, tenant string)
// AzureDeveloperCLICredentialOptions contains optional parameters for AzureDeveloperCLICredential.
type AzureDeveloperCLICredentialOptions struct {
// AdditionallyAllowedTenants specifies tenants for which the credential may acquire tokens, in addition
// to TenantID. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the
// logged in account can access.
// AdditionallyAllowedTenants specifies tenants to which the credential may authenticate, in addition to
// TenantID. When TenantID is empty, this option has no effect and the credential will authenticate to
// any requested tenant. Add the wildcard value "*" to allow the credential to authenticate to any tenant.
AdditionallyAllowedTenants []string
// TenantID identifies the tenant the credential should authenticate in. Defaults to the azd environment,

View file

@ -27,7 +27,10 @@ type ChainedTokenCredentialOptions struct {
}
// ChainedTokenCredential links together multiple credentials and tries them sequentially when authenticating. By default,
// it tries all the credentials until one authenticates, after which it always uses that credential.
// it tries all the credentials until one authenticates, after which it always uses that credential. For more information,
// see [ChainedTokenCredential overview].
//
// [ChainedTokenCredential overview]: https://aka.ms/azsdk/go/identity/credential-chains#chainedtokencredential-overview
type ChainedTokenCredential struct {
cond *sync.Cond
iterating bool
@ -46,6 +49,9 @@ func NewChainedTokenCredential(sources []azcore.TokenCredential, options *Chaine
if source == nil { // cannot have a nil credential in the chain or else the application will panic when GetToken() is called on nil
return nil, errors.New("sources cannot contain nil")
}
if mc, ok := source.(*ManagedIdentityCredential); ok {
mc.mic.chained = true
}
}
cp := make([]azcore.TokenCredential, len(sources))
copy(cp, sources)

View file

@ -26,27 +26,16 @@ extends:
parameters:
CloudConfig:
Public:
ServiceConnection: azure-sdk-tests
SubscriptionConfigurationFilePaths:
- eng/common/TestResources/sub-config/AzurePublicMsft.json
SubscriptionConfigurations:
- $(sub-config-azure-cloud-test-resources)
- $(sub-config-identity-test-resources)
EnableRaceDetector: true
Location: westus2
RunLiveTests: true
ServiceDirectory: azidentity
UsePipelineProxy: false
${{ if endsWith(variables['Build.DefinitionName'], 'weekly') }}:
PreSteps:
- task: AzureCLI@2
displayName: Set OIDC token
inputs:
addSpnToEnvironment: true
azureSubscription: azure-sdk-tests
inlineScript: Write-Host "##vso[task.setvariable variable=OIDC_TOKEN;]$($env:idToken)"
scriptLocation: inlineScript
scriptType: pscore
PersistOidcToken: true
MatrixConfigs:
- Name: managed_identity_matrix
GenerateVMJobs: true

View file

@ -115,10 +115,10 @@ func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenReque
err = newAuthenticationFailedErrorFromMSAL(c.name, err)
}
} else {
msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", c.name, strings.Join(ar.GrantedScopes, ", "))
msg := fmt.Sprintf(scopeLogFmt, c.name, strings.Join(ar.GrantedScopes, ", "))
log.Write(EventAuthentication, msg)
}
return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err
return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC(), RefreshOn: ar.Metadata.RefreshOn.UTC()}, err
}
func (c *confidentialClient) client(tro policy.TokenRequestOptions) (msalConfidentialClient, *sync.Mutex, error) {

View file

@ -23,15 +23,19 @@ type DefaultAzureCredentialOptions struct {
// to credential types that authenticate via external tools such as the Azure CLI.
azcore.ClientOptions
// AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. Add
// the wildcard value "*" to allow the credential to acquire tokens for any tenant. This value can also be
// set as a semicolon delimited list of tenants in the environment variable AZURE_ADDITIONALLY_ALLOWED_TENANTS.
// AdditionallyAllowedTenants specifies tenants to which the credential may authenticate, in addition to
// TenantID. When TenantID is empty, this option has no effect and the credential will authenticate to
// any requested tenant. Add the wildcard value "*" to allow the credential to authenticate to any tenant.
// This value can also be set as a semicolon delimited list of tenants in the environment variable
// AZURE_ADDITIONALLY_ALLOWED_TENANTS.
AdditionallyAllowedTenants []string
// DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
// private clouds such as Azure Stack. It determines whether the credential requests Microsoft Entra instance metadata
// from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
// the application responsible for ensuring the configured authority is valid and trustworthy.
DisableInstanceDiscovery bool
// TenantID sets the default tenant for authentication via the Azure CLI and workload identity.
TenantID string
}
@ -39,7 +43,7 @@ type DefaultAzureCredentialOptions struct {
// DefaultAzureCredential simplifies authentication while developing applications that deploy to Azure by
// combining credentials used in Azure hosting environments and credentials used in local development. In
// production, it's better to use a specific credential type so authentication is more predictable and easier
// to debug.
// to debug. For more information, see [DefaultAzureCredential overview].
//
// DefaultAzureCredential attempts to authenticate with each of these credential types, in the following order,
// stopping when one provides a token:
@ -55,6 +59,8 @@ type DefaultAzureCredentialOptions struct {
// Consult the documentation for these credential types for more information on how they authenticate.
// Once a credential has successfully authenticated, DefaultAzureCredential will use that credential for
// every subsequent authentication.
//
// [DefaultAzureCredential overview]: https://aka.ms/azsdk/go/identity/credential-chains#defaultazurecredential-overview
type DefaultAzureCredential struct {
chain *ChainedTokenCredential
}

View file

@ -21,8 +21,9 @@ const credNameDeviceCode = "DeviceCodeCredential"
type DeviceCodeCredentialOptions struct {
azcore.ClientOptions
// AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire
// tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant.
// AdditionallyAllowedTenants specifies tenants to which the credential may authenticate, in addition to
// TenantID. When TenantID is empty, this option has no effect and the credential will authenticate to
// any requested tenant. Add the wildcard value "*" to allow the credential to authenticate to any tenant.
AdditionallyAllowedTenants []string
// AuthenticationRecord returned by a call to a credential's Authenticate method. Set this option

View file

@ -60,7 +60,10 @@ type EnvironmentCredentialOptions struct {
// Note that this credential uses [ParseCertificates] to load the certificate and key from the file. If this
// function isn't able to parse your certificate, use [ClientCertificateCredential] instead.
//
// # User with username and password
// # Deprecated: User with username and password
//
// User password authentication is deprecated because it can't support multifactor authentication. See
// [Entra ID documentation] for migration guidance.
//
// AZURE_TENANT_ID: (optional) tenant to authenticate in. Defaults to "organizations".
//
@ -75,6 +78,8 @@ type EnvironmentCredentialOptions struct {
// To enable multitenant authentication, set AZURE_ADDITIONALLY_ALLOWED_TENANTS with a semicolon delimited list of tenants
// the credential may request tokens from in addition to the tenant specified by AZURE_TENANT_ID. Set
// AZURE_ADDITIONALLY_ALLOWED_TENANTS to "*" to enable the credential to request a token from any tenant.
//
// [Entra ID documentation]: https://aka.ms/azsdk/identity/mfa
type EnvironmentCredential struct {
cred azcore.TokenCredential
}

View file

@ -1,4 +1,4 @@
go 1.18
go 1.23.0
use (
.

View file

@ -20,8 +20,9 @@ const credNameBrowser = "InteractiveBrowserCredential"
type InteractiveBrowserCredentialOptions struct {
azcore.ClientOptions
// AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire
// tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant.
// AdditionallyAllowedTenants specifies tenants to which the credential may authenticate, in addition to
// TenantID. When TenantID is empty, this option has no effect and the credential will authenticate to
// any requested tenant. Add the wildcard value "*" to allow the credential to authenticate to any tenant.
AdditionallyAllowedTenants []string
// AuthenticationRecord returned by a call to a credential's Authenticate method. Set this option

View file

@ -9,7 +9,7 @@
}
},
"GoVersion": [
"1.22.1"
"env:GO_VERSION_PREVIOUS"
],
"IDENTITY_IMDS_AVAILABLE": "1"
}

View file

@ -8,24 +8,18 @@ package azidentity
import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"net/url"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
"github.com/Azure/azure-sdk-for-go/sdk/internal/log"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
msalerrors "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity"
)
const (
@ -41,56 +35,20 @@ const (
msiResID = "msi_res_id"
msiSecret = "MSI_SECRET"
imdsAPIVersion = "2018-02-01"
azureArcAPIVersion = "2019-08-15"
azureArcAPIVersion = "2020-06-01"
qpClientID = "client_id"
serviceFabricAPIVersion = "2019-07-01-preview"
)
var imdsProbeTimeout = time.Second
type msiType int
const (
msiTypeAppService msiType = iota
msiTypeAzureArc
msiTypeAzureML
msiTypeCloudShell
msiTypeIMDS
msiTypeServiceFabric
)
type managedIdentityClient struct {
azClient *azcore.Client
endpoint string
id ManagedIDKind
msiType msiType
probeIMDS bool
}
// arcKeyDirectory returns the directory expected to contain Azure Arc keys
var arcKeyDirectory = func() (string, error) {
switch runtime.GOOS {
case "linux":
return "/var/opt/azcmagent/tokens", nil
case "windows":
pd := os.Getenv("ProgramData")
if pd == "" {
return "", errors.New("environment variable ProgramData has no value")
}
return filepath.Join(pd, "AzureConnectedMachineAgent", "Tokens"), nil
default:
return "", fmt.Errorf("unsupported OS %q", runtime.GOOS)
}
}
type wrappedNumber json.Number
func (n *wrappedNumber) UnmarshalJSON(b []byte) error {
c := string(b)
if c == "\"\"" {
return nil
}
return json.Unmarshal(b, (*json.Number)(n))
azClient *azcore.Client
imds, probeIMDS, userAssigned bool
// chained indicates whether the client is part of a credential chain. If true, the client will return
// a credentialUnavailableError instead of an AuthenticationFailedError for an unexpected IMDS response.
chained bool
msalClient msalManagedIdentityClient
}
// setIMDSRetryOptionDefaults sets zero-valued fields to default values appropriate for IMDS
@ -138,51 +96,20 @@ func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*manag
options = &ManagedIdentityCredentialOptions{}
}
cp := options.ClientOptions
c := managedIdentityClient{id: options.ID, endpoint: imdsEndpoint, msiType: msiTypeIMDS}
env := "IMDS"
if endpoint, ok := os.LookupEnv(identityEndpoint); ok {
if _, ok := os.LookupEnv(identityHeader); ok {
if _, ok := os.LookupEnv(identityServerThumbprint); ok {
if options.ID != nil {
return nil, errors.New("the Service Fabric API doesn't support specifying a user-assigned managed identity at runtime")
}
env = "Service Fabric"
c.endpoint = endpoint
c.msiType = msiTypeServiceFabric
} else {
env = "App Service"
c.endpoint = endpoint
c.msiType = msiTypeAppService
}
} else if _, ok := os.LookupEnv(arcIMDSEndpoint); ok {
if options.ID != nil {
return nil, errors.New("the Azure Arc API doesn't support specifying a user-assigned managed identity at runtime")
}
env = "Azure Arc"
c.endpoint = endpoint
c.msiType = msiTypeAzureArc
}
} else if endpoint, ok := os.LookupEnv(msiEndpoint); ok {
c.endpoint = endpoint
if _, ok := os.LookupEnv(msiSecret); ok {
if options.ID != nil && options.ID.idKind() != miClientID {
return nil, errors.New("the Azure ML API supports specifying a user-assigned managed identity by client ID only")
}
env = "Azure ML"
c.msiType = msiTypeAzureML
} else {
if options.ID != nil {
return nil, errors.New("the Cloud Shell API doesn't support user-assigned managed identities")
}
env = "Cloud Shell"
c.msiType = msiTypeCloudShell
}
} else {
c := managedIdentityClient{}
source, err := managedidentity.GetSource()
if err != nil {
return nil, err
}
env := string(source)
if source == managedidentity.DefaultToIMDS {
env = "IMDS"
c.imds = true
c.probeIMDS = options.dac
setIMDSRetryOptionDefaults(&cp.Retry)
}
client, err := azcore.NewClient(module, version, azruntime.PipelineOptions{
c.azClient, err = azcore.NewClient(module, version, azruntime.PipelineOptions{
Tracing: azruntime.TracingOptions{
Namespace: traceNamespace,
},
@ -190,77 +117,95 @@ func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*manag
if err != nil {
return nil, err
}
c.azClient = client
id := managedidentity.SystemAssigned()
if options.ID != nil {
c.userAssigned = true
switch s := options.ID.String(); options.ID.idKind() {
case miClientID:
id = managedidentity.UserAssignedClientID(s)
case miObjectID:
id = managedidentity.UserAssignedObjectID(s)
case miResourceID:
id = managedidentity.UserAssignedResourceID(s)
}
}
msalClient, err := managedidentity.New(id, managedidentity.WithHTTPClient(&c), managedidentity.WithRetryPolicyDisabled())
if err != nil {
return nil, err
}
c.msalClient = &msalClient
if log.Should(EventAuthentication) {
log.Writef(EventAuthentication, "Managed Identity Credential will use %s managed identity", env)
msg := fmt.Sprintf("%s will use %s managed identity", credNameManagedIdentity, env)
if options.ID != nil {
kind := "client"
switch options.ID.(type) {
case ObjectID:
kind = "object"
case ResourceID:
kind = "resource"
}
msg += fmt.Sprintf(" with %s ID %q", kind, options.ID.String())
}
log.Write(EventAuthentication, msg)
}
return &c, nil
}
// provideToken acquires a token for MSAL's confidential.Client, which caches the token
func (c *managedIdentityClient) provideToken(ctx context.Context, params confidential.TokenProviderParameters) (confidential.TokenProviderResult, error) {
result := confidential.TokenProviderResult{}
tk, err := c.authenticate(ctx, c.id, params.Scopes)
if err == nil {
result.AccessToken = tk.Token
result.ExpiresInSeconds = int(time.Until(tk.ExpiresOn).Seconds())
}
return result, err
func (*managedIdentityClient) CloseIdleConnections() {
// do nothing
}
func (c *managedIdentityClient) Do(r *http.Request) (*http.Response, error) {
return doForClient(c.azClient, r)
}
// authenticate acquires an access token
func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKind, scopes []string) (azcore.AccessToken, error) {
func (c *managedIdentityClient) GetToken(ctx context.Context, tro policy.TokenRequestOptions) (azcore.AccessToken, error) {
// no need to synchronize around this value because it's true only when DefaultAzureCredential constructed the client,
// and in that case ChainedTokenCredential.GetToken synchronizes goroutines that would execute this block
if c.probeIMDS {
// send a malformed request (no Metadata header) to IMDS to determine whether the endpoint is available
cx, cancel := context.WithTimeout(ctx, imdsProbeTimeout)
defer cancel()
cx = policy.WithRetryOptions(cx, policy.RetryOptions{MaxRetries: -1})
req, err := azruntime.NewRequest(cx, http.MethodGet, c.endpoint)
req, err := azruntime.NewRequest(cx, http.MethodGet, imdsEndpoint)
if err != nil {
return azcore.AccessToken{}, fmt.Errorf("failed to create IMDS probe request: %s", err)
}
res, err := c.azClient.Pipeline().Do(req)
if err != nil {
if _, err = c.azClient.Pipeline().Do(req); err != nil {
msg := err.Error()
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
msg = "managed identity timed out. See https://aka.ms/azsdk/go/identity/troubleshoot#dac for more information"
}
return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, msg)
}
// because IMDS always responds with JSON, assume a non-JSON response is from something else, such
// as a proxy, and return credentialUnavailableError so DefaultAzureCredential continues iterating
b, err := azruntime.Payload(res)
if err != nil {
return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, fmt.Sprintf("failed to read IMDS probe response: %s", err))
}
if !json.Valid(b) {
return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, "unexpected response to IMDS probe")
}
// send normal token requests from now on because IMDS responded
// send normal token requests from now on because something responded
c.probeIMDS = false
}
msg, err := c.createAuthRequest(ctx, id, scopes)
if err != nil {
return azcore.AccessToken{}, err
ar, err := c.msalClient.AcquireToken(ctx, tro.Scopes[0], managedidentity.WithClaims(tro.Claims))
if err == nil {
msg := fmt.Sprintf(scopeLogFmt, credNameManagedIdentity, strings.Join(ar.GrantedScopes, ", "))
log.Write(EventAuthentication, msg)
return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC(), RefreshOn: ar.Metadata.RefreshOn.UTC()}, err
}
resp, err := c.azClient.Pipeline().Do(msg)
if err != nil {
return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, err.Error(), nil)
}
if azruntime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) {
return c.createAccessToken(resp)
}
if c.msiType == msiTypeIMDS {
if c.imds {
var ije msalerrors.InvalidJsonErr
if c.chained && errors.As(err, &ije) {
// an unmarshaling error implies the response is from something other than IMDS such as a proxy listening at
// the same address. Return a credentialUnavailableError so credential chains continue to their next credential
return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, err.Error())
}
resp := getResponseFromError(err)
if resp == nil {
return azcore.AccessToken{}, newAuthenticationFailedErrorFromMSAL(credNameManagedIdentity, err)
}
switch resp.StatusCode {
case http.StatusBadRequest:
if id != nil {
if c.userAssigned {
return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "the requested identity isn't assigned to this resource", resp)
}
msg := "failed to authenticate a system assigned identity"
@ -277,229 +222,6 @@ func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKi
}
}
}
return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "", resp)
}
func (c *managedIdentityClient) createAccessToken(res *http.Response) (azcore.AccessToken, error) {
value := struct {
// these are the only fields that we use
Token string `json:"access_token,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
ExpiresIn wrappedNumber `json:"expires_in,omitempty"` // this field should always return the number of seconds for which a token is valid
ExpiresOn interface{} `json:"expires_on,omitempty"` // the value returned in this field varies between a number and a date string
}{}
if err := azruntime.UnmarshalAsJSON(res, &value); err != nil {
return azcore.AccessToken{}, fmt.Errorf("internal AccessToken: %v", err)
}
if value.ExpiresIn != "" {
expiresIn, err := json.Number(value.ExpiresIn).Int64()
if err != nil {
return azcore.AccessToken{}, err
}
return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Now().Add(time.Second * time.Duration(expiresIn)).UTC()}, nil
}
switch v := value.ExpiresOn.(type) {
case float64:
return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Unix(int64(v), 0).UTC()}, nil
case string:
if expiresOn, err := strconv.Atoi(v); err == nil {
return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Unix(int64(expiresOn), 0).UTC()}, nil
}
return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "unexpected expires_on value: "+v, res)
default:
msg := fmt.Sprintf("unsupported type received in expires_on: %T, %v", v, v)
return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, msg, res)
}
}
func (c *managedIdentityClient) createAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
switch c.msiType {
case msiTypeIMDS:
return c.createIMDSAuthRequest(ctx, id, scopes)
case msiTypeAppService:
return c.createAppServiceAuthRequest(ctx, id, scopes)
case msiTypeAzureArc:
// need to perform preliminary request to retreive the secret key challenge provided by the HIMDS service
key, err := c.getAzureArcSecretKey(ctx, scopes)
if err != nil {
msg := fmt.Sprintf("failed to retreive secret key from the identity endpoint: %v", err)
return nil, newAuthenticationFailedError(credNameManagedIdentity, msg, nil)
}
return c.createAzureArcAuthRequest(ctx, scopes, key)
case msiTypeAzureML:
return c.createAzureMLAuthRequest(ctx, id, scopes)
case msiTypeServiceFabric:
return c.createServiceFabricAuthRequest(ctx, scopes)
case msiTypeCloudShell:
return c.createCloudShellAuthRequest(ctx, scopes)
default:
return nil, newCredentialUnavailableError(credNameManagedIdentity, "managed identity isn't supported in this environment")
}
}
func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return nil, err
}
request.Raw().Header.Set(headerMetadata, "true")
q := request.Raw().URL.Query()
q.Set("api-version", imdsAPIVersion)
q.Set("resource", strings.Join(scopes, " "))
if id != nil {
switch id.idKind() {
case miClientID:
q.Set(qpClientID, id.String())
case miObjectID:
q.Set("object_id", id.String())
case miResourceID:
q.Set(msiResID, id.String())
}
}
request.Raw().URL.RawQuery = q.Encode()
return request, nil
}
func (c *managedIdentityClient) createAppServiceAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return nil, err
}
request.Raw().Header.Set("X-IDENTITY-HEADER", os.Getenv(identityHeader))
q := request.Raw().URL.Query()
q.Set("api-version", "2019-08-01")
q.Set("resource", scopes[0])
if id != nil {
switch id.idKind() {
case miClientID:
q.Set(qpClientID, id.String())
case miObjectID:
q.Set("principal_id", id.String())
case miResourceID:
q.Set(miResID, id.String())
}
}
request.Raw().URL.RawQuery = q.Encode()
return request, nil
}
func (c *managedIdentityClient) createAzureMLAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return nil, err
}
request.Raw().Header.Set("secret", os.Getenv(msiSecret))
q := request.Raw().URL.Query()
q.Set("api-version", "2017-09-01")
q.Set("resource", strings.Join(scopes, " "))
q.Set("clientid", os.Getenv(defaultIdentityClientID))
if id != nil {
switch id.idKind() {
case miClientID:
q.Set("clientid", id.String())
case miObjectID:
return nil, newAuthenticationFailedError(credNameManagedIdentity, "Azure ML doesn't support specifying a managed identity by object ID", nil)
case miResourceID:
return nil, newAuthenticationFailedError(credNameManagedIdentity, "Azure ML doesn't support specifying a managed identity by resource ID", nil)
}
}
request.Raw().URL.RawQuery = q.Encode()
return request, nil
}
func (c *managedIdentityClient) createServiceFabricAuthRequest(ctx context.Context, scopes []string) (*policy.Request, error) {
request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return nil, err
}
q := request.Raw().URL.Query()
request.Raw().Header.Set("Accept", "application/json")
request.Raw().Header.Set("Secret", os.Getenv(identityHeader))
q.Set("api-version", serviceFabricAPIVersion)
q.Set("resource", strings.Join(scopes, " "))
request.Raw().URL.RawQuery = q.Encode()
return request, nil
}
func (c *managedIdentityClient) getAzureArcSecretKey(ctx context.Context, resources []string) (string, error) {
// create the request to retreive the secret key challenge provided by the HIMDS service
request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return "", err
}
request.Raw().Header.Set(headerMetadata, "true")
q := request.Raw().URL.Query()
q.Set("api-version", azureArcAPIVersion)
q.Set("resource", strings.Join(resources, " "))
request.Raw().URL.RawQuery = q.Encode()
// send the initial request to get the short-lived secret key
response, err := c.azClient.Pipeline().Do(request)
if err != nil {
return "", err
}
// the endpoint is expected to return a 401 with the WWW-Authenticate header set to the location
// of the secret key file. Any other status code indicates an error in the request.
if response.StatusCode != 401 {
msg := fmt.Sprintf("expected a 401 response, received %d", response.StatusCode)
return "", newAuthenticationFailedError(credNameManagedIdentity, msg, response)
}
header := response.Header.Get("WWW-Authenticate")
if len(header) == 0 {
return "", newAuthenticationFailedError(credNameManagedIdentity, "HIMDS response has no WWW-Authenticate header", nil)
}
// the WWW-Authenticate header is expected in the following format: Basic realm=/some/file/path.key
_, p, found := strings.Cut(header, "=")
if !found {
return "", newAuthenticationFailedError(credNameManagedIdentity, "unexpected WWW-Authenticate header from HIMDS: "+header, nil)
}
expected, err := arcKeyDirectory()
if err != nil {
return "", err
}
if filepath.Dir(p) != expected || !strings.HasSuffix(p, ".key") {
return "", newAuthenticationFailedError(credNameManagedIdentity, "unexpected file path from HIMDS service: "+p, nil)
}
f, err := os.Stat(p)
if err != nil {
return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("could not stat %q: %v", p, err), nil)
}
if s := f.Size(); s > 4096 {
return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("key is too large (%d bytes)", s), nil)
}
key, err := os.ReadFile(p)
if err != nil {
return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("could not read %q: %v", p, err), nil)
}
return string(key), nil
}
func (c *managedIdentityClient) createAzureArcAuthRequest(ctx context.Context, resources []string, key string) (*policy.Request, error) {
request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint)
if err != nil {
return nil, err
}
request.Raw().Header.Set(headerMetadata, "true")
request.Raw().Header.Set("Authorization", fmt.Sprintf("Basic %s", key))
q := request.Raw().URL.Query()
q.Set("api-version", azureArcAPIVersion)
q.Set("resource", strings.Join(resources, " "))
request.Raw().URL.RawQuery = q.Encode()
return request, nil
}
func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context, scopes []string) (*policy.Request, error) {
request, err := azruntime.NewRequest(ctx, http.MethodPost, c.endpoint)
if err != nil {
return nil, err
}
request.Raw().Header.Set(headerMetadata, "true")
data := url.Values{}
data.Set("resource", strings.Join(scopes, " "))
dataEncoded := data.Encode()
body := streaming.NopCloser(strings.NewReader(dataEncoded))
if err := request.SetBody(body, "application/x-www-form-urlencoded"); err != nil {
return nil, err
}
return request, nil
err = newAuthenticationFailedErrorFromMSAL(credNameManagedIdentity, err)
return azcore.AccessToken{}, err
}

View file

@ -14,7 +14,6 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
)
const credNameManagedIdentity = "ManagedIdentityCredential"
@ -110,8 +109,7 @@ type ManagedIdentityCredentialOptions struct {
//
// [Azure managed identity]: https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview
type ManagedIdentityCredential struct {
client *confidentialClient
mic *managedIdentityClient
mic *managedIdentityClient
}
// NewManagedIdentityCredential creates a ManagedIdentityCredential. Pass nil to accept default options.
@ -123,38 +121,22 @@ func NewManagedIdentityCredential(options *ManagedIdentityCredentialOptions) (*M
if err != nil {
return nil, err
}
cred := confidential.NewCredFromTokenProvider(mic.provideToken)
// It's okay to give MSAL an invalid client ID because MSAL will use it only as part of a cache key.
// ManagedIdentityClient handles all the details of authentication and won't receive this value from MSAL.
clientID := "SYSTEM-ASSIGNED-MANAGED-IDENTITY"
if options.ID != nil {
clientID = options.ID.String()
}
// similarly, it's okay to give MSAL an incorrect tenant because MSAL won't use the value
c, err := newConfidentialClient("common", clientID, credNameManagedIdentity, cred, confidentialClientOptions{
ClientOptions: options.ClientOptions,
})
if err != nil {
return nil, err
}
return &ManagedIdentityCredential{client: c, mic: mic}, nil
return &ManagedIdentityCredential{mic: mic}, nil
}
// GetToken requests an access token from the hosting environment. This method is called automatically by Azure SDK clients.
func (c *ManagedIdentityCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
var err error
ctx, endSpan := runtime.StartSpan(ctx, credNameManagedIdentity+"."+traceOpGetToken, c.client.azClient.Tracer(), nil)
ctx, endSpan := runtime.StartSpan(ctx, credNameManagedIdentity+"."+traceOpGetToken, c.mic.azClient.Tracer(), nil)
defer func() { endSpan(err) }()
if len(opts.Scopes) != 1 {
err = fmt.Errorf("%s.GetToken() requires exactly one scope", credNameManagedIdentity)
return azcore.AccessToken{}, err
}
// managed identity endpoints require a Microsoft Entra ID v1 resource (i.e. token audience), not a v2 scope, so we remove "/.default" here
// managed identity endpoints require a v1 resource (i.e. token audience), not a v2 scope, so we remove "/.default" here
opts.Scopes = []string{strings.TrimSuffix(opts.Scopes[0], defaultSuffix)}
tk, err := c.client.GetToken(ctx, opts)
return tk, err
return c.mic.GetToken(ctx, opts)
}
var _ azcore.TokenCredential = (*ManagedIdentityCredential)(nil)

View file

@ -154,12 +154,7 @@ func (p *publicClient) GetToken(ctx context.Context, tro policy.TokenRequestOpti
if p.opts.DisableAutomaticAuthentication {
return azcore.AccessToken{}, newAuthenticationRequiredError(p.name, tro)
}
at, err := p.reqToken(ctx, client, tro)
if err == nil {
msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", p.name, strings.Join(ar.GrantedScopes, ", "))
log.Write(EventAuthentication, msg)
}
return at, err
return p.reqToken(ctx, client, tro)
}
// reqToken requests a token from the MSAL public client. It's separate from GetToken() to enable Authenticate() to bypass the cache.
@ -242,11 +237,13 @@ func (p *publicClient) newMSALClient(enableCAE bool) (msalPublicClient, error) {
func (p *publicClient) token(ar public.AuthResult, err error) (azcore.AccessToken, error) {
if err == nil {
msg := fmt.Sprintf(scopeLogFmt, p.name, strings.Join(ar.GrantedScopes, ", "))
log.Write(EventAuthentication, msg)
p.record, err = newAuthenticationRecord(ar)
} else {
err = newAuthenticationFailedErrorFromMSAL(p.name, err)
}
return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err
return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC(), RefreshOn: ar.Metadata.RefreshOn.UTC()}, err
}
// resolveTenant returns the correct WithTenantID() argument for a token request given the client's

View file

@ -7,6 +7,10 @@ param (
[hashtable] $AdditionalParameters = @{},
[hashtable] $DeploymentOutputs,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string] $SubscriptionId,
[Parameter(ParameterSetName = 'Provisioner', Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string] $TenantId,
@ -15,6 +19,10 @@ param (
[ValidatePattern('^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$')]
[string] $TestApplicationId,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string] $Environment,
# Captures any arguments from eng/New-TestResources.ps1 not declared here (no parameter errors).
[Parameter(ValueFromRemainingArguments = $true)]
$RemainingArguments
@ -28,8 +36,9 @@ if ($CI) {
Write-Host "Skipping post-provisioning script because resources weren't deployed"
return
}
az login --federated-token $env:OIDC_TOKEN --service-principal -t $TenantId -u $TestApplicationId
az account set --subscription $DeploymentOutputs['AZIDENTITY_SUBSCRIPTION_ID']
az cloud set -n $Environment
az login --federated-token $env:ARM_OIDC_TOKEN --service-principal -t $TenantId -u $TestApplicationId
az account set --subscription $SubscriptionId
}
Write-Host "Building container"
@ -62,6 +71,10 @@ $aciName = "azidentity-test"
az container create -g $rg -n $aciName --image $image `
--acr-identity $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) `
--assign-identity [system] $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) `
--cpu 1 `
--ip-address Public `
--memory 1.0 `
--os-type Linux `
--role "Storage Blob Data Reader" `
--scope $($DeploymentOutputs['AZIDENTITY_STORAGE_ID']) `
-e AZIDENTITY_STORAGE_NAME=$($DeploymentOutputs['AZIDENTITY_STORAGE_NAME']) `
@ -70,7 +83,8 @@ az container create -g $rg -n $aciName --image $image `
AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID']) `
AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID']) `
FUNCTIONS_CUSTOMHANDLER_PORT=80
Write-Host "##vso[task.setvariable variable=AZIDENTITY_ACI_NAME;]$aciName"
$aciIP = az container show -g $rg -n $aciName --query ipAddress.ip --output tsv
Write-Host "##vso[task.setvariable variable=AZIDENTITY_ACI_IP;]$aciIP"
# Azure Functions deployment: copy the Windows binary from the Docker image, deploy it in a zip
Write-Host "Deploying to Azure Functions"

View file

@ -17,6 +17,11 @@ import (
const credNameUserPassword = "UsernamePasswordCredential"
// UsernamePasswordCredentialOptions contains optional parameters for UsernamePasswordCredential.
//
// Deprecated: UsernamePasswordCredential is deprecated because it can't support multifactor
// authentication. See [Entra ID documentation] for migration guidance.
//
// [Entra ID documentation]: https://aka.ms/azsdk/identity/mfa
type UsernamePasswordCredentialOptions struct {
azcore.ClientOptions
@ -43,8 +48,13 @@ type UsernamePasswordCredentialOptions struct {
// UsernamePasswordCredential authenticates a user with a password. Microsoft doesn't recommend this kind of authentication,
// because it's less secure than other authentication flows. This credential is not interactive, so it isn't compatible
// with any form of multi-factor authentication, and the application must already have user or admin consent.
// with any form of multifactor authentication, and the application must already have user or admin consent.
// This credential can only authenticate work and school accounts; it can't authenticate Microsoft accounts.
//
// Deprecated: this credential is deprecated because it can't support multifactor authentication. See [Entra ID documentation]
// for migration guidance.
//
// [Entra ID documentation]: https://aka.ms/azsdk/identity/mfa
type UsernamePasswordCredential struct {
client *publicClient
}

View file

@ -14,5 +14,5 @@ const (
module = "github.com/Azure/azure-sdk-for-go/sdk/" + component
// Version is the semantic version (see http://semver.org) of this module.
version = "v1.8.0"
version = "v1.9.0"
)

View file

@ -44,7 +44,7 @@ func Should(cls Event) bool {
if log.lst == nil {
return false
}
if log.cls == nil || len(log.cls) == 0 {
if len(log.cls) == 0 {
return true
}
for _, c := range log.cls {

View file

@ -11,9 +11,17 @@ import (
"time"
)
// backoff sets a minimum wait time between eager update attempts. It's a variable so tests can manipulate it.
var backoff = func(now, lastAttempt time.Time) bool {
return lastAttempt.Add(30 * time.Second).After(now)
}
// AcquireResource abstracts a method for refreshing a temporal resource.
type AcquireResource[TResource, TState any] func(state TState) (newResource TResource, newExpiration time.Time, err error)
// ShouldRefresh abstracts a method for indicating whether a resource should be refreshed before expiration.
type ShouldRefresh[TResource, TState any] func(TResource, TState) bool
// Resource is a temporal resource (usually a credential) that requires periodic refreshing.
type Resource[TResource, TState any] struct {
// cond is used to synchronize access to the shared resource embodied by the remaining fields
@ -31,24 +39,43 @@ type Resource[TResource, TState any] struct {
// lastAttempt indicates when a thread/goroutine last attempted to acquire/update the resource
lastAttempt time.Time
// shouldRefresh indicates whether the resource should be refreshed before expiration
shouldRefresh ShouldRefresh[TResource, TState]
// acquireResource is the callback function that actually acquires the resource
acquireResource AcquireResource[TResource, TState]
}
// NewResource creates a new Resource that uses the specified AcquireResource for refreshing.
func NewResource[TResource, TState any](ar AcquireResource[TResource, TState]) *Resource[TResource, TState] {
return &Resource[TResource, TState]{cond: sync.NewCond(&sync.Mutex{}), acquireResource: ar}
r := &Resource[TResource, TState]{acquireResource: ar, cond: sync.NewCond(&sync.Mutex{})}
r.shouldRefresh = r.expiringSoon
return r
}
// ResourceOptions contains optional configuration for Resource
type ResourceOptions[TResource, TState any] struct {
// ShouldRefresh indicates whether [Resource.Get] should acquire an updated resource despite
// the currently held resource not having expired. [Resource.Get] ignores all errors from
// refresh attempts triggered by ShouldRefresh returning true, and doesn't call ShouldRefresh
// when the resource has expired (it unconditionally updates expired resources). When
// ShouldRefresh is nil, [Resource.Get] refreshes the resource if it will expire within 5
// minutes.
ShouldRefresh ShouldRefresh[TResource, TState]
}
// NewResourceWithOptions creates a new Resource that uses the specified AcquireResource for refreshing.
func NewResourceWithOptions[TResource, TState any](ar AcquireResource[TResource, TState], opts ResourceOptions[TResource, TState]) *Resource[TResource, TState] {
r := NewResource(ar)
if opts.ShouldRefresh != nil {
r.shouldRefresh = opts.ShouldRefresh
}
return r
}
// Get returns the underlying resource.
// If the resource is fresh, no refresh is performed.
func (er *Resource[TResource, TState]) Get(state TState) (TResource, error) {
// If the resource is expiring within this time window, update it eagerly.
// This allows other threads/goroutines to keep running by using the not-yet-expired
// resource value while one thread/goroutine updates the resource.
const window = 5 * time.Minute // This example updates the resource 5 minutes prior to expiration
const backoff = 30 * time.Second // Minimum wait time between eager update attempts
now, acquire, expired := time.Now(), false, false
// acquire exclusive lock
@ -65,9 +92,8 @@ func (er *Resource[TResource, TState]) Get(state TState) (TResource, error) {
break
}
// Getting here means that this thread/goroutine will wait for the updated resource
} else if er.expiration.Add(-window).Before(now) {
// The resource is valid but is expiring within the time window
if !er.acquiring && er.lastAttempt.Add(backoff).Before(now) {
} else if er.shouldRefresh(resource, state) {
if !(er.acquiring || backoff(now, er.lastAttempt)) {
// If another thread/goroutine is not acquiring/renewing the resource, and none has attempted
// to do so within the last 30 seconds, this thread/goroutine will do it
er.acquiring, acquire = true, true
@ -121,3 +147,8 @@ func (er *Resource[TResource, TState]) Expire() {
// Reset the expiration as if we never got this resource to begin with
er.expiration = time.Time{}
}
func (er *Resource[TResource, TState]) expiringSoon(TResource, TState) bool {
// call time.Now() instead of using Get's value so ShouldRefresh doesn't need a time.Time parameter
return er.expiration.Add(-5 * time.Minute).Before(time.Now())
}

View file

@ -1,5 +1,32 @@
# Release History
## 1.8.0 (2025-04-08)
### Features Added
- New value `ProvisioningStateAccepted` added to enum type `ProvisioningState`
## 1.7.0 (2025-02-27)
### Features Added
- New value `SKUNamePremiumV2LRS`, `SKUNamePremiumV2ZRS`, `SKUNameStandardV2GRS`, `SKUNameStandardV2GZRS`, `SKUNameStandardV2LRS`, `SKUNameStandardV2ZRS` added to enum type `SKUName`
- New function `*FileServicesClient.GetServiceUsage(context.Context, string, string, *FileServicesClientGetServiceUsageOptions) (FileServicesClientGetServiceUsageResponse, error)`
- New function `*FileServicesClient.NewListServiceUsagesPager(string, string, *FileServicesClientListServiceUsagesOptions) *runtime.Pager[FileServicesClientListServiceUsagesResponse]`
- New struct `AccountLimits`
- New struct `AccountUsage`
- New struct `AccountUsageElements`
- New struct `BurstingConstants`
- New struct `FileServiceUsage`
- New struct `FileServiceUsageProperties`
- New struct `FileServiceUsages`
- New struct `FileShareLimits`
- New struct `FileSharePropertiesFileSharePaidBursting`
- New struct `FileShareRecommendations`
- New struct `ObjectReplicationPolicyPropertiesMetrics`
- New field `FileSharePaidBursting`, `IncludedBurstIops`, `MaxBurstCreditsForIops`, `NextAllowedProvisionedBandwidthDowngradeTime`, `NextAllowedProvisionedIopsDowngradeTime`, `NextAllowedQuotaDowngradeTime`, `ProvisionedBandwidthMibps`, `ProvisionedIops` in struct `FileShareProperties`
- New field `Metrics` in struct `ObjectReplicationPolicyProperties`
## 1.6.0 (2024-06-28)
### Features Added

View file

@ -1,7 +1,5 @@
# Azure Storage Module for Go
[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage)
The `armstorage` module provides operations for working with Azure Storage.
[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/storage/armstorage)
@ -11,7 +9,7 @@ The `armstorage` module provides operations for working with Azure Storage.
## Prerequisites
- an [Azure subscription](https://azure.microsoft.com/free/)
- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).)
- [Supported](https://aka.ms/azsdk/go/supported-versions) version of Go (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).)
## Install the package
@ -25,7 +23,7 @@ go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage
## Authorization
When creating a client, you will need to provide a credential for authenticating with Azure Storage. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
When creating a client, you will need to provide a credential for authenticating with Azure Storage. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
```go
cred, err := azidentity.NewDefaultAzureCredential(nil)
@ -54,7 +52,7 @@ clientFactory, err := armstorage.NewClientFactory(<subscription ID>, cred, &opti
## Clients
A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.
A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.
```go
client := clientFactory.NewAccountsClient()
@ -99,4 +97,4 @@ This project has adopted the
For more information, see the
[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
additional questions or comments.
additional questions or comments.

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential,
// BeginAbortHierarchicalNamespaceMigration - Abort live Migration of storage account to enable Hns
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -73,7 +70,7 @@ func (client *AccountsClient) BeginAbortHierarchicalNamespaceMigration(ctx conte
// AbortHierarchicalNamespaceMigration - Abort live Migration of storage account to enable Hns
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *AccountsClient) abortHierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*http.Response, error) {
var err error
const operationName = "AccountsClient.BeginAbortHierarchicalNamespaceMigration"
@ -96,7 +93,7 @@ func (client *AccountsClient) abortHierarchicalNamespaceMigration(ctx context.Co
}
// abortHierarchicalNamespaceMigrationCreateRequest creates the AbortHierarchicalNamespaceMigration request.
func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*policy.Request, error) {
func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -115,7 +112,7 @@ func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(c
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -124,7 +121,7 @@ func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(c
// CheckNameAvailability - Checks that the storage account name is valid and is not already in use.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - 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.
// - options - AccountsClientCheckNameAvailabilityOptions contains the optional parameters for the AccountsClient.CheckNameAvailability
@ -152,7 +149,7 @@ func (client *AccountsClient) CheckNameAvailability(ctx context.Context, account
}
// checkNameAvailabilityCreateRequest creates the CheckNameAvailability request.
func (client *AccountsClient) checkNameAvailabilityCreateRequest(ctx context.Context, accountName AccountCheckNameAvailabilityParameters, options *AccountsClientCheckNameAvailabilityOptions) (*policy.Request, error) {
func (client *AccountsClient) checkNameAvailabilityCreateRequest(ctx context.Context, accountName AccountCheckNameAvailabilityParameters, _ *AccountsClientCheckNameAvailabilityOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -163,7 +160,7 @@ func (client *AccountsClient) checkNameAvailabilityCreateRequest(ctx context.Con
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, accountName); err != nil {
@ -187,7 +184,7 @@ func (client *AccountsClient) checkNameAvailabilityHandleResponse(resp *http.Res
// set of properties, the request will succeed.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -216,7 +213,7 @@ func (client *AccountsClient) BeginCreate(ctx context.Context, resourceGroupName
// set of properties, the request will succeed.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *AccountsClient) create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountsClientBeginCreateOptions) (*http.Response, error) {
var err error
const operationName = "AccountsClient.BeginCreate"
@ -239,7 +236,7 @@ func (client *AccountsClient) create(ctx context.Context, resourceGroupName stri
}
// createCreateRequest creates the Create request.
func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountsClientBeginCreateOptions) (*policy.Request, error) {
func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, _ *AccountsClientBeginCreateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -258,7 +255,7 @@ func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceG
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
@ -273,7 +270,7 @@ func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceG
// synchronously across three Azure availability zones in the primary region.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -304,7 +301,7 @@ func (client *AccountsClient) BeginCustomerInitiatedMigration(ctx context.Contex
// synchronously across three Azure availability zones in the primary region.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *AccountsClient) customerInitiatedMigration(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, options *AccountsClientBeginCustomerInitiatedMigrationOptions) (*http.Response, error) {
var err error
const operationName = "AccountsClient.BeginCustomerInitiatedMigration"
@ -327,7 +324,7 @@ func (client *AccountsClient) customerInitiatedMigration(ctx context.Context, re
}
// customerInitiatedMigrationCreateRequest creates the CustomerInitiatedMigration request.
func (client *AccountsClient) customerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, options *AccountsClientBeginCustomerInitiatedMigrationOptions) (*policy.Request, error) {
func (client *AccountsClient) customerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, _ *AccountsClientBeginCustomerInitiatedMigrationOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -346,7 +343,7 @@ func (client *AccountsClient) customerInitiatedMigrationCreateRequest(ctx contex
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
@ -358,7 +355,7 @@ func (client *AccountsClient) customerInitiatedMigrationCreateRequest(ctx contex
// Delete - Deletes a storage account in Microsoft Azure.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -385,7 +382,7 @@ func (client *AccountsClient) Delete(ctx context.Context, resourceGroupName stri
}
// deleteCreateRequest creates the Delete request.
func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientDeleteOptions) (*policy.Request, error) {
func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountsClientDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -404,7 +401,7 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
return req, nil
}
@ -417,10 +414,10 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG
// event of availability issues as Planned failover is only available while the
// primary and secondary endpoints are available. The primary use case of a Planned Failover is disaster recovery testing
// drills. This type of failover is invoked by setting FailoverType parameter to
// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance
// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/azure/storage/common/storage-disaster-recovery-guidance
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -451,10 +448,10 @@ func (client *AccountsClient) BeginFailover(ctx context.Context, resourceGroupNa
// event of availability issues as Planned failover is only available while the
// primary and secondary endpoints are available. The primary use case of a Planned Failover is disaster recovery testing
// drills. This type of failover is invoked by setting FailoverType parameter to
// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance
// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/azure/storage/common/storage-disaster-recovery-guidance
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *AccountsClient) failover(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginFailoverOptions) (*http.Response, error) {
var err error
const operationName = "AccountsClient.BeginFailover"
@ -496,7 +493,7 @@ func (client *AccountsClient) failoverCreateRequest(ctx context.Context, resourc
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
if options != nil && options.FailoverType != nil {
reqQP.Set("failoverType", "Planned")
}
@ -507,7 +504,7 @@ func (client *AccountsClient) failoverCreateRequest(ctx context.Context, resourc
// GetCustomerInitiatedMigration - Gets the status of the ongoing migration for the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -537,7 +534,7 @@ func (client *AccountsClient) GetCustomerInitiatedMigration(ctx context.Context,
}
// getCustomerInitiatedMigrationCreateRequest creates the GetCustomerInitiatedMigration request.
func (client *AccountsClient) getCustomerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, migrationName MigrationName, options *AccountsClientGetCustomerInitiatedMigrationOptions) (*policy.Request, error) {
func (client *AccountsClient) getCustomerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, migrationName MigrationName, _ *AccountsClientGetCustomerInitiatedMigrationOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -560,7 +557,7 @@ func (client *AccountsClient) getCustomerInitiatedMigrationCreateRequest(ctx con
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -579,7 +576,7 @@ func (client *AccountsClient) getCustomerInitiatedMigrationHandleResponse(resp *
// and account status. The ListKeys operation should be used to retrieve storage keys.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -629,7 +626,7 @@ func (client *AccountsClient) getPropertiesCreateRequest(ctx context.Context, re
if options != nil && options.Expand != nil {
reqQP.Set("$expand", string(*options.Expand))
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -647,7 +644,7 @@ func (client *AccountsClient) getPropertiesHandleResponse(resp *http.Response) (
// BeginHierarchicalNamespaceMigration - Live Migration of storage account to enable Hns
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -677,7 +674,7 @@ func (client *AccountsClient) BeginHierarchicalNamespaceMigration(ctx context.Co
// HierarchicalNamespaceMigration - Live Migration of storage account to enable Hns
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *AccountsClient) hierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, requestType string, options *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*http.Response, error) {
var err error
const operationName = "AccountsClient.BeginHierarchicalNamespaceMigration"
@ -700,7 +697,7 @@ func (client *AccountsClient) hierarchicalNamespaceMigration(ctx context.Context
}
// hierarchicalNamespaceMigrationCreateRequest creates the HierarchicalNamespaceMigration request.
func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, requestType string, options *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*policy.Request, error) {
func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, requestType string, _ *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -719,7 +716,7 @@ func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx co
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
reqQP.Set("requestType", requestType)
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
@ -729,7 +726,7 @@ func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx co
// NewListPager - Lists all the storage accounts available under the subscription. Note that storage keys are not returned;
// use the ListKeys operation for this.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - options - AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method.
func (client *AccountsClient) NewListPager(options *AccountsClientListOptions) *runtime.Pager[AccountsClientListResponse] {
return runtime.NewPager(runtime.PagingHandler[AccountsClientListResponse]{
@ -755,7 +752,7 @@ func (client *AccountsClient) NewListPager(options *AccountsClientListOptions) *
}
// listCreateRequest creates the List request.
func (client *AccountsClient) listCreateRequest(ctx context.Context, options *AccountsClientListOptions) (*policy.Request, error) {
func (client *AccountsClient) listCreateRequest(ctx context.Context, _ *AccountsClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -766,7 +763,7 @@ func (client *AccountsClient) listCreateRequest(ctx context.Context, options *Ac
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -784,7 +781,7 @@ func (client *AccountsClient) listHandleResponse(resp *http.Response) (AccountsC
// ListAccountSAS - List SAS credentials of a storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -813,7 +810,7 @@ func (client *AccountsClient) ListAccountSAS(ctx context.Context, resourceGroupN
}
// listAccountSASCreateRequest creates the ListAccountSAS request.
func (client *AccountsClient) listAccountSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters, options *AccountsClientListAccountSASOptions) (*policy.Request, error) {
func (client *AccountsClient) listAccountSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters, _ *AccountsClientListAccountSASOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -832,7 +829,7 @@ func (client *AccountsClient) listAccountSASCreateRequest(ctx context.Context, r
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
@ -853,7 +850,7 @@ func (client *AccountsClient) listAccountSASHandleResponse(resp *http.Response)
// NewListByResourceGroupPager - Lists all the storage accounts available under the given resource group. Note that storage
// keys are not returned; use the ListKeys operation for this.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.NewListByResourceGroupPager
// method.
@ -881,7 +878,7 @@ func (client *AccountsClient) NewListByResourceGroupPager(resourceGroupName stri
}
// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AccountsClientListByResourceGroupOptions) (*policy.Request, error) {
func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *AccountsClientListByResourceGroupOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -896,7 +893,7 @@ func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Conte
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -914,7 +911,7 @@ func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Respo
// ListKeys - Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -964,7 +961,7 @@ func (client *AccountsClient) listKeysCreateRequest(ctx context.Context, resourc
if options != nil && options.Expand != nil {
reqQP.Set("$expand", "kerb")
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -982,7 +979,7 @@ func (client *AccountsClient) listKeysHandleResponse(resp *http.Response) (Accou
// ListServiceSAS - List service SAS credentials of a specific resource.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -1011,7 +1008,7 @@ func (client *AccountsClient) ListServiceSAS(ctx context.Context, resourceGroupN
}
// listServiceSASCreateRequest creates the ListServiceSAS request.
func (client *AccountsClient) listServiceSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters, options *AccountsClientListServiceSASOptions) (*policy.Request, error) {
func (client *AccountsClient) listServiceSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters, _ *AccountsClientListServiceSASOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -1030,7 +1027,7 @@ func (client *AccountsClient) listServiceSASCreateRequest(ctx context.Context, r
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
@ -1051,7 +1048,7 @@ func (client *AccountsClient) listServiceSASHandleResponse(resp *http.Response)
// RegenerateKey - Regenerates one of the access keys or Kerberos keys for the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -1080,7 +1077,7 @@ func (client *AccountsClient) RegenerateKey(ctx context.Context, resourceGroupNa
}
// regenerateKeyCreateRequest creates the RegenerateKey request.
func (client *AccountsClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters, options *AccountsClientRegenerateKeyOptions) (*policy.Request, error) {
func (client *AccountsClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters, _ *AccountsClientRegenerateKeyOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -1099,7 +1096,7 @@ func (client *AccountsClient) regenerateKeyCreateRequest(ctx context.Context, re
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, regenerateKey); err != nil {
@ -1120,7 +1117,7 @@ func (client *AccountsClient) regenerateKeyHandleResponse(resp *http.Response) (
// BeginRestoreBlobRanges - Restore blobs in the specified blob ranges
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -1148,7 +1145,7 @@ func (client *AccountsClient) BeginRestoreBlobRanges(ctx context.Context, resour
// RestoreBlobRanges - Restore blobs in the specified blob ranges
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *AccountsClient) restoreBlobRanges(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, options *AccountsClientBeginRestoreBlobRangesOptions) (*http.Response, error) {
var err error
const operationName = "AccountsClient.BeginRestoreBlobRanges"
@ -1171,7 +1168,7 @@ func (client *AccountsClient) restoreBlobRanges(ctx context.Context, resourceGro
}
// restoreBlobRangesCreateRequest creates the RestoreBlobRanges request.
func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, options *AccountsClientBeginRestoreBlobRangesOptions) (*policy.Request, error) {
func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, _ *AccountsClientBeginRestoreBlobRangesOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -1190,7 +1187,7 @@ func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
@ -1202,7 +1199,7 @@ func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context
// RevokeUserDelegationKeys - Revoke user delegation keys.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -1230,7 +1227,7 @@ func (client *AccountsClient) RevokeUserDelegationKeys(ctx context.Context, reso
}
// revokeUserDelegationKeysCreateRequest creates the RevokeUserDelegationKeys request.
func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientRevokeUserDelegationKeysOptions) (*policy.Request, error) {
func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountsClientRevokeUserDelegationKeysOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -1249,7 +1246,7 @@ func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context.
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
return req, nil
}
@ -1263,7 +1260,7 @@ func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context.
// location and name of the storage account cannot be changed after creation.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -1292,7 +1289,7 @@ func (client *AccountsClient) Update(ctx context.Context, resourceGroupName stri
}
// updateCreateRequest creates the Update request.
func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters, options *AccountsClientUpdateOptions) (*policy.Request, error) {
func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters, _ *AccountsClientUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -1311,7 +1308,7 @@ func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceG
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {

View file

@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/resourcemanager/storage/armstorage",
"Tag": "go/resourcemanager/storage/armstorage_a26d68f572"
"Tag": "go/resourcemanager/storage/armstorage_0044a0eabf"
}

View file

@ -5,11 +5,11 @@
``` yaml
azure-arm: true
require:
- https://github.com/Azure/azure-rest-api-specs/blob/220ad9c6554fc7d6d10a89bdb441c1e3b36e3285/specification/storage/resource-manager/readme.md
- https://github.com/Azure/azure-rest-api-specs/blob/220ad9c6554fc7d6d10a89bdb441c1e3b36e3285/specification/storage/resource-manager/readme.go.md
- https://github.com/Azure/azure-rest-api-specs/blob/97ee23a6db6078abcbec7b75bf9af8c503e9bb8b/specification/storage/resource-manager/readme.md
- https://github.com/Azure/azure-rest-api-specs/blob/97ee23a6db6078abcbec7b75bf9af8c503e9bb8b/specification/storage/resource-manager/readme.go.md
license-header: MICROSOFT_MIT_NO_VERSION
module-version: 1.6.0
module-version: 1.8.0
modelerfour:
seal-single-value-enum-by-default: true
tag: package-2023-05
tag: package-2024-01
```

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -47,7 +44,7 @@ func NewBlobContainersClient(subscriptionID string, credential azcore.TokenCrede
// clears out only the specified tags in the request.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -80,7 +77,7 @@ func (client *BlobContainersClient) ClearLegalHold(ctx context.Context, resource
}
// clearLegalHoldCreateRequest creates the ClearLegalHold request.
func (client *BlobContainersClient) clearLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, options *BlobContainersClientClearLegalHoldOptions) (*policy.Request, error) {
func (client *BlobContainersClient) clearLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, _ *BlobContainersClientClearLegalHoldOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -103,7 +100,7 @@ func (client *BlobContainersClient) clearLegalHoldCreateRequest(ctx context.Cont
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, legalHold); err != nil {
@ -126,7 +123,7 @@ func (client *BlobContainersClient) clearLegalHoldHandleResponse(resp *http.Resp
// contained by the container.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -158,7 +155,7 @@ func (client *BlobContainersClient) Create(ctx context.Context, resourceGroupNam
}
// createCreateRequest creates the Create request.
func (client *BlobContainersClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, options *BlobContainersClientCreateOptions) (*policy.Request, error) {
func (client *BlobContainersClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, _ *BlobContainersClientCreateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -181,7 +178,7 @@ func (client *BlobContainersClient) createCreateRequest(ctx context.Context, res
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, blobContainer); err != nil {
@ -203,7 +200,7 @@ func (client *BlobContainersClient) createHandleResponse(resp *http.Response) (B
// but not required for this operation.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -259,7 +256,7 @@ func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyCreateReques
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if options != nil && options.IfMatch != nil {
@ -289,7 +286,7 @@ func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyHandleRespon
// Delete - Deletes specified container under its account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -319,7 +316,7 @@ func (client *BlobContainersClient) Delete(ctx context.Context, resourceGroupNam
}
// deleteCreateRequest creates the Delete request.
func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientDeleteOptions) (*policy.Request, error) {
func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, _ *BlobContainersClientDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -342,7 +339,7 @@ func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, res
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
return req, nil
}
@ -353,16 +350,16 @@ func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, res
// container.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
// - 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.
// - 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.
// - ifMatch - The entity state (ETag) version of the immutability policy to update must be returned to the server for all update
// operations. The ETag value must include the leading and trailing double quotes as
// returned by the service.
// - options - BlobContainersClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.DeleteImmutabilityPolicy
// method.
func (client *BlobContainersClient) DeleteImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientDeleteImmutabilityPolicyOptions) (BlobContainersClientDeleteImmutabilityPolicyResponse, error) {
@ -388,7 +385,7 @@ func (client *BlobContainersClient) DeleteImmutabilityPolicy(ctx context.Context
}
// deleteImmutabilityPolicyCreateRequest creates the DeleteImmutabilityPolicy request.
func (client *BlobContainersClient) deleteImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientDeleteImmutabilityPolicyOptions) (*policy.Request, error) {
func (client *BlobContainersClient) deleteImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, _ *BlobContainersClientDeleteImmutabilityPolicyOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -412,7 +409,7 @@ func (client *BlobContainersClient) deleteImmutabilityPolicyCreateRequest(ctx co
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["If-Match"] = []string{ifMatch}
@ -435,16 +432,16 @@ func (client *BlobContainersClient) deleteImmutabilityPolicyHandleResponse(resp
// allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
// - 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.
// - 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.
// - ifMatch - The entity state (ETag) version of the immutability policy to update must be returned to the server for all update
// operations. The ETag value must include the leading and trailing double quotes as
// returned by the service.
// - options - BlobContainersClientExtendImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.ExtendImmutabilityPolicy
// method.
func (client *BlobContainersClient) ExtendImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientExtendImmutabilityPolicyOptions) (BlobContainersClientExtendImmutabilityPolicyResponse, error) {
@ -493,7 +490,7 @@ func (client *BlobContainersClient) extendImmutabilityPolicyCreateRequest(ctx co
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["If-Match"] = []string{ifMatch}
@ -521,7 +518,7 @@ func (client *BlobContainersClient) extendImmutabilityPolicyHandleResponse(resp
// Get - Gets properties of a specified container.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -552,7 +549,7 @@ func (client *BlobContainersClient) Get(ctx context.Context, resourceGroupName s
}
// getCreateRequest creates the Get request.
func (client *BlobContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientGetOptions) (*policy.Request, error) {
func (client *BlobContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, _ *BlobContainersClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -575,7 +572,7 @@ func (client *BlobContainersClient) getCreateRequest(ctx context.Context, resour
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -594,7 +591,7 @@ func (client *BlobContainersClient) getHandleResponse(resp *http.Response) (Blob
// body.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -650,7 +647,7 @@ func (client *BlobContainersClient) getImmutabilityPolicyCreateRequest(ctx conte
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if options != nil && options.IfMatch != nil {
@ -675,7 +672,7 @@ func (client *BlobContainersClient) getImmutabilityPolicyHandleResponse(resp *ht
// can be 15 to 60 seconds, or can be infinite.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -729,7 +726,7 @@ func (client *BlobContainersClient) leaseCreateRequest(ctx context.Context, reso
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if options != nil && options.Parameters != nil {
@ -753,7 +750,7 @@ func (client *BlobContainersClient) leaseHandleResponse(resp *http.Response) (Bl
// NewListPager - Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation
// token.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -810,7 +807,7 @@ func (client *BlobContainersClient) listCreateRequest(ctx context.Context, resou
if options != nil && options.Maxpagesize != nil {
reqQP.Set("$maxpagesize", *options.Maxpagesize)
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -829,16 +826,16 @@ func (client *BlobContainersClient) listHandleResponse(resp *http.Response) (Blo
// action. ETag in If-Match is required for this operation.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
// - 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.
// - 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.
// - ifMatch - The entity state (ETag) version of the immutability policy to update must be returned to the server for all update
// operations. The ETag value must include the leading and trailing double quotes as
// returned by the service.
// - options - BlobContainersClientLockImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.LockImmutabilityPolicy
// method.
func (client *BlobContainersClient) LockImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientLockImmutabilityPolicyOptions) (BlobContainersClientLockImmutabilityPolicyResponse, error) {
@ -864,7 +861,7 @@ func (client *BlobContainersClient) LockImmutabilityPolicy(ctx context.Context,
}
// lockImmutabilityPolicyCreateRequest creates the LockImmutabilityPolicy request.
func (client *BlobContainersClient) lockImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientLockImmutabilityPolicyOptions) (*policy.Request, error) {
func (client *BlobContainersClient) lockImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, _ *BlobContainersClientLockImmutabilityPolicyOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -887,7 +884,7 @@ func (client *BlobContainersClient) lockImmutabilityPolicyCreateRequest(ctx cont
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
req.Raw().Header["If-Match"] = []string{ifMatch}
@ -911,7 +908,7 @@ func (client *BlobContainersClient) lockImmutabilityPolicyHandleResponse(resp *h
// unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -943,7 +940,7 @@ func (client *BlobContainersClient) BeginObjectLevelWorm(ctx context.Context, re
// unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *BlobContainersClient) objectLevelWorm(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientBeginObjectLevelWormOptions) (*http.Response, error) {
var err error
const operationName = "BlobContainersClient.BeginObjectLevelWorm"
@ -966,7 +963,7 @@ func (client *BlobContainersClient) objectLevelWorm(ctx context.Context, resourc
}
// objectLevelWormCreateRequest creates the ObjectLevelWorm request.
func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientBeginObjectLevelWormOptions) (*policy.Request, error) {
func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, _ *BlobContainersClientBeginObjectLevelWormOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -989,7 +986,7 @@ func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Con
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -999,7 +996,7 @@ func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Con
// pattern and does not clear out the existing tags that are not specified in the request.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -1032,7 +1029,7 @@ func (client *BlobContainersClient) SetLegalHold(ctx context.Context, resourceGr
}
// setLegalHoldCreateRequest creates the SetLegalHold request.
func (client *BlobContainersClient) setLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, options *BlobContainersClientSetLegalHoldOptions) (*policy.Request, error) {
func (client *BlobContainersClient) setLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, _ *BlobContainersClientSetLegalHoldOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -1055,7 +1052,7 @@ func (client *BlobContainersClient) setLegalHoldCreateRequest(ctx context.Contex
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, legalHold); err != nil {
@ -1077,7 +1074,7 @@ func (client *BlobContainersClient) setLegalHoldHandleResponse(resp *http.Respon
// Update fails if the specified container doesn't already exist.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -1109,7 +1106,7 @@ func (client *BlobContainersClient) Update(ctx context.Context, resourceGroupNam
}
// updateCreateRequest creates the Update request.
func (client *BlobContainersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, options *BlobContainersClientUpdateOptions) (*policy.Request, error) {
func (client *BlobContainersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, _ *BlobContainersClientUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -1132,7 +1129,7 @@ func (client *BlobContainersClient) updateCreateRequest(ctx context.Context, res
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, blobContainer); err != nil {

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewBlobInventoryPoliciesClient(subscriptionID string, credential azcore.Tok
// CreateOrUpdate - Sets the blob inventory policy to the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -77,7 +74,7 @@ func (client *BlobInventoryPoliciesClient) CreateOrUpdate(ctx context.Context, r
}
// createOrUpdateCreateRequest creates the CreateOrUpdate request.
func (client *BlobInventoryPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, properties BlobInventoryPolicy, options *BlobInventoryPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
func (client *BlobInventoryPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, properties BlobInventoryPolicy, _ *BlobInventoryPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -100,7 +97,7 @@ func (client *BlobInventoryPoliciesClient) createOrUpdateCreateRequest(ctx conte
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, properties); err != nil {
@ -121,7 +118,7 @@ func (client *BlobInventoryPoliciesClient) createOrUpdateHandleResponse(resp *ht
// Delete - Deletes the blob inventory policy associated with the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -150,7 +147,7 @@ func (client *BlobInventoryPoliciesClient) Delete(ctx context.Context, resourceG
}
// deleteCreateRequest creates the Delete request.
func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, options *BlobInventoryPoliciesClientDeleteOptions) (*policy.Request, error) {
func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, _ *BlobInventoryPoliciesClientDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -173,7 +170,7 @@ func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Conte
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -182,7 +179,7 @@ func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Conte
// Get - Gets the blob inventory policy associated with the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -212,7 +209,7 @@ func (client *BlobInventoryPoliciesClient) Get(ctx context.Context, resourceGrou
}
// getCreateRequest creates the Get request.
func (client *BlobInventoryPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, options *BlobInventoryPoliciesClientGetOptions) (*policy.Request, error) {
func (client *BlobInventoryPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, _ *BlobInventoryPoliciesClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -235,7 +232,7 @@ func (client *BlobInventoryPoliciesClient) getCreateRequest(ctx context.Context,
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -252,7 +249,7 @@ func (client *BlobInventoryPoliciesClient) getHandleResponse(resp *http.Response
// NewListPager - Gets the blob inventory policy associated with the specified storage account.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -283,7 +280,7 @@ func (client *BlobInventoryPoliciesClient) NewListPager(resourceGroupName string
}
// listCreateRequest creates the List request.
func (client *BlobInventoryPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobInventoryPoliciesClientListOptions) (*policy.Request, error) {
func (client *BlobInventoryPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *BlobInventoryPoliciesClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -302,7 +299,7 @@ func (client *BlobInventoryPoliciesClient) listCreateRequest(ctx context.Context
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -47,7 +44,7 @@ func NewBlobServicesClient(subscriptionID string, credential azcore.TokenCredent
// and CORS (Cross-Origin Resource Sharing) rules.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -76,7 +73,7 @@ func (client *BlobServicesClient) GetServiceProperties(ctx context.Context, reso
}
// getServicePropertiesCreateRequest creates the GetServiceProperties request.
func (client *BlobServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
func (client *BlobServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *BlobServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -96,7 +93,7 @@ func (client *BlobServicesClient) getServicePropertiesCreateRequest(ctx context.
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -113,7 +110,7 @@ func (client *BlobServicesClient) getServicePropertiesHandleResponse(resp *http.
// NewListPager - List blob services of storage account. It returns a collection of one object named default.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -143,7 +140,7 @@ func (client *BlobServicesClient) NewListPager(resourceGroupName string, account
}
// listCreateRequest creates the List request.
func (client *BlobServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobServicesClientListOptions) (*policy.Request, error) {
func (client *BlobServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *BlobServicesClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -162,7 +159,7 @@ func (client *BlobServicesClient) listCreateRequest(ctx context.Context, resourc
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -181,7 +178,7 @@ func (client *BlobServicesClient) listHandleResponse(resp *http.Response) (BlobS
// and CORS (Cross-Origin Resource Sharing) rules.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -212,7 +209,7 @@ func (client *BlobServicesClient) SetServiceProperties(ctx context.Context, reso
}
// setServicePropertiesCreateRequest creates the SetServiceProperties request.
func (client *BlobServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobServiceProperties, options *BlobServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
func (client *BlobServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobServiceProperties, _ *BlobServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -232,7 +229,7 @@ func (client *BlobServicesClient) setServicePropertiesCreateRequest(ctx context.
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {

View file

@ -24,6 +24,5 @@ pr:
extends:
template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
parameters:
IncludeRelease: true
ServiceDirectory: 'resourcemanager/storage/armstorage'
UsePipelineProxy: false

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -10,7 +7,7 @@ package armstorage
const (
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
moduleVersion = "v1.6.0"
moduleVersion = "v1.8.0"
)
// AccessTier - Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium'
@ -994,6 +991,7 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer
type ProvisioningState string
const (
ProvisioningStateAccepted ProvisioningState = "Accepted"
ProvisioningStateCanceled ProvisioningState = "Canceled"
ProvisioningStateCreating ProvisioningState = "Creating"
ProvisioningStateDeleting ProvisioningState = "Deleting"
@ -1007,6 +1005,7 @@ const (
// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
func PossibleProvisioningStateValues() []ProvisioningState {
return []ProvisioningState{
ProvisioningStateAccepted,
ProvisioningStateCanceled,
ProvisioningStateCreating,
ProvisioningStateDeleting,
@ -1213,12 +1212,18 @@ type SKUName string
const (
SKUNamePremiumLRS SKUName = "Premium_LRS"
SKUNamePremiumV2LRS SKUName = "PremiumV2_LRS"
SKUNamePremiumV2ZRS SKUName = "PremiumV2_ZRS"
SKUNamePremiumZRS SKUName = "Premium_ZRS"
SKUNameStandardGRS SKUName = "Standard_GRS"
SKUNameStandardGZRS SKUName = "Standard_GZRS"
SKUNameStandardLRS SKUName = "Standard_LRS"
SKUNameStandardRAGRS SKUName = "Standard_RAGRS"
SKUNameStandardRAGZRS SKUName = "Standard_RAGZRS"
SKUNameStandardV2GRS SKUName = "StandardV2_GRS"
SKUNameStandardV2GZRS SKUName = "StandardV2_GZRS"
SKUNameStandardV2LRS SKUName = "StandardV2_LRS"
SKUNameStandardV2ZRS SKUName = "StandardV2_ZRS"
SKUNameStandardZRS SKUName = "Standard_ZRS"
)
@ -1226,12 +1231,18 @@ const (
func PossibleSKUNameValues() []SKUName {
return []SKUName{
SKUNamePremiumLRS,
SKUNamePremiumV2LRS,
SKUNamePremiumV2ZRS,
SKUNamePremiumZRS,
SKUNameStandardGRS,
SKUNameStandardGZRS,
SKUNameStandardLRS,
SKUNameStandardRAGRS,
SKUNameStandardRAGZRS,
SKUNameStandardV2GRS,
SKUNameStandardV2GZRS,
SKUNameStandardV2LRS,
SKUNameStandardV2ZRS,
SKUNameStandardZRS,
}
}

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewDeletedAccountsClient(subscriptionID string, credential azcore.TokenCred
// Get - Get properties of specified deleted account resource.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - deletedAccountName - Name of the deleted storage account.
// - location - The location of the deleted storage account.
// - options - DeletedAccountsClientGetOptions contains the optional parameters for the DeletedAccountsClient.Get method.
@ -73,7 +70,7 @@ func (client *DeletedAccountsClient) Get(ctx context.Context, deletedAccountName
}
// getCreateRequest creates the Get request.
func (client *DeletedAccountsClient) getCreateRequest(ctx context.Context, deletedAccountName string, location string, options *DeletedAccountsClientGetOptions) (*policy.Request, error) {
func (client *DeletedAccountsClient) getCreateRequest(ctx context.Context, deletedAccountName string, location string, _ *DeletedAccountsClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}"
if deletedAccountName == "" {
return nil, errors.New("parameter deletedAccountName cannot be empty")
@ -92,7 +89,7 @@ func (client *DeletedAccountsClient) getCreateRequest(ctx context.Context, delet
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -109,7 +106,7 @@ func (client *DeletedAccountsClient) getHandleResponse(resp *http.Response) (Del
// NewListPager - Lists deleted accounts under the subscription.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - options - DeletedAccountsClientListOptions contains the optional parameters for the DeletedAccountsClient.NewListPager
// method.
func (client *DeletedAccountsClient) NewListPager(options *DeletedAccountsClientListOptions) *runtime.Pager[DeletedAccountsClientListResponse] {
@ -136,7 +133,7 @@ func (client *DeletedAccountsClient) NewListPager(options *DeletedAccountsClient
}
// listCreateRequest creates the List request.
func (client *DeletedAccountsClient) listCreateRequest(ctx context.Context, options *DeletedAccountsClientListOptions) (*policy.Request, error) {
func (client *DeletedAccountsClient) listCreateRequest(ctx context.Context, _ *DeletedAccountsClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -147,7 +144,7 @@ func (client *DeletedAccountsClient) listCreateRequest(ctx context.Context, opti
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -47,7 +44,7 @@ func NewEncryptionScopesClient(subscriptionID string, credential azcore.TokenCre
// Get - Returns the properties for the specified encryption scope.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -78,7 +75,7 @@ func (client *EncryptionScopesClient) Get(ctx context.Context, resourceGroupName
}
// getCreateRequest creates the Get request.
func (client *EncryptionScopesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, options *EncryptionScopesClientGetOptions) (*policy.Request, error) {
func (client *EncryptionScopesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, _ *EncryptionScopesClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -101,7 +98,7 @@ func (client *EncryptionScopesClient) getCreateRequest(ctx context.Context, reso
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -118,7 +115,7 @@ func (client *EncryptionScopesClient) getHandleResponse(resp *http.Response) (En
// NewListPager - Lists all the encryption scopes available under the specified storage account.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -176,7 +173,7 @@ func (client *EncryptionScopesClient) listCreateRequest(ctx context.Context, res
if options != nil && options.Maxpagesize != nil {
reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -195,7 +192,7 @@ func (client *EncryptionScopesClient) listHandleResponse(resp *http.Response) (E
// does not already exist.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -227,7 +224,7 @@ func (client *EncryptionScopesClient) Patch(ctx context.Context, resourceGroupNa
}
// patchCreateRequest creates the Patch request.
func (client *EncryptionScopesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesClientPatchOptions) (*policy.Request, error) {
func (client *EncryptionScopesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, _ *EncryptionScopesClientPatchOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -250,7 +247,7 @@ func (client *EncryptionScopesClient) patchCreateRequest(ctx context.Context, re
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, encryptionScope); err != nil {
@ -273,7 +270,7 @@ func (client *EncryptionScopesClient) patchHandleResponse(resp *http.Response) (
// encryption scope properties will be updated per the specified request.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -305,7 +302,7 @@ func (client *EncryptionScopesClient) Put(ctx context.Context, resourceGroupName
}
// putCreateRequest creates the Put request.
func (client *EncryptionScopesClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesClientPutOptions) (*policy.Request, error) {
func (client *EncryptionScopesClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, _ *EncryptionScopesClientPutOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -328,7 +325,7 @@ func (client *EncryptionScopesClient) putCreateRequest(ctx context.Context, reso
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, encryptionScope); err != nil {

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -17,6 +14,7 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
"net/http"
"net/url"
"strconv"
"strings"
)
@ -47,7 +45,7 @@ func NewFileServicesClient(subscriptionID string, credential azcore.TokenCredent
// Sharing) rules.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -76,7 +74,7 @@ func (client *FileServicesClient) GetServiceProperties(ctx context.Context, reso
}
// getServicePropertiesCreateRequest creates the GetServiceProperties request.
func (client *FileServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
func (client *FileServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *FileServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -96,7 +94,7 @@ func (client *FileServicesClient) getServicePropertiesCreateRequest(ctx context.
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -111,10 +109,79 @@ func (client *FileServicesClient) getServicePropertiesHandleResponse(resp *http.
return result, nil
}
// GetServiceUsage - Gets the usage of file service in storage account including account limits, file share limits and constants
// used in recommendations and bursting formula.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
// - options - FileServicesClientGetServiceUsageOptions contains the optional parameters for the FileServicesClient.GetServiceUsage
// method.
func (client *FileServicesClient) GetServiceUsage(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientGetServiceUsageOptions) (FileServicesClientGetServiceUsageResponse, error) {
var err error
const operationName = "FileServicesClient.GetServiceUsage"
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
defer func() { endSpan(err) }()
req, err := client.getServiceUsageCreateRequest(ctx, resourceGroupName, accountName, options)
if err != nil {
return FileServicesClientGetServiceUsageResponse{}, err
}
httpResp, err := client.internal.Pipeline().Do(req)
if err != nil {
return FileServicesClientGetServiceUsageResponse{}, err
}
if !runtime.HasStatusCode(httpResp, http.StatusOK) {
err = runtime.NewResponseError(httpResp)
return FileServicesClientGetServiceUsageResponse{}, err
}
resp, err := client.getServiceUsageHandleResponse(httpResp)
return resp, err
}
// getServiceUsageCreateRequest creates the GetServiceUsage request.
func (client *FileServicesClient) getServiceUsageCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *FileServicesClientGetServiceUsageOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages/{fileServiceUsagesName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
if accountName == "" {
return nil, errors.New("parameter accountName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
urlPath = strings.ReplaceAll(urlPath, "{FileServicesName}", url.PathEscape("default"))
urlPath = strings.ReplaceAll(urlPath, "{fileServiceUsagesName}", url.PathEscape("default"))
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
if err != nil {
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
}
// getServiceUsageHandleResponse handles the GetServiceUsage response.
func (client *FileServicesClient) getServiceUsageHandleResponse(resp *http.Response) (FileServicesClientGetServiceUsageResponse, error) {
result := FileServicesClientGetServiceUsageResponse{}
if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceUsage); err != nil {
return FileServicesClientGetServiceUsageResponse{}, err
}
return result, nil
}
// List - List all file services in storage accounts
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -142,7 +209,7 @@ func (client *FileServicesClient) List(ctx context.Context, resourceGroupName st
}
// listCreateRequest creates the List request.
func (client *FileServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientListOptions) (*policy.Request, error) {
func (client *FileServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *FileServicesClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -161,7 +228,7 @@ func (client *FileServicesClient) listCreateRequest(ctx context.Context, resourc
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -176,11 +243,81 @@ func (client *FileServicesClient) listHandleResponse(resp *http.Response) (FileS
return result, nil
}
// NewListServiceUsagesPager - Gets the usages of file service in storage account.
//
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
// - options - FileServicesClientListServiceUsagesOptions contains the optional parameters for the FileServicesClient.NewListServiceUsagesPager
// method.
func (client *FileServicesClient) NewListServiceUsagesPager(resourceGroupName string, accountName string, options *FileServicesClientListServiceUsagesOptions) *runtime.Pager[FileServicesClientListServiceUsagesResponse] {
return runtime.NewPager(runtime.PagingHandler[FileServicesClientListServiceUsagesResponse]{
More: func(page FileServicesClientListServiceUsagesResponse) bool {
return page.NextLink != nil && len(*page.NextLink) > 0
},
Fetcher: func(ctx context.Context, page *FileServicesClientListServiceUsagesResponse) (FileServicesClientListServiceUsagesResponse, error) {
ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FileServicesClient.NewListServiceUsagesPager")
nextLink := ""
if page != nil {
nextLink = *page.NextLink
}
resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
return client.listServiceUsagesCreateRequest(ctx, resourceGroupName, accountName, options)
}, nil)
if err != nil {
return FileServicesClientListServiceUsagesResponse{}, err
}
return client.listServiceUsagesHandleResponse(resp)
},
Tracer: client.internal.Tracer(),
})
}
// listServiceUsagesCreateRequest creates the ListServiceUsages request.
func (client *FileServicesClient) listServiceUsagesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientListServiceUsagesOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
if accountName == "" {
return nil, errors.New("parameter accountName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
urlPath = strings.ReplaceAll(urlPath, "{FileServicesName}", url.PathEscape("default"))
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
if err != nil {
return nil, err
}
reqQP := req.Raw().URL.Query()
if options != nil && options.Maxpagesize != nil {
reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
}
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
}
// listServiceUsagesHandleResponse handles the ListServiceUsages response.
func (client *FileServicesClient) listServiceUsagesHandleResponse(resp *http.Response) (FileServicesClientListServiceUsagesResponse, error) {
result := FileServicesClientListServiceUsagesResponse{}
if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceUsages); err != nil {
return FileServicesClientListServiceUsagesResponse{}, err
}
return result, nil
}
// SetServiceProperties - Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
// Sharing) rules.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -210,7 +347,7 @@ func (client *FileServicesClient) SetServiceProperties(ctx context.Context, reso
}
// setServicePropertiesCreateRequest creates the SetServiceProperties request.
func (client *FileServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters FileServiceProperties, options *FileServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
func (client *FileServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters FileServiceProperties, _ *FileServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -230,7 +367,7 @@ func (client *FileServicesClient) setServicePropertiesCreateRequest(ctx context.
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -48,7 +45,7 @@ func NewFileSharesClient(subscriptionID string, credential azcore.TokenCredentia
// the share.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -106,7 +103,7 @@ func (client *FileSharesClient) createCreateRequest(ctx context.Context, resourc
if options != nil && options.Expand != nil {
reqQP.Set("$expand", *options.Expand)
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, fileShare); err != nil {
@ -127,7 +124,7 @@ func (client *FileSharesClient) createHandleResponse(resp *http.Response) (FileS
// Delete - Deletes specified share under its account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -183,7 +180,7 @@ func (client *FileSharesClient) deleteCreateRequest(ctx context.Context, resourc
if options != nil && options.Include != nil {
reqQP.Set("$include", *options.Include)
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if options != nil && options.XMSSnapshot != nil {
@ -195,7 +192,7 @@ func (client *FileSharesClient) deleteCreateRequest(ctx context.Context, resourc
// Get - Gets properties of a specified share.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -252,7 +249,7 @@ func (client *FileSharesClient) getCreateRequest(ctx context.Context, resourceGr
if options != nil && options.Expand != nil {
reqQP.Set("$expand", *options.Expand)
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if options != nil && options.XMSSnapshot != nil {
@ -274,7 +271,7 @@ func (client *FileSharesClient) getHandleResponse(resp *http.Response) (FileShar
// be 15 to 60 seconds, or can be infinite.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -328,7 +325,7 @@ func (client *FileSharesClient) leaseCreateRequest(ctx context.Context, resource
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if options != nil && options.XMSSnapshot != nil {
@ -357,7 +354,7 @@ func (client *FileSharesClient) leaseHandleResponse(resp *http.Response) (FileSh
// NewListPager - Lists all shares.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -414,7 +411,7 @@ func (client *FileSharesClient) listCreateRequest(ctx context.Context, resourceG
if options != nil && options.Maxpagesize != nil {
reqQP.Set("$maxpagesize", *options.Maxpagesize)
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -432,7 +429,7 @@ func (client *FileSharesClient) listHandleResponse(resp *http.Response) (FileSha
// Restore - Restore a file share within a valid retention days if share soft delete is enabled
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -462,7 +459,7 @@ func (client *FileSharesClient) Restore(ctx context.Context, resourceGroupName s
}
// restoreCreateRequest creates the Restore request.
func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, deletedShare DeletedShare, options *FileSharesClientRestoreOptions) (*policy.Request, error) {
func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, deletedShare DeletedShare, _ *FileSharesClientRestoreOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -485,7 +482,7 @@ func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resour
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, deletedShare); err != nil {
@ -498,7 +495,7 @@ func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resour
// Update fails if the specified share does not already exist.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -530,7 +527,7 @@ func (client *FileSharesClient) Update(ctx context.Context, resourceGroupName st
}
// updateCreateRequest creates the Update request.
func (client *FileSharesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, options *FileSharesClientUpdateOptions) (*policy.Request, error) {
func (client *FileSharesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, _ *FileSharesClientUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -553,7 +550,7 @@ func (client *FileSharesClient) updateCreateRequest(ctx context.Context, resourc
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, fileShare); err != nil {

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -48,7 +45,7 @@ func NewLocalUsersClient(subscriptionID string, credential azcore.TokenCredentia
// enablement and extended groups cannot be set with other properties.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -80,7 +77,7 @@ func (client *LocalUsersClient) CreateOrUpdate(ctx context.Context, resourceGrou
}
// createOrUpdateCreateRequest creates the CreateOrUpdate request.
func (client *LocalUsersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, properties LocalUser, options *LocalUsersClientCreateOrUpdateOptions) (*policy.Request, error) {
func (client *LocalUsersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, properties LocalUser, _ *LocalUsersClientCreateOrUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -103,7 +100,7 @@ func (client *LocalUsersClient) createOrUpdateCreateRequest(ctx context.Context,
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, properties); err != nil {
@ -124,7 +121,7 @@ func (client *LocalUsersClient) createOrUpdateHandleResponse(resp *http.Response
// Delete - Deletes the local user associated with the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -153,7 +150,7 @@ func (client *LocalUsersClient) Delete(ctx context.Context, resourceGroupName st
}
// deleteCreateRequest creates the Delete request.
func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientDeleteOptions) (*policy.Request, error) {
func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -176,7 +173,7 @@ func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourc
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -185,7 +182,7 @@ func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourc
// Get - Get the local user of the storage account by username.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -215,7 +212,7 @@ func (client *LocalUsersClient) Get(ctx context.Context, resourceGroupName strin
}
// getCreateRequest creates the Get request.
func (client *LocalUsersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientGetOptions) (*policy.Request, error) {
func (client *LocalUsersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -238,7 +235,7 @@ func (client *LocalUsersClient) getCreateRequest(ctx context.Context, resourceGr
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -255,7 +252,7 @@ func (client *LocalUsersClient) getHandleResponse(resp *http.Response) (LocalUse
// NewListPager - List the local users associated with the storage account.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -313,7 +310,7 @@ func (client *LocalUsersClient) listCreateRequest(ctx context.Context, resourceG
if options != nil && options.Maxpagesize != nil {
reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -331,7 +328,7 @@ func (client *LocalUsersClient) listHandleResponse(resp *http.Response) (LocalUs
// ListKeys - List SSH authorized keys and shared key of the local user.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -361,7 +358,7 @@ func (client *LocalUsersClient) ListKeys(ctx context.Context, resourceGroupName
}
// listKeysCreateRequest creates the ListKeys request.
func (client *LocalUsersClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientListKeysOptions) (*policy.Request, error) {
func (client *LocalUsersClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientListKeysOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -384,7 +381,7 @@ func (client *LocalUsersClient) listKeysCreateRequest(ctx context.Context, resou
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -402,7 +399,7 @@ func (client *LocalUsersClient) listKeysHandleResponse(resp *http.Response) (Loc
// RegeneratePassword - Regenerate the local user SSH password.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -433,7 +430,7 @@ func (client *LocalUsersClient) RegeneratePassword(ctx context.Context, resource
}
// regeneratePasswordCreateRequest creates the RegeneratePassword request.
func (client *LocalUsersClient) regeneratePasswordCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientRegeneratePasswordOptions) (*policy.Request, error) {
func (client *LocalUsersClient) regeneratePasswordCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientRegeneratePasswordOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -456,7 +453,7 @@ func (client *LocalUsersClient) regeneratePasswordCreateRequest(ctx context.Cont
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewManagementPoliciesClient(subscriptionID string, credential azcore.TokenC
// CreateOrUpdate - Sets the managementpolicy to the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -77,7 +74,7 @@ func (client *ManagementPoliciesClient) CreateOrUpdate(ctx context.Context, reso
}
// createOrUpdateCreateRequest creates the CreateOrUpdate request.
func (client *ManagementPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, properties ManagementPolicy, options *ManagementPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
func (client *ManagementPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, properties ManagementPolicy, _ *ManagementPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -100,7 +97,7 @@ func (client *ManagementPoliciesClient) createOrUpdateCreateRequest(ctx context.
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, properties); err != nil {
@ -121,7 +118,7 @@ func (client *ManagementPoliciesClient) createOrUpdateHandleResponse(resp *http.
// Delete - Deletes the managementpolicy associated with the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -150,7 +147,7 @@ func (client *ManagementPoliciesClient) Delete(ctx context.Context, resourceGrou
}
// deleteCreateRequest creates the Delete request.
func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, options *ManagementPoliciesClientDeleteOptions) (*policy.Request, error) {
func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, _ *ManagementPoliciesClientDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -173,7 +170,7 @@ func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context,
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
return req, nil
}
@ -181,7 +178,7 @@ func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context,
// Get - Gets the managementpolicy associated with the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -210,7 +207,7 @@ func (client *ManagementPoliciesClient) Get(ctx context.Context, resourceGroupNa
}
// getCreateRequest creates the Get request.
func (client *ManagementPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, options *ManagementPoliciesClientGetOptions) (*policy.Request, error) {
func (client *ManagementPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, _ *ManagementPoliciesClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -233,7 +230,7 @@ func (client *ManagementPoliciesClient) getCreateRequest(ctx context.Context, re
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -143,6 +140,21 @@ type AccountKey struct {
Value *string
}
// AccountLimits - Maximum provisioned storage, IOPS, bandwidth and number of file shares limits for the storage account.
type AccountLimits struct {
// READ-ONLY; The maximum number of file shares limit for the storage account.
MaxFileShares *int32
// READ-ONLY; The maximum provisioned bandwidth limit in mebibytes per second for the storage account.
MaxProvisionedBandwidthMiBPerSec *int32
// READ-ONLY; The maximum provisioned IOPS limit for the storage account.
MaxProvisionedIOPS *int32
// READ-ONLY; The maximum provisioned storage quota limit in gibibytes for the storage account.
MaxProvisionedStorageGiB *int32
}
// AccountListKeysResult - The response from the ListKeys operation.
type AccountListKeysResult struct {
// READ-ONLY; Gets the list of storage account keys and their properties for the specified storage account.
@ -602,6 +614,34 @@ type AccountUpdateParameters struct {
Tags map[string]*string
}
// AccountUsage - Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares and soft-deleted
// shares in the account.
type AccountUsage struct {
// READ-ONLY; Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or soft-deleted
// shares in the account.
LiveShares *AccountUsageElements
// READ-ONLY; Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or soft-deleted
// shares in the account.
SoftDeletedShares *AccountUsageElements
}
// AccountUsageElements - Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or
// soft-deleted shares in the account.
type AccountUsageElements struct {
// READ-ONLY; The total number of file shares.
FileShareCount *int32
// READ-ONLY; The total provisioned bandwidth in mebibytes per second.
ProvisionedBandwidthMiBPerSec *int32
// READ-ONLY; The total provisioned IOPS.
ProvisionedIOPS *int32
// READ-ONLY; The total provisioned storage quota in gibibytes.
ProvisionedStorageGiB *int32
}
// ActiveDirectoryProperties - Settings properties for Active Directory (AD).
type ActiveDirectoryProperties struct {
// REQUIRED; Specifies the domain GUID.
@ -902,6 +942,19 @@ type BlobServicePropertiesProperties struct {
RestorePolicy *RestorePolicyProperties
}
// BurstingConstants - Constants used for calculating included burst IOPS and maximum burst credits for IOPS for a file share
// in the storage account.
type BurstingConstants struct {
// READ-ONLY; The guaranteed floor of burst IOPS for small file shares.
BurstFloorIOPS *int32
// READ-ONLY; The scalar against provisioned IOPS in the file share included burst IOPS formula.
BurstIOScalar *float64
// READ-ONLY; The time frame for bursting in seconds in the file share maximum burst credits for IOPS formula.
BurstTimeframeSeconds *int32
}
// ChangeFeed - The blob service properties for change feed events.
type ChangeFeed struct {
// Indicates whether change feed event logging is enabled for the Blob service.
@ -1408,6 +1461,53 @@ type FileServicePropertiesProperties struct {
ShareDeleteRetentionPolicy *DeleteRetentionPolicy
}
// FileServiceUsage - The usage of file service in storage account.
type FileServiceUsage struct {
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string
// READ-ONLY; The name of the resource
Name *string
// READ-ONLY; File service usage in storage account including account limits, file share limits and constants used in recommendations
// and bursting formula.
Properties *FileServiceUsageProperties
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string
}
// FileServiceUsageProperties - File service usage in storage account including account limits, file share limits and constants
// used in recommendations and bursting formula.
type FileServiceUsageProperties struct {
// READ-ONLY; Constants used for calculating included burst IOPS and maximum burst credits for IOPS for a file share in the
// storage account.
BurstingConstants *BurstingConstants
// READ-ONLY; Minimum and maximum provisioned storage, IOPS and bandwidth limits for a file share in the storage account.
FileShareLimits *FileShareLimits
// READ-ONLY; Constants used for calculating recommended provisioned IOPS and bandwidth for a file share in the storage account.
FileShareRecommendations *FileShareRecommendations
// READ-ONLY; Maximum provisioned storage, IOPS, bandwidth and number of file shares limits for the storage account.
StorageAccountLimits *AccountLimits
// READ-ONLY; Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares and soft-deleted
// shares in the account.
StorageAccountUsage *AccountUsage
}
// FileServiceUsages - List file service usages schema.
type FileServiceUsages struct {
// READ-ONLY; Request URL that can be used to query next page of file service usages. Returned when total number of requested
// file service usages exceed maximum page size.
NextLink *string
// READ-ONLY; List of file service usages returned.
Value []*FileServiceUsage
}
// FileShare - Properties of the file share, including Id, resource name, resource type, Etag.
type FileShare struct {
// Properties of the file share.
@ -1455,6 +1555,27 @@ type FileShareItems struct {
Value []*FileShareItem
}
// FileShareLimits - Minimum and maximum provisioned storage, IOPS and bandwidth limits for a file share in the storage account.
type FileShareLimits struct {
// READ-ONLY; The maximum provisioned bandwidth limit in mebibytes per second for a file share in the storage account.
MaxProvisionedBandwidthMiBPerSec *int32
// READ-ONLY; The maximum provisioned IOPS limit for a file share in the storage account.
MaxProvisionedIOPS *int32
// READ-ONLY; The maximum provisioned storage quota limit in gibibytes for a file share in the storage account.
MaxProvisionedStorageGiB *int32
// READ-ONLY; The minimum provisioned bandwidth limit in mebibytes per second for a file share in the storage account.
MinProvisionedBandwidthMiBPerSec *int32
// READ-ONLY; The minimum provisioned IOPS limit for a file share in the storage account.
MinProvisionedIOPS *int32
// READ-ONLY; The minimum provisioned storage quota limit in gibibytes for a file share in the storage account.
MinProvisionedStorageGiB *int32
}
// FileShareProperties - The properties of the file share.
type FileShareProperties struct {
// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage
@ -1464,14 +1585,29 @@ type FileShareProperties struct {
// The authentication protocol that is used for the file share. Can only be specified when creating a share.
EnabledProtocols *EnabledProtocols
// File Share Paid Bursting properties.
FileSharePaidBursting *FileSharePropertiesFileSharePaidBursting
// A name-value pair to associate with the share as metadata.
Metadata map[string]*string
// The provisioned bandwidth of the share, in mebibytes per second. This property is only for file shares created under Files
// Provisioned v2 account type. Please refer to the GetFileServiceUsage API
// response for the minimum and maximum allowed value for provisioned bandwidth.
ProvisionedBandwidthMibps *int32
// The provisioned IOPS of the share. This property is only for file shares created under Files Provisioned v2 account type.
// Please refer to the GetFileServiceUsage API response for the minimum and
// maximum allowed value for provisioned IOPS.
ProvisionedIops *int32
// The property is for NFS share only. The default is NoRootSquash.
RootSquash *RootSquashType
// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File
// Shares, the maximum size is 102400.
// The provisioned size of the share, in gibibytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large
// File Shares, the maximum size is 102400. For file shares created under Files
// Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and maximum allowed provisioned
// storage size.
ShareQuota *int32
// List of stored access policies specified on the share.
@ -1489,6 +1625,10 @@ type FileShareProperties struct {
// READ-ONLY; The deleted time if the share was deleted.
DeletedTime *time.Time
// READ-ONLY; The calculated burst IOPS of the share. This property is only for file shares created under Files Provisioned
// v2 account type.
IncludedBurstIops *int32
// READ-ONLY; Returns the date and time the share was last modified.
LastModifiedTime *time.Time
@ -1501,6 +1641,22 @@ type FileShareProperties struct {
// READ-ONLY; The lease status of the share.
LeaseStatus *LeaseStatus
// READ-ONLY; The calculated maximum burst credits for the share. This property is only for file shares created under Files
// Provisioned v2 account type.
MaxBurstCreditsForIops *int64
// READ-ONLY; Returns the next allowed provisioned bandwidth downgrade time for the share. This property is only for file
// shares created under Files Provisioned v2 account type.
NextAllowedProvisionedBandwidthDowngradeTime *time.Time
// READ-ONLY; Returns the next allowed provisioned IOPS downgrade time for the share. This property is only for file shares
// created under Files Provisioned v2 account type.
NextAllowedProvisionedIopsDowngradeTime *time.Time
// READ-ONLY; Returns the next allowed provisioned storage size downgrade time for the share. This property is only for file
// shares created under Files Provisioned v1 SSD and Files Provisioned v2 account type
NextAllowedQuotaDowngradeTime *time.Time
// READ-ONLY; Remaining retention days for share that was soft deleted.
RemainingRetentionDays *int32
@ -1515,6 +1671,39 @@ type FileShareProperties struct {
Version *string
}
// FileSharePropertiesFileSharePaidBursting - File Share Paid Bursting properties.
type FileSharePropertiesFileSharePaidBursting struct {
// Indicates whether paid bursting is enabled for the share. This property is only for file shares created under Files Provisioned
// v1 SSD account type.
PaidBurstingEnabled *bool
// The maximum paid bursting bandwidth for the share, in mebibytes per second. This property is only for file shares created
// under Files Provisioned v1 SSD account type. The maximum allowed value is
// 10340 which is the maximum allowed bandwidth for a share.
PaidBurstingMaxBandwidthMibps *int32
// The maximum paid bursting IOPS for the share. This property is only for file shares created under Files Provisioned v1
// SSD account type. The maximum allowed value is 102400 which is the maximum
// allowed IOPS for a share.
PaidBurstingMaxIops *int32
}
// FileShareRecommendations - Constants used for calculating recommended provisioned IOPS and bandwidth for a file share in
// the storage account.
type FileShareRecommendations struct {
// READ-ONLY; The scalar for bandwidth in the file share provisioned bandwidth recommendation formula.
BandwidthScalar *float64
// READ-ONLY; The base bandwidth in the file share provisioned bandwidth recommendation formula.
BaseBandwidthMiBPerSec *int32
// READ-ONLY; The base IOPS in the file share provisioned IOPS recommendation formula.
BaseIOPS *int32
// READ-ONLY; The scalar for IO in the file share provisioned IOPS recommendation formula.
IoScalar *float64
}
// 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.
type GeoReplicationStats struct {
@ -1544,11 +1733,12 @@ type GeoReplicationStats struct {
// IPRule - IP rule with specific IP or IP range in CIDR format.
type IPRule struct {
// CONSTANT; The action of IP ACL rule.
// Field has constant value "Allow", any specified value is ignored.
Action *string
// REQUIRED; Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed.
IPAddressOrRange *string
// The action of IP ACL rule.
Action *string
}
// Identity for the resource.
@ -2035,7 +2225,7 @@ type ManagementPolicyFilter struct {
// ManagementPolicyProperties - The Storage Account ManagementPolicy properties.
type ManagementPolicyProperties struct {
// REQUIRED; The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
// REQUIRED; The Storage Account ManagementPolicy, in JSON format. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview.
Policy *ManagementPolicySchema
// READ-ONLY; Returns the date and time the ManagementPolicies was last modified.
@ -2058,9 +2248,9 @@ type ManagementPolicyRule struct {
Enabled *bool
}
// ManagementPolicySchema - The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
// ManagementPolicySchema - The Storage Account ManagementPolicies Rules. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview.
type ManagementPolicySchema struct {
// REQUIRED; The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
// REQUIRED; The Storage Account ManagementPolicies Rules. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview.
Rules []*ManagementPolicyRule
}
@ -2314,6 +2504,9 @@ type ObjectReplicationPolicyProperties struct {
// REQUIRED; Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false.
SourceAccount *string
// Optional. The object replication policy metrics feature options.
Metrics *ObjectReplicationPolicyPropertiesMetrics
// The storage account object replication rules.
Rules []*ObjectReplicationPolicyRule
@ -2324,6 +2517,12 @@ type ObjectReplicationPolicyProperties struct {
PolicyID *string
}
// ObjectReplicationPolicyPropertiesMetrics - Optional. The object replication policy metrics feature options.
type ObjectReplicationPolicyPropertiesMetrics struct {
// Indicates whether object replication metrics feature is enabled for the policy.
Enabled *bool
}
// ObjectReplicationPolicyRule - The replication policy rule between two containers.
type ObjectReplicationPolicyRule struct {
// REQUIRED; Required. Destination container name.
@ -3087,27 +3286,27 @@ type TaskReportInstance struct {
type TaskReportProperties struct {
// READ-ONLY; End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison
// operators can be used as described for DateTime properties in
// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
// https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
FinishTime *string
// READ-ONLY; Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount
// eq 0 and other comparison operators can be used as described for Numerical properties
// in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
// in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
ObjectFailedCount *string
// READ-ONLY; Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as
// objectsOperatedOnCount ge 100 and other comparison operators can be used as described for
// Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
// Numerical properties in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
ObjectsOperatedOnCount *string
// READ-ONLY; Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount
// gt 150 and other comparison operators can be used as described for Numerical
// properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
// properties in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
ObjectsSucceededCount *string
// READ-ONLY; Total number of objects that meet the condition as defined in the storage task assignment execution context.
// Filter options such as objectsTargetedCount gt 50 and other comparison operators can be
// used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
// used as described for Numerical properties in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
ObjectsTargetedCount *string
// READ-ONLY; Represents the overall result of the execution for the run instance
@ -3121,7 +3320,7 @@ type TaskReportProperties struct {
// READ-ONLY; Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other
// comparison operators can be used as described for DateTime properties in
// https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
// https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators
StartTime *string
// READ-ONLY; Represents the Storage Account Id where the storage task definition was applied and executed.
@ -3172,6 +3371,12 @@ type TrackedResource struct {
// TriggerParameters - The trigger parameters update for the storage task assignment execution
type TriggerParameters struct {
// CONSTANT; Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule';
// this property should not be present when ExecutionTrigger.properties.type is
// 'RunOnce'
// Field has constant value "Days", any specified value is ignored.
IntervalUnit *string
// When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property
// should not be present when ExecutionTrigger.properties.type is 'RunOnce'
EndBy *time.Time
@ -3180,11 +3385,6 @@ type TriggerParameters struct {
// should not be present when ExecutionTrigger.properties.type is 'RunOnce'
Interval *int32
// Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this
// property should not be present when ExecutionTrigger.properties.type is
// 'RunOnce'
IntervalUnit *string
// When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property
// should not be present when ExecutionTrigger.properties.type is 'RunOnce'
StartFrom *time.Time
@ -3196,6 +3396,12 @@ type TriggerParameters struct {
// TriggerParametersUpdate - The trigger parameters update for the storage task assignment execution
type TriggerParametersUpdate struct {
// CONSTANT; Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule';
// this property should not be present when ExecutionTrigger.properties.type is
// 'RunOnce'
// Field has constant value "Days", any specified value is ignored.
IntervalUnit *string
// When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property
// should not be present when ExecutionTrigger.properties.type is 'RunOnce'
EndBy *time.Time
@ -3204,11 +3410,6 @@ type TriggerParametersUpdate struct {
// should not be present when ExecutionTrigger.properties.type is 'RunOnce'
Interval *int32
// Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this
// property should not be present when ExecutionTrigger.properties.type is
// 'RunOnce'
IntervalUnit *string
// When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property
// should not be present when ExecutionTrigger.properties.type is 'RunOnce'
StartFrom *time.Time
@ -3293,12 +3494,13 @@ type UserAssignedIdentity struct {
// VirtualNetworkRule - Virtual Network rule.
type VirtualNetworkRule struct {
// CONSTANT; The action of virtual network rule.
// Field has constant value "Allow", any specified value is ignored.
Action *string
// REQUIRED; Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
VirtualNetworkResourceID *string
// The action of virtual network rule.
Action *string
// Gets the state of virtual network rule.
State *State
}

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -308,6 +305,45 @@ func (a *AccountKey) UnmarshalJSON(data []byte) error {
return nil
}
// MarshalJSON implements the json.Marshaller interface for type AccountLimits.
func (a AccountLimits) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "maxFileShares", a.MaxFileShares)
populate(objectMap, "maxProvisionedBandwidthMiBPerSec", a.MaxProvisionedBandwidthMiBPerSec)
populate(objectMap, "maxProvisionedIOPS", a.MaxProvisionedIOPS)
populate(objectMap, "maxProvisionedStorageGiB", a.MaxProvisionedStorageGiB)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AccountLimits.
func (a *AccountLimits) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "maxFileShares":
err = unpopulate(val, "MaxFileShares", &a.MaxFileShares)
delete(rawMsg, key)
case "maxProvisionedBandwidthMiBPerSec":
err = unpopulate(val, "MaxProvisionedBandwidthMiBPerSec", &a.MaxProvisionedBandwidthMiBPerSec)
delete(rawMsg, key)
case "maxProvisionedIOPS":
err = unpopulate(val, "MaxProvisionedIOPS", &a.MaxProvisionedIOPS)
delete(rawMsg, key)
case "maxProvisionedStorageGiB":
err = unpopulate(val, "MaxProvisionedStorageGiB", &a.MaxProvisionedStorageGiB)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type AccountListKeysResult.
func (a AccountListKeysResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
@ -1072,6 +1108,76 @@ func (a *AccountUpdateParameters) UnmarshalJSON(data []byte) error {
return nil
}
// MarshalJSON implements the json.Marshaller interface for type AccountUsage.
func (a AccountUsage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "liveShares", a.LiveShares)
populate(objectMap, "softDeletedShares", a.SoftDeletedShares)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AccountUsage.
func (a *AccountUsage) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "liveShares":
err = unpopulate(val, "LiveShares", &a.LiveShares)
delete(rawMsg, key)
case "softDeletedShares":
err = unpopulate(val, "SoftDeletedShares", &a.SoftDeletedShares)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type AccountUsageElements.
func (a AccountUsageElements) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "fileShareCount", a.FileShareCount)
populate(objectMap, "provisionedBandwidthMiBPerSec", a.ProvisionedBandwidthMiBPerSec)
populate(objectMap, "provisionedIOPS", a.ProvisionedIOPS)
populate(objectMap, "provisionedStorageGiB", a.ProvisionedStorageGiB)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AccountUsageElements.
func (a *AccountUsageElements) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "fileShareCount":
err = unpopulate(val, "FileShareCount", &a.FileShareCount)
delete(rawMsg, key)
case "provisionedBandwidthMiBPerSec":
err = unpopulate(val, "ProvisionedBandwidthMiBPerSec", &a.ProvisionedBandwidthMiBPerSec)
delete(rawMsg, key)
case "provisionedIOPS":
err = unpopulate(val, "ProvisionedIOPS", &a.ProvisionedIOPS)
delete(rawMsg, key)
case "provisionedStorageGiB":
err = unpopulate(val, "ProvisionedStorageGiB", &a.ProvisionedStorageGiB)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ActiveDirectoryProperties.
func (a ActiveDirectoryProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
@ -1747,6 +1853,41 @@ func (b *BlobServicePropertiesProperties) UnmarshalJSON(data []byte) error {
return nil
}
// MarshalJSON implements the json.Marshaller interface for type BurstingConstants.
func (b BurstingConstants) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "burstFloorIOPS", b.BurstFloorIOPS)
populate(objectMap, "burstIOScalar", b.BurstIOScalar)
populate(objectMap, "burstTimeframeSeconds", b.BurstTimeframeSeconds)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type BurstingConstants.
func (b *BurstingConstants) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", b, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "burstFloorIOPS":
err = unpopulate(val, "BurstFloorIOPS", &b.BurstFloorIOPS)
delete(rawMsg, key)
case "burstIOScalar":
err = unpopulate(val, "BurstIOScalar", &b.BurstIOScalar)
delete(rawMsg, key)
case "burstTimeframeSeconds":
err = unpopulate(val, "BurstTimeframeSeconds", &b.BurstTimeframeSeconds)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", b, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ChangeFeed.
func (c ChangeFeed) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
@ -3036,6 +3177,119 @@ func (f *FileServicePropertiesProperties) UnmarshalJSON(data []byte) error {
return nil
}
// MarshalJSON implements the json.Marshaller interface for type FileServiceUsage.
func (f FileServiceUsage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", f.ID)
populate(objectMap, "name", f.Name)
populate(objectMap, "properties", f.Properties)
populate(objectMap, "type", f.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceUsage.
func (f *FileServiceUsage) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &f.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &f.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &f.Properties)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &f.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type FileServiceUsageProperties.
func (f FileServiceUsageProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "burstingConstants", f.BurstingConstants)
populate(objectMap, "fileShareLimits", f.FileShareLimits)
populate(objectMap, "fileShareRecommendations", f.FileShareRecommendations)
populate(objectMap, "storageAccountLimits", f.StorageAccountLimits)
populate(objectMap, "storageAccountUsage", f.StorageAccountUsage)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceUsageProperties.
func (f *FileServiceUsageProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "burstingConstants":
err = unpopulate(val, "BurstingConstants", &f.BurstingConstants)
delete(rawMsg, key)
case "fileShareLimits":
err = unpopulate(val, "FileShareLimits", &f.FileShareLimits)
delete(rawMsg, key)
case "fileShareRecommendations":
err = unpopulate(val, "FileShareRecommendations", &f.FileShareRecommendations)
delete(rawMsg, key)
case "storageAccountLimits":
err = unpopulate(val, "StorageAccountLimits", &f.StorageAccountLimits)
delete(rawMsg, key)
case "storageAccountUsage":
err = unpopulate(val, "StorageAccountUsage", &f.StorageAccountUsage)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type FileServiceUsages.
func (f FileServiceUsages) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", f.NextLink)
populate(objectMap, "value", f.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceUsages.
func (f *FileServiceUsages) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &f.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &f.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type FileShare.
func (f FileShare) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
@ -3153,6 +3407,53 @@ func (f *FileShareItems) UnmarshalJSON(data []byte) error {
return nil
}
// MarshalJSON implements the json.Marshaller interface for type FileShareLimits.
func (f FileShareLimits) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "maxProvisionedBandwidthMiBPerSec", f.MaxProvisionedBandwidthMiBPerSec)
populate(objectMap, "maxProvisionedIOPS", f.MaxProvisionedIOPS)
populate(objectMap, "maxProvisionedStorageGiB", f.MaxProvisionedStorageGiB)
populate(objectMap, "minProvisionedBandwidthMiBPerSec", f.MinProvisionedBandwidthMiBPerSec)
populate(objectMap, "minProvisionedIOPS", f.MinProvisionedIOPS)
populate(objectMap, "minProvisionedStorageGiB", f.MinProvisionedStorageGiB)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareLimits.
func (f *FileShareLimits) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "maxProvisionedBandwidthMiBPerSec":
err = unpopulate(val, "MaxProvisionedBandwidthMiBPerSec", &f.MaxProvisionedBandwidthMiBPerSec)
delete(rawMsg, key)
case "maxProvisionedIOPS":
err = unpopulate(val, "MaxProvisionedIOPS", &f.MaxProvisionedIOPS)
delete(rawMsg, key)
case "maxProvisionedStorageGiB":
err = unpopulate(val, "MaxProvisionedStorageGiB", &f.MaxProvisionedStorageGiB)
delete(rawMsg, key)
case "minProvisionedBandwidthMiBPerSec":
err = unpopulate(val, "MinProvisionedBandwidthMiBPerSec", &f.MinProvisionedBandwidthMiBPerSec)
delete(rawMsg, key)
case "minProvisionedIOPS":
err = unpopulate(val, "MinProvisionedIOPS", &f.MinProvisionedIOPS)
delete(rawMsg, key)
case "minProvisionedStorageGiB":
err = unpopulate(val, "MinProvisionedStorageGiB", &f.MinProvisionedStorageGiB)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type FileShareProperties.
func (f FileShareProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
@ -3162,11 +3463,19 @@ func (f FileShareProperties) MarshalJSON() ([]byte, error) {
populate(objectMap, "deleted", f.Deleted)
populateDateTimeRFC3339(objectMap, "deletedTime", f.DeletedTime)
populate(objectMap, "enabledProtocols", f.EnabledProtocols)
populate(objectMap, "fileSharePaidBursting", f.FileSharePaidBursting)
populate(objectMap, "includedBurstIops", f.IncludedBurstIops)
populateDateTimeRFC3339(objectMap, "lastModifiedTime", f.LastModifiedTime)
populate(objectMap, "leaseDuration", f.LeaseDuration)
populate(objectMap, "leaseState", f.LeaseState)
populate(objectMap, "leaseStatus", f.LeaseStatus)
populate(objectMap, "maxBurstCreditsForIops", f.MaxBurstCreditsForIops)
populate(objectMap, "metadata", f.Metadata)
populateDateTimeRFC1123(objectMap, "nextAllowedProvisionedBandwidthDowngradeTime", f.NextAllowedProvisionedBandwidthDowngradeTime)
populateDateTimeRFC1123(objectMap, "nextAllowedProvisionedIopsDowngradeTime", f.NextAllowedProvisionedIopsDowngradeTime)
populateDateTimeRFC1123(objectMap, "nextAllowedQuotaDowngradeTime", f.NextAllowedQuotaDowngradeTime)
populate(objectMap, "provisionedBandwidthMibps", f.ProvisionedBandwidthMibps)
populate(objectMap, "provisionedIops", f.ProvisionedIops)
populate(objectMap, "remainingRetentionDays", f.RemainingRetentionDays)
populate(objectMap, "rootSquash", f.RootSquash)
populate(objectMap, "shareQuota", f.ShareQuota)
@ -3204,6 +3513,12 @@ func (f *FileShareProperties) UnmarshalJSON(data []byte) error {
case "enabledProtocols":
err = unpopulate(val, "EnabledProtocols", &f.EnabledProtocols)
delete(rawMsg, key)
case "fileSharePaidBursting":
err = unpopulate(val, "FileSharePaidBursting", &f.FileSharePaidBursting)
delete(rawMsg, key)
case "includedBurstIops":
err = unpopulate(val, "IncludedBurstIops", &f.IncludedBurstIops)
delete(rawMsg, key)
case "lastModifiedTime":
err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &f.LastModifiedTime)
delete(rawMsg, key)
@ -3216,9 +3531,27 @@ func (f *FileShareProperties) UnmarshalJSON(data []byte) error {
case "leaseStatus":
err = unpopulate(val, "LeaseStatus", &f.LeaseStatus)
delete(rawMsg, key)
case "maxBurstCreditsForIops":
err = unpopulate(val, "MaxBurstCreditsForIops", &f.MaxBurstCreditsForIops)
delete(rawMsg, key)
case "metadata":
err = unpopulate(val, "Metadata", &f.Metadata)
delete(rawMsg, key)
case "nextAllowedProvisionedBandwidthDowngradeTime":
err = unpopulateDateTimeRFC1123(val, "NextAllowedProvisionedBandwidthDowngradeTime", &f.NextAllowedProvisionedBandwidthDowngradeTime)
delete(rawMsg, key)
case "nextAllowedProvisionedIopsDowngradeTime":
err = unpopulateDateTimeRFC1123(val, "NextAllowedProvisionedIopsDowngradeTime", &f.NextAllowedProvisionedIopsDowngradeTime)
delete(rawMsg, key)
case "nextAllowedQuotaDowngradeTime":
err = unpopulateDateTimeRFC1123(val, "NextAllowedQuotaDowngradeTime", &f.NextAllowedQuotaDowngradeTime)
delete(rawMsg, key)
case "provisionedBandwidthMibps":
err = unpopulate(val, "ProvisionedBandwidthMibps", &f.ProvisionedBandwidthMibps)
delete(rawMsg, key)
case "provisionedIops":
err = unpopulate(val, "ProvisionedIops", &f.ProvisionedIops)
delete(rawMsg, key)
case "remainingRetentionDays":
err = unpopulate(val, "RemainingRetentionDays", &f.RemainingRetentionDays)
delete(rawMsg, key)
@ -3248,6 +3581,80 @@ func (f *FileShareProperties) UnmarshalJSON(data []byte) error {
return nil
}
// MarshalJSON implements the json.Marshaller interface for type FileSharePropertiesFileSharePaidBursting.
func (f FileSharePropertiesFileSharePaidBursting) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "paidBurstingEnabled", f.PaidBurstingEnabled)
populate(objectMap, "paidBurstingMaxBandwidthMibps", f.PaidBurstingMaxBandwidthMibps)
populate(objectMap, "paidBurstingMaxIops", f.PaidBurstingMaxIops)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type FileSharePropertiesFileSharePaidBursting.
func (f *FileSharePropertiesFileSharePaidBursting) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "paidBurstingEnabled":
err = unpopulate(val, "PaidBurstingEnabled", &f.PaidBurstingEnabled)
delete(rawMsg, key)
case "paidBurstingMaxBandwidthMibps":
err = unpopulate(val, "PaidBurstingMaxBandwidthMibps", &f.PaidBurstingMaxBandwidthMibps)
delete(rawMsg, key)
case "paidBurstingMaxIops":
err = unpopulate(val, "PaidBurstingMaxIops", &f.PaidBurstingMaxIops)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type FileShareRecommendations.
func (f FileShareRecommendations) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "bandwidthScalar", f.BandwidthScalar)
populate(objectMap, "baseBandwidthMiBPerSec", f.BaseBandwidthMiBPerSec)
populate(objectMap, "baseIOPS", f.BaseIOPS)
populate(objectMap, "ioScalar", f.IoScalar)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareRecommendations.
func (f *FileShareRecommendations) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "bandwidthScalar":
err = unpopulate(val, "BandwidthScalar", &f.BandwidthScalar)
delete(rawMsg, key)
case "baseBandwidthMiBPerSec":
err = unpopulate(val, "BaseBandwidthMiBPerSec", &f.BaseBandwidthMiBPerSec)
delete(rawMsg, key)
case "baseIOPS":
err = unpopulate(val, "BaseIOPS", &f.BaseIOPS)
delete(rawMsg, key)
case "ioScalar":
err = unpopulate(val, "IoScalar", &f.IoScalar)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", f, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type GeoReplicationStats.
func (g GeoReplicationStats) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
@ -5378,6 +5785,7 @@ func (o ObjectReplicationPolicyProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "destinationAccount", o.DestinationAccount)
populateDateTimeRFC3339(objectMap, "enabledTime", o.EnabledTime)
populate(objectMap, "metrics", o.Metrics)
populate(objectMap, "policyId", o.PolicyID)
populate(objectMap, "rules", o.Rules)
populate(objectMap, "sourceAccount", o.SourceAccount)
@ -5399,6 +5807,9 @@ func (o *ObjectReplicationPolicyProperties) UnmarshalJSON(data []byte) error {
case "enabledTime":
err = unpopulateDateTimeRFC3339(val, "EnabledTime", &o.EnabledTime)
delete(rawMsg, key)
case "metrics":
err = unpopulate(val, "Metrics", &o.Metrics)
delete(rawMsg, key)
case "policyId":
err = unpopulate(val, "PolicyID", &o.PolicyID)
delete(rawMsg, key)
@ -5416,6 +5827,33 @@ func (o *ObjectReplicationPolicyProperties) UnmarshalJSON(data []byte) error {
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyPropertiesMetrics.
func (o ObjectReplicationPolicyPropertiesMetrics) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "enabled", o.Enabled)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyPropertiesMetrics.
func (o *ObjectReplicationPolicyPropertiesMetrics) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "enabled":
err = unpopulate(val, "Enabled", &o.Enabled)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyRule.
func (o ObjectReplicationPolicyRule) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, cred
// Get - Gets effective NetworkSecurityPerimeterConfiguration for association
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -76,7 +73,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) Get(ctx context.Cont
}
// getCreateRequest creates the Get request.
func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientGetOptions) (*policy.Request, error) {
func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, _ *NetworkSecurityPerimeterConfigurationsClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -99,7 +96,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -116,7 +113,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) getHandleResponse(re
// NewListPager - Gets list of effective NetworkSecurityPerimeterConfiguration for storage account
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -147,7 +144,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) NewListPager(resourc
}
// listCreateRequest creates the List request.
func (client *NetworkSecurityPerimeterConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *NetworkSecurityPerimeterConfigurationsClientListOptions) (*policy.Request, error) {
func (client *NetworkSecurityPerimeterConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *NetworkSecurityPerimeterConfigurationsClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -166,7 +163,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) listCreateRequest(ct
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -184,7 +181,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) listHandleResponse(r
// BeginReconcile - Refreshes any information about the association.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -212,7 +209,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) BeginReconcile(ctx c
// Reconcile - Refreshes any information about the association.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *NetworkSecurityPerimeterConfigurationsClient) reconcile(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*http.Response, error) {
var err error
const operationName = "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile"
@ -235,7 +232,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) reconcile(ctx contex
}
// reconcileCreateRequest creates the Reconcile request.
func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*policy.Request, error) {
func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, _ *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -258,7 +255,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateReque
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewObjectReplicationPoliciesClient(subscriptionID string, credential azcore
// CreateOrUpdate - Create or update the object replication policy of the storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -79,7 +76,7 @@ func (client *ObjectReplicationPoliciesClient) CreateOrUpdate(ctx context.Contex
}
// createOrUpdateCreateRequest creates the CreateOrUpdate request.
func (client *ObjectReplicationPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, properties ObjectReplicationPolicy, options *ObjectReplicationPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
func (client *ObjectReplicationPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, properties ObjectReplicationPolicy, _ *ObjectReplicationPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -102,7 +99,7 @@ func (client *ObjectReplicationPoliciesClient) createOrUpdateCreateRequest(ctx c
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, properties); err != nil {
@ -123,7 +120,7 @@ func (client *ObjectReplicationPoliciesClient) createOrUpdateHandleResponse(resp
// Delete - Deletes the object replication policy associated with the specified storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -154,7 +151,7 @@ func (client *ObjectReplicationPoliciesClient) Delete(ctx context.Context, resou
}
// deleteCreateRequest creates the Delete request.
func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, options *ObjectReplicationPoliciesClientDeleteOptions) (*policy.Request, error) {
func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, _ *ObjectReplicationPoliciesClientDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -177,7 +174,7 @@ func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.C
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -186,7 +183,7 @@ func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.C
// Get - Get the object replication policy of the storage account by policy ID.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -218,7 +215,7 @@ func (client *ObjectReplicationPoliciesClient) Get(ctx context.Context, resource
}
// getCreateRequest creates the Get request.
func (client *ObjectReplicationPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, options *ObjectReplicationPoliciesClientGetOptions) (*policy.Request, error) {
func (client *ObjectReplicationPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, _ *ObjectReplicationPoliciesClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -241,7 +238,7 @@ func (client *ObjectReplicationPoliciesClient) getCreateRequest(ctx context.Cont
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -258,7 +255,7 @@ func (client *ObjectReplicationPoliciesClient) getHandleResponse(resp *http.Resp
// NewListPager - List the object replication policies associated with the storage account.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -289,7 +286,7 @@ func (client *ObjectReplicationPoliciesClient) NewListPager(resourceGroupName st
}
// listCreateRequest creates the List request.
func (client *ObjectReplicationPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *ObjectReplicationPoliciesClientListOptions) (*policy.Request, error) {
func (client *ObjectReplicationPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *ObjectReplicationPoliciesClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -308,7 +305,7 @@ func (client *ObjectReplicationPoliciesClient) listCreateRequest(ctx context.Con
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -39,7 +36,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO
// NewListPager - Lists all of the available Storage Rest API operations.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] {
return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{
@ -66,14 +63,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption
}
// listCreateRequest creates the List request.
func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) {
func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) {
urlPath := "/providers/Microsoft.Storage/operations"
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
if err != nil {
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -11,20 +8,20 @@ package armstorage
// AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginAbortHierarchicalNamespaceMigration
// method.
type AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions struct {
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
// AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method.
type AccountsClientBeginCreateOptions struct {
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
// AccountsClientBeginCustomerInitiatedMigrationOptions contains the optional parameters for the AccountsClient.BeginCustomerInitiatedMigration
// method.
type AccountsClientBeginCustomerInitiatedMigrationOptions struct {
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
@ -34,21 +31,21 @@ type AccountsClientBeginFailoverOptions struct {
// value to Planned.
FailoverType *string
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
// AccountsClientBeginHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginHierarchicalNamespaceMigration
// method.
type AccountsClientBeginHierarchicalNamespaceMigrationOptions struct {
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
// AccountsClientBeginRestoreBlobRangesOptions contains the optional parameters for the AccountsClient.BeginRestoreBlobRanges
// method.
type AccountsClientBeginRestoreBlobRangesOptions struct {
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
@ -122,7 +119,7 @@ type AccountsClientUpdateOptions struct {
// BlobContainersClientBeginObjectLevelWormOptions contains the optional parameters for the BlobContainersClient.BeginObjectLevelWorm
// method.
type BlobContainersClientBeginObjectLevelWormOptions struct {
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
@ -140,9 +137,9 @@ type BlobContainersClientCreateOptions struct {
// BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.CreateOrUpdateImmutabilityPolicy
// method.
type BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions struct {
// 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.
// The entity state (ETag) version of the immutability policy to update must be returned to the server for all update operations.
// The ETag value must include the leading and trailing double quotes as
// returned by the service.
IfMatch *string
// The ImmutabilityPolicy Properties that will be created or updated to a blob container.
@ -170,9 +167,9 @@ type BlobContainersClientExtendImmutabilityPolicyOptions struct {
// BlobContainersClientGetImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.GetImmutabilityPolicy
// method.
type BlobContainersClientGetImmutabilityPolicyOptions struct {
// 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.
// The entity state (ETag) version of the immutability policy to update must be returned to the server for all update operations.
// The ETag value must include the leading and trailing double quotes as
// returned by the service.
IfMatch *string
}
@ -297,11 +294,23 @@ type FileServicesClientGetServicePropertiesOptions struct {
// placeholder for future optional parameters
}
// FileServicesClientGetServiceUsageOptions contains the optional parameters for the FileServicesClient.GetServiceUsage method.
type FileServicesClientGetServiceUsageOptions struct {
// placeholder for future optional parameters
}
// FileServicesClientListOptions contains the optional parameters for the FileServicesClient.List method.
type FileServicesClientListOptions struct {
// placeholder for future optional parameters
}
// FileServicesClientListServiceUsagesOptions contains the optional parameters for the FileServicesClient.NewListServiceUsagesPager
// method.
type FileServicesClientListServiceUsagesOptions struct {
// Optional, specifies the maximum number of file service usages to be included in the list response.
Maxpagesize *int32
}
// FileServicesClientSetServicePropertiesOptions contains the optional parameters for the FileServicesClient.SetServiceProperties
// method.
type FileServicesClientSetServicePropertiesOptions struct {
@ -427,7 +436,7 @@ type ManagementPoliciesClientGetOptions struct {
// NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile
// method.
type NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions struct {
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
@ -601,8 +610,7 @@ type TableServicesClientSetServicePropertiesOptions struct {
// method.
type TaskAssignmentInstancesReportClientListOptions struct {
// Optional. When specified, it can be used to query using reporting properties. See Constructing Filter Strings
// [https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings] for
// details.
// [https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings] for details.
Filter *string
// Optional, specifies the maximum number of storage task assignment instances to be included in the list response.
@ -611,19 +619,19 @@ type TaskAssignmentInstancesReportClientListOptions struct {
// TaskAssignmentsClientBeginCreateOptions contains the optional parameters for the TaskAssignmentsClient.BeginCreate method.
type TaskAssignmentsClientBeginCreateOptions struct {
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
// TaskAssignmentsClientBeginDeleteOptions contains the optional parameters for the TaskAssignmentsClient.BeginDelete method.
type TaskAssignmentsClientBeginDeleteOptions struct {
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
// TaskAssignmentsClientBeginUpdateOptions contains the optional parameters for the TaskAssignmentsClient.BeginUpdate method.
type TaskAssignmentsClientBeginUpdateOptions struct {
// Resumes the LRO from the provided token.
// Resumes the long-running operation from the provided token.
ResumeToken string
}
@ -642,8 +650,7 @@ type TaskAssignmentsClientListOptions struct {
// method.
type TaskAssignmentsInstancesReportClientListOptions struct {
// Optional. When specified, it can be used to query using reporting properties. See Constructing Filter Strings
// [https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings] for
// details.
// [https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings] for details.
Filter *string
// Optional, specifies the maximum number of storage task assignment instances to be included in the list response.

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor
// Delete - Deletes the specified private endpoint connection associated with the storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -75,7 +72,7 @@ func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, reso
}
// deleteCreateRequest creates the Delete request.
func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) {
func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -98,7 +95,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -107,7 +104,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.
// Get - Gets the specified private endpoint connection associated with the storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -137,7 +134,7 @@ func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourc
}
// getCreateRequest creates the Get request.
func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) {
func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -160,7 +157,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -177,7 +174,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res
// NewListPager - List all the private endpoint connections associated with the storage account.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -208,7 +205,7 @@ func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName s
}
// listCreateRequest creates the List request.
func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) {
func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -227,7 +224,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -245,7 +242,7 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re
// Put - Update the state of specified private endpoint connection associated with the storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -276,7 +273,7 @@ func (client *PrivateEndpointConnectionsClient) Put(ctx context.Context, resourc
}
// putCreateRequest creates the Put request.
func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientPutOptions) (*policy.Request, error) {
func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientPutOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -299,7 +296,7 @@ func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Con
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, properties); err != nil {

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke
// ListByStorageAccount - Gets the private link resources that need to be created for a storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -75,7 +72,7 @@ func (client *PrivateLinkResourcesClient) ListByStorageAccount(ctx context.Conte
}
// listByStorageAccountCreateRequest creates the ListByStorageAccount request.
func (client *PrivateLinkResourcesClient) listByStorageAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListByStorageAccountOptions) (*policy.Request, error) {
func (client *PrivateLinkResourcesClient) listByStorageAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *PrivateLinkResourcesClientListByStorageAccountOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -94,7 +91,7 @@ func (client *PrivateLinkResourcesClient) listByStorageAccountCreateRequest(ctx
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewQueueClient(subscriptionID string, credential azcore.TokenCredential, op
// Create - Creates a new queue with the specified queue name, under the specified account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -78,7 +75,7 @@ func (client *QueueClient) Create(ctx context.Context, resourceGroupName string,
}
// createCreateRequest creates the Create request.
func (client *QueueClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientCreateOptions) (*policy.Request, error) {
func (client *QueueClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, _ *QueueClientCreateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -101,7 +98,7 @@ func (client *QueueClient) createCreateRequest(ctx context.Context, resourceGrou
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, queue); err != nil {
@ -122,7 +119,7 @@ func (client *QueueClient) createHandleResponse(resp *http.Response) (QueueClien
// Delete - Deletes the queue with the specified queue name, under the specified account if it exists.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -152,7 +149,7 @@ func (client *QueueClient) Delete(ctx context.Context, resourceGroupName string,
}
// deleteCreateRequest creates the Delete request.
func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, options *QueueClientDeleteOptions) (*policy.Request, error) {
func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, _ *QueueClientDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -175,7 +172,7 @@ func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGrou
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -184,7 +181,7 @@ func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGrou
// Get - Gets the queue with the specified queue name, under the specified account if it exists.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -215,7 +212,7 @@ func (client *QueueClient) Get(ctx context.Context, resourceGroupName string, ac
}
// getCreateRequest creates the Get request.
func (client *QueueClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, options *QueueClientGetOptions) (*policy.Request, error) {
func (client *QueueClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, _ *QueueClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -238,7 +235,7 @@ func (client *QueueClient) getCreateRequest(ctx context.Context, resourceGroupNa
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -255,7 +252,7 @@ func (client *QueueClient) getHandleResponse(resp *http.Response) (QueueClientGe
// NewListPager - Gets a list of all the queues under the specified storage account
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -309,7 +306,7 @@ func (client *QueueClient) listCreateRequest(ctx context.Context, resourceGroupN
if options != nil && options.Maxpagesize != nil {
reqQP.Set("$maxpagesize", *options.Maxpagesize)
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -327,7 +324,7 @@ func (client *QueueClient) listHandleResponse(resp *http.Response) (QueueClientL
// Update - Creates a new queue with the specified queue name, under the specified account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -359,7 +356,7 @@ func (client *QueueClient) Update(ctx context.Context, resourceGroupName string,
}
// updateCreateRequest creates the Update request.
func (client *QueueClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientUpdateOptions) (*policy.Request, error) {
func (client *QueueClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, _ *QueueClientUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -382,7 +379,7 @@ func (client *QueueClient) updateCreateRequest(ctx context.Context, resourceGrou
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, queue); err != nil {

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -47,7 +44,7 @@ func NewQueueServicesClient(subscriptionID string, credential azcore.TokenCreden
// and CORS (Cross-Origin Resource Sharing) rules.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -76,7 +73,7 @@ func (client *QueueServicesClient) GetServiceProperties(ctx context.Context, res
}
// getServicePropertiesCreateRequest creates the GetServiceProperties request.
func (client *QueueServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *QueueServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
func (client *QueueServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *QueueServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -96,7 +93,7 @@ func (client *QueueServicesClient) getServicePropertiesCreateRequest(ctx context
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -114,7 +111,7 @@ func (client *QueueServicesClient) getServicePropertiesHandleResponse(resp *http
// List - List all queue services for the storage account
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -142,7 +139,7 @@ func (client *QueueServicesClient) List(ctx context.Context, resourceGroupName s
}
// listCreateRequest creates the List request.
func (client *QueueServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *QueueServicesClientListOptions) (*policy.Request, error) {
func (client *QueueServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *QueueServicesClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -161,7 +158,7 @@ func (client *QueueServicesClient) listCreateRequest(ctx context.Context, resour
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -180,7 +177,7 @@ func (client *QueueServicesClient) listHandleResponse(resp *http.Response) (Queu
// and CORS (Cross-Origin Resource Sharing) rules.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -211,7 +208,7 @@ func (client *QueueServicesClient) SetServiceProperties(ctx context.Context, res
}
// setServicePropertiesCreateRequest creates the SetServiceProperties request.
func (client *QueueServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters QueueServiceProperties, options *QueueServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
func (client *QueueServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters QueueServiceProperties, _ *QueueServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -231,7 +228,7 @@ func (client *QueueServicesClient) setServicePropertiesCreateRequest(ctx context
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -290,11 +287,23 @@ type FileServicesClientGetServicePropertiesResponse struct {
FileServiceProperties
}
// FileServicesClientGetServiceUsageResponse contains the response from method FileServicesClient.GetServiceUsage.
type FileServicesClientGetServiceUsageResponse struct {
// The usage of file service in storage account.
FileServiceUsage
}
// FileServicesClientListResponse contains the response from method FileServicesClient.List.
type FileServicesClientListResponse struct {
FileServiceItems
}
// FileServicesClientListServiceUsagesResponse contains the response from method FileServicesClient.NewListServiceUsagesPager.
type FileServicesClientListServiceUsagesResponse struct {
// List file service usages schema.
FileServiceUsages
}
// FileServicesClientSetServicePropertiesResponse contains the response from method FileServicesClient.SetServiceProperties.
type FileServicesClientSetServicePropertiesResponse struct {
// The properties of File services in storage account.

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -45,7 +42,7 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt
// NewListPager - Lists the available SKUs supported by Microsoft.Storage for given subscription.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - options - SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method.
func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] {
return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{
@ -72,7 +69,7 @@ func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.
}
// listCreateRequest creates the List request.
func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsClientListOptions) (*policy.Request, error) {
func (client *SKUsClient) listCreateRequest(ctx context.Context, _ *SKUsClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -83,7 +80,7 @@ func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsCl
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewTableClient(subscriptionID string, credential azcore.TokenCredential, op
// Create - Creates a new table with the specified table name, under the specified account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -99,7 +96,7 @@ func (client *TableClient) createCreateRequest(ctx context.Context, resourceGrou
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if options != nil && options.Parameters != nil {
@ -123,7 +120,7 @@ func (client *TableClient) createHandleResponse(resp *http.Response) (TableClien
// Delete - Deletes the table with the specified table name, under the specified account if it exists.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -152,7 +149,7 @@ func (client *TableClient) Delete(ctx context.Context, resourceGroupName string,
}
// deleteCreateRequest creates the Delete request.
func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientDeleteOptions) (*policy.Request, error) {
func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, _ *TableClientDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -175,7 +172,7 @@ func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGrou
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -184,7 +181,7 @@ func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGrou
// Get - Gets the table with the specified table name, under the specified account if it exists.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -214,7 +211,7 @@ func (client *TableClient) Get(ctx context.Context, resourceGroupName string, ac
}
// getCreateRequest creates the Get request.
func (client *TableClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientGetOptions) (*policy.Request, error) {
func (client *TableClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, _ *TableClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -237,7 +234,7 @@ func (client *TableClient) getCreateRequest(ctx context.Context, resourceGroupNa
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -254,7 +251,7 @@ func (client *TableClient) getHandleResponse(resp *http.Response) (TableClientGe
// NewListPager - Gets a list of all the tables under the specified storage account
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -283,7 +280,7 @@ func (client *TableClient) NewListPager(resourceGroupName string, accountName st
}
// listCreateRequest creates the List request.
func (client *TableClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TableClientListOptions) (*policy.Request, error) {
func (client *TableClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *TableClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -302,7 +299,7 @@ func (client *TableClient) listCreateRequest(ctx context.Context, resourceGroupN
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -320,7 +317,7 @@ func (client *TableClient) listHandleResponse(resp *http.Response) (TableClientL
// Update - Creates a new table with the specified table name, under the specified account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -373,7 +370,7 @@ func (client *TableClient) updateCreateRequest(ctx context.Context, resourceGrou
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if options != nil && options.Parameters != nil {

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -47,7 +44,7 @@ func NewTableServicesClient(subscriptionID string, credential azcore.TokenCreden
// and CORS (Cross-Origin Resource Sharing) rules.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -76,7 +73,7 @@ func (client *TableServicesClient) GetServiceProperties(ctx context.Context, res
}
// getServicePropertiesCreateRequest creates the GetServiceProperties request.
func (client *TableServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TableServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
func (client *TableServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *TableServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -96,7 +93,7 @@ func (client *TableServicesClient) getServicePropertiesCreateRequest(ctx context
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -114,7 +111,7 @@ func (client *TableServicesClient) getServicePropertiesHandleResponse(resp *http
// List - List all table services for the storage account.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -142,7 +139,7 @@ func (client *TableServicesClient) List(ctx context.Context, resourceGroupName s
}
// listCreateRequest creates the List request.
func (client *TableServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TableServicesClientListOptions) (*policy.Request, error) {
func (client *TableServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *TableServicesClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -161,7 +158,7 @@ func (client *TableServicesClient) listCreateRequest(ctx context.Context, resour
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -180,7 +177,7 @@ func (client *TableServicesClient) listHandleResponse(resp *http.Response) (Tabl
// and CORS (Cross-Origin Resource Sharing) rules.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
// - 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.
@ -211,7 +208,7 @@ func (client *TableServicesClient) SetServiceProperties(ctx context.Context, res
}
// setServicePropertiesCreateRequest creates the SetServiceProperties request.
func (client *TableServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters TableServiceProperties, options *TableServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
func (client *TableServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters TableServiceProperties, _ *TableServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}"
if resourceGroupName == "" {
return nil, errors.New("parameter resourceGroupName cannot be empty")
@ -231,7 +228,7 @@ func (client *TableServicesClient) setServicePropertiesCreateRequest(ctx context
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewTaskAssignmentInstancesReportClient(subscriptionID string, credential az
// NewListPager - Fetch the report summary of a single storage task assignment's instances
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - 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.
@ -107,7 +104,7 @@ func (client *TaskAssignmentInstancesReportClient) listCreateRequest(ctx context
if options != nil && options.Maxpagesize != nil {
reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -51,7 +48,7 @@ func NewTaskAssignmentsClient(subscriptionID string, credential azcore.TokenCred
// set of properties, the request will succeed.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - 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.
@ -85,7 +82,7 @@ func (client *TaskAssignmentsClient) BeginCreate(ctx context.Context, resourceGr
// set of properties, the request will succeed.
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *TaskAssignmentsClient) create(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignment, options *TaskAssignmentsClientBeginCreateOptions) (*http.Response, error) {
var err error
const operationName = "TaskAssignmentsClient.BeginCreate"
@ -108,7 +105,7 @@ func (client *TaskAssignmentsClient) create(ctx context.Context, resourceGroupNa
}
// createCreateRequest creates the Create request.
func (client *TaskAssignmentsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignment, options *TaskAssignmentsClientBeginCreateOptions) (*policy.Request, error) {
func (client *TaskAssignmentsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignment, _ *TaskAssignmentsClientBeginCreateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -131,7 +128,7 @@ func (client *TaskAssignmentsClient) createCreateRequest(ctx context.Context, re
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {
@ -143,7 +140,7 @@ func (client *TaskAssignmentsClient) createCreateRequest(ctx context.Context, re
// BeginDelete - Delete the storage task assignment sub-resource
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - 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.
@ -172,7 +169,7 @@ func (client *TaskAssignmentsClient) BeginDelete(ctx context.Context, resourceGr
// Delete - Delete the storage task assignment sub-resource
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *TaskAssignmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentsClientBeginDeleteOptions) (*http.Response, error) {
var err error
const operationName = "TaskAssignmentsClient.BeginDelete"
@ -195,7 +192,7 @@ func (client *TaskAssignmentsClient) deleteOperation(ctx context.Context, resour
}
// deleteCreateRequest creates the Delete request.
func (client *TaskAssignmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentsClientBeginDeleteOptions) (*policy.Request, error) {
func (client *TaskAssignmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, _ *TaskAssignmentsClientBeginDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -218,7 +215,7 @@ func (client *TaskAssignmentsClient) deleteCreateRequest(ctx context.Context, re
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -227,7 +224,7 @@ func (client *TaskAssignmentsClient) deleteCreateRequest(ctx context.Context, re
// Get - Get the storage task assignment properties
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - 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.
@ -257,7 +254,7 @@ func (client *TaskAssignmentsClient) Get(ctx context.Context, resourceGroupName
}
// getCreateRequest creates the Get request.
func (client *TaskAssignmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentsClientGetOptions) (*policy.Request, error) {
func (client *TaskAssignmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, _ *TaskAssignmentsClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -280,7 +277,7 @@ func (client *TaskAssignmentsClient) getCreateRequest(ctx context.Context, resou
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -297,7 +294,7 @@ func (client *TaskAssignmentsClient) getHandleResponse(resp *http.Response) (Tas
// NewListPager - List all the storage task assignments in an account
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - 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.
@ -349,7 +346,7 @@ func (client *TaskAssignmentsClient) listCreateRequest(ctx context.Context, reso
if options != nil && options.Maxpagesize != nil {
reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil
@ -367,7 +364,7 @@ func (client *TaskAssignmentsClient) listHandleResponse(resp *http.Response) (Ta
// BeginUpdate - Update storage task assignment properties
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - 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.
@ -397,7 +394,7 @@ func (client *TaskAssignmentsClient) BeginUpdate(ctx context.Context, resourceGr
// Update - Update storage task assignment properties
// If the operation fails it returns an *azcore.ResponseError type.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
func (client *TaskAssignmentsClient) update(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignmentUpdateParameters, options *TaskAssignmentsClientBeginUpdateOptions) (*http.Response, error) {
var err error
const operationName = "TaskAssignmentsClient.BeginUpdate"
@ -420,7 +417,7 @@ func (client *TaskAssignmentsClient) update(ctx context.Context, resourceGroupNa
}
// updateCreateRequest creates the Update request.
func (client *TaskAssignmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignmentUpdateParameters, options *TaskAssignmentsClientBeginUpdateOptions) (*policy.Request, error) {
func (client *TaskAssignmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignmentUpdateParameters, _ *TaskAssignmentsClientBeginUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -443,7 +440,7 @@ func (client *TaskAssignmentsClient) updateCreateRequest(ctx context.Context, re
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
if err := runtime.MarshalAsJSON(req, parameters); err != nil {

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -46,7 +43,7 @@ func NewTaskAssignmentsInstancesReportClient(subscriptionID string, credential a
// NewListPager - Fetch the report summary of all the storage task assignments and instances in an account
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - resourceGroupName - The name of the resource group. The name is case insensitive.
// - 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.
@ -101,7 +98,7 @@ func (client *TaskAssignmentsInstancesReportClient) listCreateRequest(ctx contex
if options != nil && options.Maxpagesize != nil {
reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
}
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -0,0 +1,74 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
package armstorage
import (
"encoding/json"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"reflect"
"strings"
"time"
)
const (
dateTimeRFC1123JSON = `"` + time.RFC1123 + `"`
)
type dateTimeRFC1123 time.Time
func (t dateTimeRFC1123) MarshalJSON() ([]byte, error) {
b := []byte(time.Time(t).Format(dateTimeRFC1123JSON))
return b, nil
}
func (t dateTimeRFC1123) MarshalText() ([]byte, error) {
b := []byte(time.Time(t).Format(time.RFC1123))
return b, nil
}
func (t *dateTimeRFC1123) UnmarshalJSON(data []byte) error {
p, err := time.Parse(dateTimeRFC1123JSON, strings.ToUpper(string(data)))
*t = dateTimeRFC1123(p)
return err
}
func (t *dateTimeRFC1123) UnmarshalText(data []byte) error {
if len(data) == 0 {
return nil
}
p, err := time.Parse(time.RFC1123, string(data))
*t = dateTimeRFC1123(p)
return err
}
func (t dateTimeRFC1123) String() string {
return time.Time(t).Format(time.RFC1123)
}
func populateDateTimeRFC1123(m map[string]any, k string, t *time.Time) {
if t == nil {
return
} else if azcore.IsNullValue(t) {
m[k] = nil
return
} else if reflect.ValueOf(t).IsNil() {
return
}
m[k] = (*dateTimeRFC1123)(t)
}
func unpopulateDateTimeRFC1123(data json.RawMessage, fn string, t **time.Time) error {
if data == nil || string(data) == "null" {
return nil
}
var aux dateTimeRFC1123
if err := json.Unmarshal(data, &aux); err != nil {
return fmt.Errorf("struct field %s: %v", fn, err)
}
*t = (*time.Time)(&aux)
return nil
}

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
}
func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
if len(data) == 0 {
return nil
}
tzOffset := tzOffsetRegex.Match(data)
hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t")
var layout string

View file

@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
@ -45,7 +42,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o
// NewListByLocationPager - Gets the current usage count and the limit for the resources of the location under the subscription.
//
// Generated from API version 2023-05-01
// Generated from API version 2024-01-01
// - location - The location of the Azure Storage resource.
// - options - UsagesClientListByLocationOptions contains the optional parameters for the UsagesClient.NewListByLocationPager
// method.
@ -74,7 +71,7 @@ func (client *UsagesClient) NewListByLocationPager(location string, options *Usa
}
// listByLocationCreateRequest creates the ListByLocation request.
func (client *UsagesClient) listByLocationCreateRequest(ctx context.Context, location string, options *UsagesClientListByLocationOptions) (*policy.Request, error) {
func (client *UsagesClient) listByLocationCreateRequest(ctx context.Context, location string, _ *UsagesClientListByLocationOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -89,7 +86,7 @@ func (client *UsagesClient) listByLocationCreateRequest(ctx context.Context, loc
return nil, err
}
reqQP := req.Raw().URL.Query()
reqQP.Set("api-version", "2023-05-01")
reqQP.Set("api-version", "2024-01-01")
req.Raw().URL.RawQuery = reqQP.Encode()
req.Raw().Header["Accept"] = []string{"application/json"}
return req, nil

View file

@ -1,5 +1,19 @@
# Release History
## 1.6.1 (2025-04-16)
### Bugs Fixed
* Fixed return value of DownloadBuffer when the HTTPRange count given is greater than the data length. Fixes [#23884](https://github.com/Azure/azure-sdk-for-go/issues/23884)
### Other Changes
* Updated `azidentity` version to `1.9.0`
* Updated `azcore` version to `1.18.0`
## 1.6.1-beta.1 (2025-02-12)
### Features Added
* Upgraded service version to `2025-05-05`.
## 1.6.0 (2025-01-23)
### Features Added

View file

@ -22,7 +22,7 @@ Key links:
### Prerequisites
- Go, version 1.18 or higher - [Install Go](https://go.dev/doc/install)
- [Supported](https://aka.ms/azsdk/go/supported-versions) version of Go - [Install Go](https://go.dev/doc/install)
- Azure subscription - [Create a free account](https://azure.microsoft.com/free/)
- Azure storage account - To create a storage account, use tools including the [Azure portal][storage_account_create_portal],
[Azure PowerShell][storage_account_create_ps], or the [Azure CLI][storage_account_create_cli].
@ -249,7 +249,7 @@ For more information see the [Code of Conduct FAQ][coc_faq]
or contact [opencode@microsoft.com][coc_contact] with any
additional questions or comments.
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-go%2Fsdk%2Fstorage%2Fazblob%2FREADME.png)
<!-- LINKS -->
[source]: https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/storage/azblob

View file

@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/storage/azblob",
"Tag": "go/storage/azblob_e5b4fd09a3"
"Tag": "go/storage/azblob_db9a368fe4"
}

View file

@ -11,6 +11,7 @@ import (
"io"
"os"
"sync"
"sync/atomic"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
@ -334,7 +335,8 @@ func (b *Client) downloadBuffer(ctx context.Context, writer io.WriterAt, o downl
if o.BlockSize == 0 {
o.BlockSize = DefaultDownloadBlockSize
}
dataDownloaded := int64(0)
computeReadLength := true
count := o.Range.Count
if count == CountToEnd { // If size not specified, calculate it
// If we don't have the length at all, get it
@ -343,6 +345,8 @@ func (b *Client) downloadBuffer(ctx context.Context, writer io.WriterAt, o downl
return 0, err
}
count = *gr.ContentLength - o.Range.Offset
dataDownloaded = count
computeReadLength = false
}
if count <= 0 {
@ -387,6 +391,9 @@ func (b *Client) downloadBuffer(ctx context.Context, writer io.WriterAt, o downl
if err != nil {
return err
}
if computeReadLength {
atomic.AddInt64(&dataDownloaded, *dr.ContentLength)
}
err = body.Close()
return err
},
@ -394,7 +401,7 @@ func (b *Client) downloadBuffer(ctx context.Context, writer io.WriterAt, o downl
if err != nil {
return 0, err
}
return count, nil
return dataDownloaded, nil
}
// DownloadStream reads a range of bytes from a blob. The response also includes the blob's properties and metadata.

View file

@ -8,5 +8,5 @@ package exported
const (
ModuleName = "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
ModuleVersion = "v1.6.0"
ModuleVersion = "v1.6.1"
)

View file

@ -67,7 +67,7 @@ directive:
$.items.enum.push("permissions");
```
### Updating service version to 2025-01-05
### Updating service version to 2025-05-05
```yaml
directive:
- from:
@ -80,7 +80,7 @@ directive:
where: $
transform: >-
return $.
replaceAll(`[]string{"2021-12-02"}`, `[]string{ServiceVersion}`);
replaceAll(`[]string{"2025-01-05"}`, `[]string{ServiceVersion}`);
```
### Fix CRC Response Header in PutBlob response

View file

@ -6,4 +6,4 @@
package generated
const ServiceVersion = "2025-01-05"
const ServiceVersion = "2025-05-05"

View file

@ -122,7 +122,7 @@ func (client *AppendBlobClient) appendBlockCreateRequest(ctx context.Context, co
if options != nil && options.StructuredContentLength != nil {
req.Raw().Header["x-ms-structured-content-length"] = []string{strconv.FormatInt(*options.StructuredContentLength, 10)}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if err := req.SetBody(body, "application/octet-stream"); err != nil {
return nil, err
}
@ -319,7 +319,7 @@ func (client *AppendBlobClient) appendBlockFromURLCreateRequest(ctx context.Cont
if options != nil && options.SourceRange != nil {
req.Raw().Header["x-ms-source-range"] = []string{*options.SourceRange}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -503,7 +503,7 @@ func (client *AppendBlobClient) createCreateRequest(ctx context.Context, content
if options != nil && options.BlobTagsString != nil {
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -624,7 +624,7 @@ func (client *AppendBlobClient) sealCreateRequest(ctx context.Context, options *
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}

View file

@ -72,7 +72,7 @@ func (client *BlobClient) abortCopyFromURLCreateRequest(ctx context.Context, cop
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -161,7 +161,7 @@ func (client *BlobClient) acquireLeaseCreateRequest(ctx context.Context, duratio
if options != nil && options.ProposedLeaseID != nil {
req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -259,7 +259,7 @@ func (client *BlobClient) breakLeaseCreateRequest(ctx context.Context, options *
if options != nil && options.BreakPeriod != nil {
req.Raw().Header["x-ms-lease-break-period"] = []string{strconv.FormatInt(int64(*options.BreakPeriod), 10)}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -365,7 +365,7 @@ func (client *BlobClient) changeLeaseCreateRequest(ctx context.Context, leaseID
req.Raw().Header["x-ms-lease-action"] = []string{"change"}
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
req.Raw().Header["x-ms-proposed-lease-id"] = []string{proposedLeaseID}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -517,7 +517,7 @@ func (client *BlobClient) copyFromURLCreateRequest(ctx context.Context, copySour
if options != nil && options.BlobTagsString != nil {
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -659,7 +659,7 @@ func (client *BlobClient) createSnapshotCreateRequest(ctx context.Context, optio
}
}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -788,7 +788,7 @@ func (client *BlobClient) deleteCreateRequest(ctx context.Context, options *Blob
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -860,7 +860,7 @@ func (client *BlobClient) deleteImmutabilityPolicyCreateRequest(ctx context.Cont
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -974,7 +974,7 @@ func (client *BlobClient) downloadCreateRequest(ctx context.Context, options *Bl
if options != nil && options.StructuredBodyType != nil {
req.Raw().Header["x-ms-structured-body"] = []string{*options.StructuredBodyType}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1248,7 +1248,7 @@ func (client *BlobClient) getAccountInfoCreateRequest(ctx context.Context, optio
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1362,7 +1362,7 @@ func (client *BlobClient) getPropertiesCreateRequest(ctx context.Context, option
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1659,7 +1659,7 @@ func (client *BlobClient) getTagsCreateRequest(ctx context.Context, options *Blo
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1761,7 +1761,7 @@ func (client *BlobClient) queryCreateRequest(ctx context.Context, options *BlobC
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if options != nil && options.QueryRequest != nil {
if err := runtime.MarshalAsXML(req, *options.QueryRequest); err != nil {
return nil, err
@ -1980,7 +1980,7 @@ func (client *BlobClient) releaseLeaseCreateRequest(ctx context.Context, leaseID
}
req.Raw().Header["x-ms-lease-action"] = []string{"release"}
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -2074,7 +2074,7 @@ func (client *BlobClient) renewLeaseCreateRequest(ctx context.Context, leaseID s
}
req.Raw().Header["x-ms-lease-action"] = []string{"renew"}
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -2157,7 +2157,7 @@ func (client *BlobClient) setExpiryCreateRequest(ctx context.Context, expiryOpti
if options != nil && options.ExpiresOn != nil {
req.Raw().Header["x-ms-expiry-time"] = []string{*options.ExpiresOn}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -2271,7 +2271,7 @@ func (client *BlobClient) setHTTPHeadersCreateRequest(ctx context.Context, optio
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -2370,7 +2370,7 @@ func (client *BlobClient) setImmutabilityPolicyCreateRequest(ctx context.Context
if options != nil && options.ImmutabilityPolicyExpiry != nil {
req.Raw().Header["x-ms-immutability-policy-until-date"] = []string{(*options.ImmutabilityPolicyExpiry).In(gmt).Format(time.RFC1123)}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -2453,7 +2453,7 @@ func (client *BlobClient) setLegalHoldCreateRequest(ctx context.Context, legalHo
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-legal-hold"] = []string{strconv.FormatBool(legalHold)}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -2567,7 +2567,7 @@ func (client *BlobClient) setMetadataCreateRequest(ctx context.Context, options
}
}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -2676,7 +2676,7 @@ func (client *BlobClient) setTagsCreateRequest(ctx context.Context, tags BlobTag
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if err := runtime.MarshalAsXML(req, tags); err != nil {
return nil, err
}
@ -2766,7 +2766,7 @@ func (client *BlobClient) setTierCreateRequest(ctx context.Context, tier AccessT
if options != nil && options.RehydratePriority != nil {
req.Raw().Header["x-ms-rehydrate-priority"] = []string{string(*options.RehydratePriority)}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -2892,7 +2892,7 @@ func (client *BlobClient) startCopyFromURLCreateRequest(ctx context.Context, cop
if options != nil && options.BlobTagsString != nil {
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -2976,7 +2976,7 @@ func (client *BlobClient) undeleteCreateRequest(ctx context.Context, options *Bl
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}

View file

@ -152,7 +152,7 @@ func (client *BlockBlobClient) commitBlockListCreateRequest(ctx context.Context,
if options != nil && options.BlobTagsString != nil {
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if err := runtime.MarshalAsXML(req, blocks); err != nil {
return nil, err
}
@ -273,7 +273,7 @@ func (client *BlockBlobClient) getBlockListCreateRequest(ctx context.Context, li
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -470,7 +470,7 @@ func (client *BlockBlobClient) putBlobFromURLCreateRequest(ctx context.Context,
if options != nil && options.BlobTagsString != nil {
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -605,7 +605,7 @@ func (client *BlockBlobClient) stageBlockCreateRequest(ctx context.Context, bloc
if options != nil && options.StructuredContentLength != nil {
req.Raw().Header["x-ms-structured-content-length"] = []string{strconv.FormatInt(*options.StructuredContentLength, 10)}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if err := req.SetBody(body, "application/octet-stream"); err != nil {
return nil, err
}
@ -757,7 +757,7 @@ func (client *BlockBlobClient) stageBlockFromURLCreateRequest(ctx context.Contex
if options != nil && options.SourceRange != nil {
req.Raw().Header["x-ms-source-range"] = []string{*options.SourceRange}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -942,7 +942,7 @@ func (client *BlockBlobClient) uploadCreateRequest(ctx context.Context, contentL
if options != nil && options.BlobTagsString != nil {
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if err := req.SetBody(body, "application/octet-stream"); err != nil {
return nil, err
}

View file

@ -83,7 +83,7 @@ func (client *ContainerClient) acquireLeaseCreateRequest(ctx context.Context, du
if options != nil && options.ProposedLeaseID != nil {
req.Raw().Header["x-ms-proposed-lease-id"] = []string{*options.ProposedLeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -174,7 +174,7 @@ func (client *ContainerClient) breakLeaseCreateRequest(ctx context.Context, opti
if options != nil && options.BreakPeriod != nil {
req.Raw().Header["x-ms-lease-break-period"] = []string{strconv.FormatInt(int64(*options.BreakPeriod), 10)}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -273,7 +273,7 @@ func (client *ContainerClient) changeLeaseCreateRequest(ctx context.Context, lea
req.Raw().Header["x-ms-lease-action"] = []string{"change"}
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
req.Raw().Header["x-ms-proposed-lease-id"] = []string{proposedLeaseID}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -369,7 +369,7 @@ func (client *ContainerClient) createCreateRequest(ctx context.Context, options
}
}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -456,7 +456,7 @@ func (client *ContainerClient) deleteCreateRequest(ctx context.Context, options
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -534,7 +534,7 @@ func (client *ContainerClient) filterBlobsCreateRequest(ctx context.Context, whe
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -609,7 +609,7 @@ func (client *ContainerClient) getAccessPolicyCreateRequest(ctx context.Context,
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -692,7 +692,7 @@ func (client *ContainerClient) getAccountInfoCreateRequest(ctx context.Context,
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -775,7 +775,7 @@ func (client *ContainerClient) getPropertiesCreateRequest(ctx context.Context, o
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -897,7 +897,7 @@ func (client *ContainerClient) ListBlobFlatSegmentCreateRequest(ctx context.Cont
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -988,7 +988,7 @@ func (client *ContainerClient) ListBlobHierarchySegmentCreateRequest(ctx context
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1071,7 +1071,7 @@ func (client *ContainerClient) releaseLeaseCreateRequest(ctx context.Context, le
}
req.Raw().Header["x-ms-lease-action"] = []string{"release"}
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1152,7 +1152,7 @@ func (client *ContainerClient) renameCreateRequest(ctx context.Context, sourceCo
if options != nil && options.SourceLeaseID != nil {
req.Raw().Header["x-ms-source-lease-id"] = []string{*options.SourceLeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1229,7 +1229,7 @@ func (client *ContainerClient) renewLeaseCreateRequest(ctx context.Context, leas
}
req.Raw().Header["x-ms-lease-action"] = []string{"renew"}
req.Raw().Header["x-ms-lease-id"] = []string{leaseID}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1314,7 +1314,7 @@ func (client *ContainerClient) restoreCreateRequest(ctx context.Context, options
if options != nil && options.DeletedContainerVersion != nil {
req.Raw().Header["x-ms-deleted-container-version"] = []string{*options.DeletedContainerVersion}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1397,7 +1397,7 @@ func (client *ContainerClient) setAccessPolicyCreateRequest(ctx context.Context,
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
type wrapper struct {
XMLName xml.Name `xml:"SignedIdentifiers"`
ContainerACL *[]*SignedIdentifier `xml:"SignedIdentifier"`
@ -1495,7 +1495,7 @@ func (client *ContainerClient) setMetadataCreateRequest(ctx context.Context, opt
}
}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1578,7 +1578,7 @@ func (client *ContainerClient) submitBatchCreateRequest(ctx context.Context, con
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if err := req.SetBody(body, multipartContentType); err != nil {
return nil, err
}

View file

@ -114,7 +114,7 @@ func (client *PageBlobClient) clearPagesCreateRequest(ctx context.Context, conte
if options != nil && options.Range != nil {
req.Raw().Header["x-ms-range"] = []string{*options.Range}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -235,7 +235,7 @@ func (client *PageBlobClient) copyIncrementalCreateRequest(ctx context.Context,
if modifiedAccessConditions != nil && modifiedAccessConditions.IfTags != nil {
req.Raw().Header["x-ms-if-tags"] = []string{*modifiedAccessConditions.IfTags}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -399,7 +399,7 @@ func (client *PageBlobClient) createCreateRequest(ctx context.Context, contentLe
if options != nil && options.BlobTagsString != nil {
req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -533,7 +533,7 @@ func (client *PageBlobClient) GetPageRangesCreateRequest(ctx context.Context, op
if options != nil && options.Range != nil {
req.Raw().Header["x-ms-range"] = []string{*options.Range}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -660,7 +660,7 @@ func (client *PageBlobClient) GetPageRangesDiffCreateRequest(ctx context.Context
if options != nil && options.Range != nil {
req.Raw().Header["x-ms-range"] = []string{*options.Range}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -782,7 +782,7 @@ func (client *PageBlobClient) resizeCreateRequest(ctx context.Context, blobConte
if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil {
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -891,7 +891,7 @@ func (client *PageBlobClient) updateSequenceNumberCreateRequest(ctx context.Cont
req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID}
}
req.Raw().Header["x-ms-sequence-number-action"] = []string{string(sequenceNumberAction)}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -1037,7 +1037,7 @@ func (client *PageBlobClient) uploadPagesCreateRequest(ctx context.Context, cont
if options != nil && options.StructuredContentLength != nil {
req.Raw().Header["x-ms-structured-content-length"] = []string{strconv.FormatInt(*options.StructuredContentLength, 10)}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if err := req.SetBody(body, "application/octet-stream"); err != nil {
return nil, err
}
@ -1233,7 +1233,7 @@ func (client *PageBlobClient) uploadPagesFromURLCreateRequest(ctx context.Contex
req.Raw().Header["x-ms-source-if-unmodified-since"] = []string{(*sourceModifiedAccessConditions.SourceIfUnmodifiedSince).In(gmt).Format(time.RFC1123)}
}
req.Raw().Header["x-ms-source-range"] = []string{sourceRange}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}

View file

@ -77,7 +77,7 @@ func (client *ServiceClient) filterBlobsCreateRequest(ctx context.Context, where
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -146,7 +146,7 @@ func (client *ServiceClient) getAccountInfoCreateRequest(ctx context.Context, op
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -226,7 +226,7 @@ func (client *ServiceClient) getPropertiesCreateRequest(ctx context.Context, opt
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -289,7 +289,7 @@ func (client *ServiceClient) getStatisticsCreateRequest(ctx context.Context, opt
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -361,7 +361,7 @@ func (client *ServiceClient) getUserDelegationKeyCreateRequest(ctx context.Conte
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if err := runtime.MarshalAsXML(req, keyInfo); err != nil {
return nil, err
}
@ -428,7 +428,7 @@ func (client *ServiceClient) ListContainersSegmentCreateRequest(ctx context.Cont
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
return req, nil
}
@ -492,7 +492,7 @@ func (client *ServiceClient) setPropertiesCreateRequest(ctx context.Context, sto
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if err := runtime.MarshalAsXML(req, storageServiceProperties); err != nil {
return nil, err
}
@ -560,7 +560,7 @@ func (client *ServiceClient) submitBatchCreateRequest(ctx context.Context, conte
if options != nil && options.RequestID != nil {
req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID}
}
req.Raw().Header["x-ms-version"] = []string{"2025-01-05"}
req.Raw().Header["x-ms-version"] = []string{ServiceVersion}
if err := req.SetBody(body, multipartContentType); err != nil {
return nil, err
}