repo_name
stringlengths 1
52
| repo_creator
stringclasses 6
values | programming_language
stringclasses 4
values | code
stringlengths 0
9.68M
| num_lines
int64 1
234k
|
---|---|---|---|---|
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package ssooidc
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "awsssooidc"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package ssooidc
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.14.12"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package ssooidc
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package ssooidc
import (
"bytes"
"context"
"fmt"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpCreateToken struct {
}
func (*awsRestjson1_serializeOpCreateToken) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateTokenInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/token")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateTokenInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateTokenInput(v *CreateTokenInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateTokenInput(v *CreateTokenInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientId != nil {
ok := object.Key("clientId")
ok.String(*v.ClientId)
}
if v.ClientSecret != nil {
ok := object.Key("clientSecret")
ok.String(*v.ClientSecret)
}
if v.Code != nil {
ok := object.Key("code")
ok.String(*v.Code)
}
if v.DeviceCode != nil {
ok := object.Key("deviceCode")
ok.String(*v.DeviceCode)
}
if v.GrantType != nil {
ok := object.Key("grantType")
ok.String(*v.GrantType)
}
if v.RedirectUri != nil {
ok := object.Key("redirectUri")
ok.String(*v.RedirectUri)
}
if v.RefreshToken != nil {
ok := object.Key("refreshToken")
ok.String(*v.RefreshToken)
}
if v.Scope != nil {
ok := object.Key("scope")
if err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpRegisterClient struct {
}
func (*awsRestjson1_serializeOpRegisterClient) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRegisterClient) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RegisterClientInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/client/register")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentRegisterClientInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsRegisterClientInput(v *RegisterClientInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentRegisterClientInput(v *RegisterClientInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientName != nil {
ok := object.Key("clientName")
ok.String(*v.ClientName)
}
if v.ClientType != nil {
ok := object.Key("clientType")
ok.String(*v.ClientType)
}
if v.Scopes != nil {
ok := object.Key("scopes")
if err := awsRestjson1_serializeDocumentScopes(v.Scopes, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpStartDeviceAuthorization struct {
}
func (*awsRestjson1_serializeOpStartDeviceAuthorization) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartDeviceAuthorization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartDeviceAuthorizationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/device_authorization")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientId != nil {
ok := object.Key("clientId")
ok.String(*v.ClientId)
}
if v.ClientSecret != nil {
ok := object.Key("clientSecret")
ok.String(*v.ClientSecret)
}
if v.StartUrl != nil {
ok := object.Key("startUrl")
ok.String(*v.StartUrl)
}
return nil
}
func awsRestjson1_serializeDocumentScopes(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
| 289 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package ssooidc
import (
"context"
"fmt"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateToken struct {
}
func (*validateOpCreateToken) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateTokenInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateTokenInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRegisterClient struct {
}
func (*validateOpRegisterClient) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRegisterClient) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RegisterClientInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRegisterClientInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartDeviceAuthorization struct {
}
func (*validateOpStartDeviceAuthorization) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartDeviceAuthorization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartDeviceAuthorizationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartDeviceAuthorizationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateTokenValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateToken{}, middleware.After)
}
func addOpRegisterClientValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRegisterClient{}, middleware.After)
}
func addOpStartDeviceAuthorizationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartDeviceAuthorization{}, middleware.After)
}
func validateOpCreateTokenInput(v *CreateTokenInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateTokenInput"}
if v.ClientId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientId"))
}
if v.ClientSecret == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientSecret"))
}
if v.GrantType == nil {
invalidParams.Add(smithy.NewErrParamRequired("GrantType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRegisterClientInput(v *RegisterClientInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegisterClientInput"}
if v.ClientName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientName"))
}
if v.ClientType == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartDeviceAuthorizationInput"}
if v.ClientId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientId"))
}
if v.ClientSecret == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientSecret"))
}
if v.StartUrl == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartUrl"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver SSO OIDC endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "oidc.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "oidc-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "oidc-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "oidc.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{
Hostname: "oidc.af-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "af-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{
Hostname: "oidc.ap-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-east-1",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{
Hostname: "oidc.ap-northeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{
Hostname: "oidc.ap-northeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{
Hostname: "oidc.ap-northeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{
Hostname: "oidc.ap-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{
Hostname: "oidc.ap-southeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{
Hostname: "oidc.ap-southeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{
Hostname: "oidc.ap-southeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-3",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{
Hostname: "oidc.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{
Hostname: "oidc.eu-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-1",
},
},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{
Hostname: "oidc.eu-north-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-north-1",
},
},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{
Hostname: "oidc.eu-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-1",
},
},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{
Hostname: "oidc.eu-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-1",
},
},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{
Hostname: "oidc.eu-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-2",
},
},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{
Hostname: "oidc.eu-west-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-3",
},
},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{
Hostname: "oidc.me-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-south-1",
},
},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{
Hostname: "oidc.sa-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "sa-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{
Hostname: "oidc.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{
Hostname: "oidc.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{
Hostname: "oidc.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{
Hostname: "oidc.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "oidc.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "oidc-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "oidc-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "oidc.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "oidc-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "oidc.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "oidc-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "oidc.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "oidc-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "oidc.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "oidc-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "oidc.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "oidc.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "oidc-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "oidc-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "oidc.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "oidc.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "oidc.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
},
},
}
| 493 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// You do not have sufficient access to perform this action.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that a request to authorize a client with an access user session
// token is pending.
type AuthorizationPendingException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *AuthorizationPendingException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AuthorizationPendingException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AuthorizationPendingException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AuthorizationPendingException"
}
return *e.ErrorCodeOverride
}
func (e *AuthorizationPendingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the token issued by the service is expired and is no longer
// valid.
type ExpiredTokenException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *ExpiredTokenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ExpiredTokenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ExpiredTokenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ExpiredTokenException"
}
return *e.ErrorCodeOverride
}
func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that an error from the service occurred while trying to process a
// request.
type InternalServerException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *InternalServerException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Indicates that the clientId or clientSecret in the request is invalid. For
// example, this can occur when a client sends an incorrect clientId or an expired
// clientSecret .
type InvalidClientException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *InvalidClientException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidClientException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidClientException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidClientException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the client information sent in the request during registration
// is invalid.
type InvalidClientMetadataException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *InvalidClientMetadataException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidClientMetadataException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidClientMetadataException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidClientMetadataException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidClientMetadataException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that a request contains an invalid grant. This can occur if a client
// makes a CreateToken request with an invalid grant type.
type InvalidGrantException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *InvalidGrantException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidGrantException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidGrantException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidGrantException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidGrantException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that something is wrong with the input to the request. For example, a
// required parameter might be missing or out of range.
type InvalidRequestException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *InvalidRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidRequestException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the scope provided in the request is invalid.
type InvalidScopeException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *InvalidScopeException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidScopeException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidScopeException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidScopeException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidScopeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the client is making the request too frequently and is more than
// the service can handle.
type SlowDownException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *SlowDownException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *SlowDownException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *SlowDownException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "SlowDownException"
}
return *e.ErrorCodeOverride
}
func (e *SlowDownException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the client is not currently authorized to make the request. This
// can happen when a clientId is not issued for a public client.
type UnauthorizedClientException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *UnauthorizedClientException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnauthorizedClientException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnauthorizedClientException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnauthorizedClientException"
}
return *e.ErrorCodeOverride
}
func (e *UnauthorizedClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Indicates that the grant type in the request is not supported by the service.
type UnsupportedGrantTypeException struct {
Message *string
ErrorCodeOverride *string
Error_ *string
Error_description *string
noSmithyDocumentSerde
}
func (e *UnsupportedGrantTypeException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnsupportedGrantTypeException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnsupportedGrantTypeException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnsupportedGrantTypeException"
}
return *e.ErrorCodeOverride
}
func (e *UnsupportedGrantTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 367 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
)
type noSmithyDocumentSerde = smithydocument.NoSerde
| 10 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "Storage Gateway"
const ServiceAPIVersion = "2013-06-30"
// Client provides the API client to make operations call for AWS Storage Gateway.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "storagegateway", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Activates the gateway you previously deployed on your host. In the activation
// process, you specify information such as the Amazon Web Services Region that you
// want to use for storing snapshots or tapes, the time zone for scheduled
// snapshots the gateway snapshot schedule window, an activation key, and a name
// for your gateway. The activation process also associates your gateway with your
// account. For more information, see UpdateGatewayInformation . You must turn on
// the gateway VM before you can activate your gateway.
func (c *Client) ActivateGateway(ctx context.Context, params *ActivateGatewayInput, optFns ...func(*Options)) (*ActivateGatewayOutput, error) {
if params == nil {
params = &ActivateGatewayInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ActivateGateway", params, optFns, c.addOperationActivateGatewayMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ActivateGatewayOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing one or more of the following fields:
// - ActivateGatewayInput$ActivationKey
// - ActivateGatewayInput$GatewayName
// - ActivateGatewayInput$GatewayRegion
// - ActivateGatewayInput$GatewayTimezone
// - ActivateGatewayInput$GatewayType
// - ActivateGatewayInput$MediumChangerType
// - ActivateGatewayInput$TapeDriveType
type ActivateGatewayInput struct {
// Your gateway activation key. You can obtain the activation key by sending an
// HTTP GET request with redirects enabled to the gateway IP address (port 80). The
// redirect URL returned in the response provides you the activation key for your
// gateway in the query string parameter activationKey . It may also include other
// activation-related parameters, however, these are merely defaults -- the
// arguments you pass to the ActivateGateway API call determine the actual
// configuration of your gateway. For more information, see Getting activation key (https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html)
// in the Storage Gateway User Guide.
//
// This member is required.
ActivationKey *string
// The name you configured for your gateway.
//
// This member is required.
GatewayName *string
// A value that indicates the Amazon Web Services Region where you want to store
// your data. The gateway Amazon Web Services Region specified must be the same
// Amazon Web Services Region as the Amazon Web Services Region in your Host
// header in the request. For more information about available Amazon Web Services
// Regions and endpoints for Storage Gateway, see Storage Gateway endpoints and
// quotas (https://docs.aws.amazon.com/general/latest/gr/sg.html) in the Amazon Web
// Services General Reference. Valid Values: See Storage Gateway endpoints and
// quotas (https://docs.aws.amazon.com/general/latest/gr/sg.html) in the Amazon Web
// Services General Reference.
//
// This member is required.
GatewayRegion *string
// A value that indicates the time zone you want to set for the gateway. The time
// zone is of the format "GMT-hr:mm" or "GMT+hr:mm". For example, GMT-4:00
// indicates the time is 4 hours behind GMT. GMT+2:00 indicates the time is 2 hours
// ahead of GMT. The time zone is used, for example, for scheduling snapshots and
// your gateway's maintenance schedule.
//
// This member is required.
GatewayTimezone *string
// A value that defines the type of gateway to activate. The type specified is
// critical to all later functions of the gateway and cannot be changed after
// activation. The default value is CACHED . Valid Values: STORED | CACHED | VTL |
// VTL_SNOW | FILE_S3 | FILE_FSX_SMB
GatewayType *string
// The value that indicates the type of medium changer to use for tape gateway.
// This field is optional. Valid Values: STK-L700 | AWS-Gateway-VTL |
// IBM-03584L32-0402
MediumChangerType *string
// A list of up to 50 tags that you can assign to the gateway. Each tag is a
// key-value pair. Valid characters for key and value are letters, spaces, and
// numbers that can be represented in UTF-8 format, and the following special
// characters: + - = . _ : / @. The maximum length of a tag's key is 128
// characters, and the maximum length for a tag's value is 256 characters.
Tags []types.Tag
// The value that indicates the type of tape drive to use for tape gateway. This
// field is optional. Valid Values: IBM-ULT3580-TD5
TapeDriveType *string
noSmithyDocumentSerde
}
// Storage Gateway returns the Amazon Resource Name (ARN) of the activated
// gateway. It is a string made of information such as your account, gateway name,
// and Amazon Web Services Region. This ARN is used to reference the gateway in
// other API operations as well as resource-based authorization. For gateways
// activated prior to September 02, 2015, the gateway ARN contains the gateway name
// rather than the gateway ID. Changing the name of the gateway has no effect on
// the gateway ARN.
type ActivateGatewayOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationActivateGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpActivateGateway{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpActivateGateway{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpActivateGatewayValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opActivateGateway(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opActivateGateway(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ActivateGateway",
}
}
| 203 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Configures one or more gateway local disks as cache for a gateway. This
// operation is only supported in the cached volume, tape, and file gateway type
// (see How Storage Gateway works (architecture) (https://docs.aws.amazon.com/storagegateway/latest/userguide/StorageGatewayConcepts.html)
// . In the request, you specify the gateway Amazon Resource Name (ARN) to which
// you want to add cache, and one or more disk IDs that you want to configure as
// cache.
func (c *Client) AddCache(ctx context.Context, params *AddCacheInput, optFns ...func(*Options)) (*AddCacheOutput, error) {
if params == nil {
params = &AddCacheInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddCache", params, optFns, c.addOperationAddCacheMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddCacheOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddCacheInput struct {
// An array of strings that identify disks that are to be configured as working
// storage. Each string has a minimum length of 1 and maximum length of 300. You
// can get the disk IDs from the ListLocalDisks API.
//
// This member is required.
DiskIds []string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type AddCacheOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddCacheMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddCache{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddCache{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddCacheValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddCache(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAddCache(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "AddCache",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds one or more tags to the specified resource. You use tags to add metadata
// to resources, which you can use to categorize these resources. For example, you
// can categorize resources by purpose, owner, environment, or team. Each tag
// consists of a key and a value, which you define. You can add tags to the
// following Storage Gateway resources:
// - Storage gateways of all types
// - Storage volumes
// - Virtual tapes
// - NFS and SMB file shares
// - File System associations
//
// You can create a maximum of 50 tags for each resource. Virtual tapes and
// storage volumes that are recovered to a new gateway maintain their tags.
func (c *Client) AddTagsToResource(ctx context.Context, params *AddTagsToResourceInput, optFns ...func(*Options)) (*AddTagsToResourceOutput, error) {
if params == nil {
params = &AddTagsToResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddTagsToResource", params, optFns, c.addOperationAddTagsToResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddTagsToResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
// AddTagsToResourceInput
type AddTagsToResourceInput struct {
// The Amazon Resource Name (ARN) of the resource you want to add tags to.
//
// This member is required.
ResourceARN *string
// The key-value pair that represents the tag you want to add to the resource. The
// value can be an empty string. Valid characters for key and value are letters,
// spaces, and numbers representable in UTF-8 format, and the following special
// characters: + - = . _ : / @. The maximum length of a tag's key is 128
// characters, and the maximum length for a tag's value is 256.
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
// AddTagsToResourceOutput
type AddTagsToResourceOutput struct {
// The Amazon Resource Name (ARN) of the resource you want to add tags to.
ResourceARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddTagsToResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddTagsToResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddTagsToResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTagsToResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAddTagsToResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "AddTagsToResource",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Configures one or more gateway local disks as upload buffer for a specified
// gateway. This operation is supported for the stored volume, cached volume, and
// tape gateway types. In the request, you specify the gateway Amazon Resource Name
// (ARN) to which you want to add upload buffer, and one or more disk IDs that you
// want to configure as upload buffer.
func (c *Client) AddUploadBuffer(ctx context.Context, params *AddUploadBufferInput, optFns ...func(*Options)) (*AddUploadBufferOutput, error) {
if params == nil {
params = &AddUploadBufferInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddUploadBuffer", params, optFns, c.addOperationAddUploadBufferMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddUploadBufferOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddUploadBufferInput struct {
// An array of strings that identify disks that are to be configured as working
// storage. Each string has a minimum length of 1 and maximum length of 300. You
// can get the disk IDs from the ListLocalDisks API.
//
// This member is required.
DiskIds []string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type AddUploadBufferOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddUploadBufferMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddUploadBuffer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddUploadBuffer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddUploadBufferValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddUploadBuffer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAddUploadBuffer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "AddUploadBuffer",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Configures one or more gateway local disks as working storage for a gateway.
// This operation is only supported in the stored volume gateway type. This
// operation is deprecated in cached volume API version 20120630. Use
// AddUploadBuffer instead. Working storage is also referred to as upload buffer.
// You can also use the AddUploadBuffer operation to add upload buffer to a stored
// volume gateway. In the request, you specify the gateway Amazon Resource Name
// (ARN) to which you want to add working storage, and one or more disk IDs that
// you want to configure as working storage.
func (c *Client) AddWorkingStorage(ctx context.Context, params *AddWorkingStorageInput, optFns ...func(*Options)) (*AddWorkingStorageOutput, error) {
if params == nil {
params = &AddWorkingStorageInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddWorkingStorage", params, optFns, c.addOperationAddWorkingStorageMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddWorkingStorageOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing one or more of the following fields:
// - AddWorkingStorageInput$DiskIds
type AddWorkingStorageInput struct {
// An array of strings that identify disks that are to be configured as working
// storage. Each string has a minimum length of 1 and maximum length of 300. You
// can get the disk IDs from the ListLocalDisks API.
//
// This member is required.
DiskIds []string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway for
// which working storage was configured.
type AddWorkingStorageOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddWorkingStorageMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddWorkingStorage{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddWorkingStorage{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddWorkingStorageValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddWorkingStorage(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAddWorkingStorage(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "AddWorkingStorage",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Assigns a tape to a tape pool for archiving. The tape assigned to a pool is
// archived in the S3 storage class that is associated with the pool. When you use
// your backup application to eject the tape, the tape is archived directly into
// the S3 storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to
// the pool.
func (c *Client) AssignTapePool(ctx context.Context, params *AssignTapePoolInput, optFns ...func(*Options)) (*AssignTapePoolOutput, error) {
if params == nil {
params = &AssignTapePoolInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssignTapePool", params, optFns, c.addOperationAssignTapePoolMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssignTapePoolOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssignTapePoolInput struct {
// The ID of the pool that you want to add your tape to for archiving. The tape in
// this pool is archived in the S3 storage class that is associated with the pool.
// When you use your backup application to eject the tape, the tape is archived
// directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that
// corresponds to the pool.
//
// This member is required.
PoolId *string
// The unique Amazon Resource Name (ARN) of the virtual tape that you want to add
// to the tape pool.
//
// This member is required.
TapeARN *string
// Set permissions to bypass governance retention. If the lock type of the
// archived tape is Governance , the tape's archived age is not older than
// RetentionLockInDays , and the user does not already have
// BypassGovernanceRetention , setting this to TRUE enables the user to bypass the
// retention lock. This parameter is set to true by default for calls from the
// console. Valid values: TRUE | FALSE
BypassGovernanceRetention bool
noSmithyDocumentSerde
}
type AssignTapePoolOutput struct {
// The unique Amazon Resource Names (ARN) of the virtual tape that was added to
// the tape pool.
TapeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssignTapePoolMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssignTapePool{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssignTapePool{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssignTapePoolValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssignTapePool(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssignTapePool(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "AssignTapePool",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associate an Amazon FSx file system with the FSx File Gateway. After the
// association process is complete, the file shares on the Amazon FSx file system
// are available for access through the gateway. This operation only supports the
// FSx File Gateway type.
func (c *Client) AssociateFileSystem(ctx context.Context, params *AssociateFileSystemInput, optFns ...func(*Options)) (*AssociateFileSystemOutput, error) {
if params == nil {
params = &AssociateFileSystemInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateFileSystem", params, optFns, c.addOperationAssociateFileSystemMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateFileSystemOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateFileSystemInput struct {
// A unique string value that you supply that is used by the FSx File Gateway to
// ensure idempotent file system association creation.
//
// This member is required.
ClientToken *string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The Amazon Resource Name (ARN) of the Amazon FSx file system to associate with
// the FSx File Gateway.
//
// This member is required.
LocationARN *string
// The password of the user credential.
//
// This member is required.
Password *string
// The user name of the user credential that has permission to access the root
// share D$ of the Amazon FSx file system. The user account must belong to the
// Amazon FSx delegated admin user group.
//
// This member is required.
UserName *string
// The Amazon Resource Name (ARN) of the storage used for the audit logs.
AuditDestinationARN *string
// The refresh cache information for the file share or FSx file systems.
CacheAttributes *types.CacheAttributes
// Specifies the network configuration information for the gateway associated with
// the Amazon FSx file system. If multiple file systems are associated with this
// gateway, this parameter's IpAddresses field is required.
EndpointNetworkConfiguration *types.EndpointNetworkConfiguration
// A list of up to 50 tags that can be assigned to the file system association.
// Each tag is a key-value pair.
Tags []types.Tag
noSmithyDocumentSerde
}
type AssociateFileSystemOutput struct {
// The ARN of the newly created file system association.
FileSystemAssociationARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateFileSystemMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateFileSystem{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateFileSystem{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateFileSystemValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateFileSystem(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssociateFileSystem(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "AssociateFileSystem",
}
}
| 168 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Connects a volume to an iSCSI connection and then attaches the volume to the
// specified gateway. Detaching and attaching a volume enables you to recover your
// data from one gateway to a different gateway without creating a snapshot. It
// also makes it easier to move your volumes from an on-premises gateway to a
// gateway hosted on an Amazon EC2 instance.
func (c *Client) AttachVolume(ctx context.Context, params *AttachVolumeInput, optFns ...func(*Options)) (*AttachVolumeOutput, error) {
if params == nil {
params = &AttachVolumeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AttachVolume", params, optFns, c.addOperationAttachVolumeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AttachVolumeOutput)
out.ResultMetadata = metadata
return out, nil
}
// AttachVolumeInput
type AttachVolumeInput struct {
// The Amazon Resource Name (ARN) of the gateway that you want to attach the
// volume to.
//
// This member is required.
GatewayARN *string
// The network interface of the gateway on which to expose the iSCSI target. Only
// IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of
// the network interfaces available on a gateway. Valid Values: A valid IP address.
//
// This member is required.
NetworkInterfaceId *string
// The Amazon Resource Name (ARN) of the volume to attach to the specified gateway.
//
// This member is required.
VolumeARN *string
// The unique device ID or other distinguishing data that identifies the local
// disk used to create the volume. This value is only required when you are
// attaching a stored volume.
DiskId *string
// The name of the iSCSI target used by an initiator to connect to a volume and
// used as a suffix for the target ARN. For example, specifying TargetName as
// myvolume results in the target ARN of
// arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume
// . The target name must be unique across all volumes on a gateway. If you don't
// specify a value, Storage Gateway uses the value that was previously used for
// this volume as the new target name.
TargetName *string
noSmithyDocumentSerde
}
// AttachVolumeOutput
type AttachVolumeOutput struct {
// The Amazon Resource Name (ARN) of the volume target, which includes the iSCSI
// name for the initiator that was used to connect to the target.
TargetARN *string
// The Amazon Resource Name (ARN) of the volume that was attached to the gateway.
VolumeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAttachVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAttachVolume{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAttachVolume{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAttachVolumeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachVolume(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAttachVolume(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "AttachVolume",
}
}
| 161 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Cancels archiving of a virtual tape to the virtual tape shelf (VTS) after the
// archiving process is initiated. This operation is only supported in the tape
// gateway type.
func (c *Client) CancelArchival(ctx context.Context, params *CancelArchivalInput, optFns ...func(*Options)) (*CancelArchivalOutput, error) {
if params == nil {
params = &CancelArchivalInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CancelArchival", params, optFns, c.addOperationCancelArchivalMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CancelArchivalOutput)
out.ResultMetadata = metadata
return out, nil
}
// CancelArchivalInput
type CancelArchivalInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The Amazon Resource Name (ARN) of the virtual tape you want to cancel archiving
// for.
//
// This member is required.
TapeARN *string
noSmithyDocumentSerde
}
// CancelArchivalOutput
type CancelArchivalOutput struct {
// The Amazon Resource Name (ARN) of the virtual tape for which archiving was
// canceled.
TapeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCancelArchivalMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelArchival{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelArchival{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCancelArchivalValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelArchival(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCancelArchival(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CancelArchival",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Cancels retrieval of a virtual tape from the virtual tape shelf (VTS) to a
// gateway after the retrieval process is initiated. The virtual tape is returned
// to the VTS. This operation is only supported in the tape gateway type.
func (c *Client) CancelRetrieval(ctx context.Context, params *CancelRetrievalInput, optFns ...func(*Options)) (*CancelRetrievalOutput, error) {
if params == nil {
params = &CancelRetrievalInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CancelRetrieval", params, optFns, c.addOperationCancelRetrievalMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CancelRetrievalOutput)
out.ResultMetadata = metadata
return out, nil
}
// CancelRetrievalInput
type CancelRetrievalInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The Amazon Resource Name (ARN) of the virtual tape you want to cancel retrieval
// for.
//
// This member is required.
TapeARN *string
noSmithyDocumentSerde
}
// CancelRetrievalOutput
type CancelRetrievalOutput struct {
// The Amazon Resource Name (ARN) of the virtual tape for which retrieval was
// canceled.
TapeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCancelRetrievalMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelRetrieval{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelRetrieval{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCancelRetrievalValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelRetrieval(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCancelRetrieval(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CancelRetrieval",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a cached volume on a specified cached volume gateway. This operation is
// only supported in the cached volume gateway type. Cache storage must be
// allocated to the gateway before you can create a cached volume. Use the AddCache
// operation to add cache storage to a gateway. In the request, you must specify
// the gateway, size of the volume in bytes, the iSCSI target name, an IP address
// on which to expose the target, and a unique client token. In response, the
// gateway creates the volume and returns information about it. This information
// includes the volume Amazon Resource Name (ARN), its size, and the iSCSI target
// ARN that initiators can use to connect to the volume target. Optionally, you can
// provide the ARN for an existing volume as the SourceVolumeARN for this cached
// volume, which creates an exact copy of the existing volume’s latest recovery
// point. The VolumeSizeInBytes value must be equal to or larger than the size of
// the copied volume, in bytes.
func (c *Client) CreateCachediSCSIVolume(ctx context.Context, params *CreateCachediSCSIVolumeInput, optFns ...func(*Options)) (*CreateCachediSCSIVolumeOutput, error) {
if params == nil {
params = &CreateCachediSCSIVolumeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateCachediSCSIVolume", params, optFns, c.addOperationCreateCachediSCSIVolumeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateCachediSCSIVolumeOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateCachediSCSIVolumeInput struct {
// A unique identifier that you use to retry a request. If you retry a request,
// use the same ClientToken you specified in the initial request.
//
// This member is required.
ClientToken *string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The network interface of the gateway on which to expose the iSCSI target. Only
// IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of
// the network interfaces available on a gateway. Valid Values: A valid IP address.
//
// This member is required.
NetworkInterfaceId *string
// The name of the iSCSI target used by an initiator to connect to a volume and
// used as a suffix for the target ARN. For example, specifying TargetName as
// myvolume results in the target ARN of
// arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume
// . The target name must be unique across all volumes on a gateway. If you don't
// specify a value, Storage Gateway uses the value that was previously used for
// this volume as the new target name.
//
// This member is required.
TargetName *string
// The size of the volume in bytes.
//
// This member is required.
VolumeSizeInBytes int64
// Set to true to use Amazon S3 server-side encryption with your own KMS key, or
// false to use a key managed by Amazon S3. Optional. Valid Values: true | false
KMSEncrypted *bool
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new
// cached volume. Specify this field if you want to create the iSCSI storage volume
// from a snapshot; otherwise, do not include this field. To list snapshots for
// your account use DescribeSnapshots (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html)
// in the Amazon Elastic Compute Cloud API Reference.
SnapshotId *string
// The ARN for an existing volume. Specifying this ARN makes the new volume into
// an exact copy of the specified existing volume's latest recovery point. The
// VolumeSizeInBytes value for this new volume must be equal to or larger than the
// size of the existing volume, in bytes.
SourceVolumeARN *string
// A list of up to 50 tags that you can assign to a cached volume. Each tag is a
// key-value pair. Valid characters for key and value are letters, spaces, and
// numbers that you can represent in UTF-8 format, and the following special
// characters: + - = . _ : / @. The maximum length of a tag's key is 128
// characters, and the maximum length for a tag's value is 256 characters.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateCachediSCSIVolumeOutput struct {
// The Amazon Resource Name (ARN) of the volume target, which includes the iSCSI
// name that initiators can use to connect to the target.
TargetARN *string
// The Amazon Resource Name (ARN) of the configured volume.
VolumeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateCachediSCSIVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateCachediSCSIVolume{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateCachediSCSIVolume{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateCachediSCSIVolumeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCachediSCSIVolume(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateCachediSCSIVolume(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CreateCachediSCSIVolume",
}
}
| 200 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a Network File System (NFS) file share on an existing S3 File Gateway.
// In Storage Gateway, a file share is a file system mount point backed by Amazon
// S3 cloud storage. Storage Gateway exposes file shares using an NFS interface.
// This operation is only supported for S3 File Gateways. S3 File gateway requires
// Security Token Service (Amazon Web Services STS) to be activated to enable you
// to create a file share. Make sure Amazon Web Services STS is activated in the
// Amazon Web Services Region you are creating your S3 File Gateway in. If Amazon
// Web Services STS is not activated in the Amazon Web Services Region, activate
// it. For information about how to activate Amazon Web Services STS, see
// Activating and deactivating Amazon Web Services STS in an Amazon Web Services
// Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the Identity and Access Management User Guide. S3 File Gateways do not
// support creating hard or symbolic links on a file share.
func (c *Client) CreateNFSFileShare(ctx context.Context, params *CreateNFSFileShareInput, optFns ...func(*Options)) (*CreateNFSFileShareOutput, error) {
if params == nil {
params = &CreateNFSFileShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateNFSFileShare", params, optFns, c.addOperationCreateNFSFileShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateNFSFileShareOutput)
out.ResultMetadata = metadata
return out, nil
}
// CreateNFSFileShareInput
type CreateNFSFileShareInput struct {
// A unique string value that you supply that is used by S3 File Gateway to ensure
// idempotent file share creation.
//
// This member is required.
ClientToken *string
// The Amazon Resource Name (ARN) of the S3 File Gateway on which you want to
// create a file share.
//
// This member is required.
GatewayARN *string
// A custom ARN for the backend storage used for storing data for file shares. It
// includes a resource ARN with an optional prefix concatenation. The prefix must
// end with a forward slash (/). You can specify LocationARN as a bucket ARN,
// access point ARN or access point alias, as shown in the following examples.
// Bucket ARN: arn:aws:s3:::my-bucket/prefix/ Access point ARN:
// arn:aws:s3:region:account-id:accesspoint/access-point-name/prefix/ If you
// specify an access point, the bucket policy must be configured to delegate access
// control to the access point. For information, see Delegating access control to
// access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-policies.html#access-points-delegating-control)
// in the Amazon S3 User Guide. Access point alias:
// test-ap-ab123cdef4gehijklmn5opqrstuvuse1a-s3alias
//
// This member is required.
LocationARN *string
// The ARN of the Identity and Access Management (IAM) role that an S3 File
// Gateway assumes when it accesses the underlying storage.
//
// This member is required.
Role *string
// The Amazon Resource Name (ARN) of the storage used for audit logs.
AuditDestinationARN *string
// Specifies the Region of the S3 bucket where the NFS file share stores files.
// This parameter is required for NFS file shares that connect to Amazon S3 through
// a VPC endpoint, a VPC access point, or an access point alias that points to a
// VPC access point.
BucketRegion *string
// Specifies refresh cache information for the file share.
CacheAttributes *types.CacheAttributes
// The list of clients that are allowed to access the S3 File Gateway. The list
// must contain either valid IP addresses or valid CIDR blocks.
ClientList []string
// The default storage class for objects put into an Amazon S3 bucket by the S3
// File Gateway. The default value is S3_STANDARD . Optional. Valid Values:
// S3_STANDARD | S3_INTELLIGENT_TIERING | S3_STANDARD_IA | S3_ONEZONE_IA
DefaultStorageClass *string
// The name of the file share. Optional. FileShareName must be set if an S3 prefix
// name is set in LocationARN , or if an access point or access point alias is used.
FileShareName *string
// A value that enables guessing of the MIME type for uploaded objects based on
// file extensions. Set this value to true to enable MIME type guessing, otherwise
// set to false . The default value is true . Valid Values: true | false
GuessMIMETypeEnabled *bool
// Set to true to use Amazon S3 server-side encryption with your own KMS key, or
// false to use a key managed by Amazon S3. Optional. Valid Values: true | false
KMSEncrypted *bool
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// File share default values. Optional.
NFSFileShareDefaults *types.NFSFileShareDefaults
// The notification policy of the file share. SettlingTimeInSeconds controls the
// number of seconds to wait after the last point in time a client wrote to a file
// before generating an ObjectUploaded notification. Because clients can make many
// small writes to files, it's best to set this parameter for as long as possible
// to avoid generating multiple notifications for the same file in a small time
// period. SettlingTimeInSeconds has no effect on the timing of the object
// uploading to Amazon S3, only the timing of the notification. The following
// example sets NotificationPolicy on with SettlingTimeInSeconds set to 60.
// {"Upload": {"SettlingTimeInSeconds": 60}} The following example sets
// NotificationPolicy off. {}
NotificationPolicy *string
// A value that sets the access control list (ACL) permission for objects in the
// S3 bucket that a S3 File Gateway puts objects into. The default value is private
// .
ObjectACL types.ObjectACL
// A value that sets the write status of a file share. Set this value to true to
// set the write status to read-only, otherwise set to false . Valid Values: true
// | false
ReadOnly *bool
// A value that sets who pays the cost of the request and the cost associated with
// data download from the S3 bucket. If this value is set to true , the requester
// pays the costs; otherwise, the S3 bucket owner pays. However, the S3 bucket
// owner always pays the cost of storing data. RequesterPays is a configuration
// for the S3 bucket that backs the file share, so make sure that the configuration
// on the file share is the same as the S3 bucket configuration. Valid Values: true
// | false
RequesterPays *bool
// A value that maps a user to anonymous user. Valid values are the following:
// - RootSquash : Only root is mapped to anonymous user.
// - NoSquash : No one is mapped to anonymous user.
// - AllSquash : Everyone is mapped to anonymous user.
Squash *string
// A list of up to 50 tags that can be assigned to the NFS file share. Each tag is
// a key-value pair. Valid characters for key and value are letters, spaces, and
// numbers representable in UTF-8 format, and the following special characters: + -
// = . _ : / @. The maximum length of a tag's key is 128 characters, and the
// maximum length for a tag's value is 256.
Tags []types.Tag
// Specifies the DNS name for the VPC endpoint that the NFS file share uses to
// connect to Amazon S3. This parameter is required for NFS file shares that
// connect to Amazon S3 through a VPC endpoint, a VPC access point, or an access
// point alias that points to a VPC access point.
VPCEndpointDNSName *string
noSmithyDocumentSerde
}
// CreateNFSFileShareOutput
type CreateNFSFileShareOutput struct {
// The Amazon Resource Name (ARN) of the newly created file share.
FileShareARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateNFSFileShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateNFSFileShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateNFSFileShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateNFSFileShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNFSFileShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateNFSFileShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CreateNFSFileShare",
}
}
| 259 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a Server Message Block (SMB) file share on an existing S3 File Gateway.
// In Storage Gateway, a file share is a file system mount point backed by Amazon
// S3 cloud storage. Storage Gateway exposes file shares using an SMB interface.
// This operation is only supported for S3 File Gateways. S3 File Gateways require
// Security Token Service (Amazon Web Services STS) to be activated to enable you
// to create a file share. Make sure that Amazon Web Services STS is activated in
// the Amazon Web Services Region you are creating your S3 File Gateway in. If
// Amazon Web Services STS is not activated in this Amazon Web Services Region,
// activate it. For information about how to activate Amazon Web Services STS, see
// Activating and deactivating Amazon Web Services STS in an Amazon Web Services
// Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the Identity and Access Management User Guide. File gateways don't support
// creating hard or symbolic links on a file share.
func (c *Client) CreateSMBFileShare(ctx context.Context, params *CreateSMBFileShareInput, optFns ...func(*Options)) (*CreateSMBFileShareOutput, error) {
if params == nil {
params = &CreateSMBFileShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSMBFileShare", params, optFns, c.addOperationCreateSMBFileShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSMBFileShareOutput)
out.ResultMetadata = metadata
return out, nil
}
// CreateSMBFileShareInput
type CreateSMBFileShareInput struct {
// A unique string value that you supply that is used by S3 File Gateway to ensure
// idempotent file share creation.
//
// This member is required.
ClientToken *string
// The ARN of the S3 File Gateway on which you want to create a file share.
//
// This member is required.
GatewayARN *string
// A custom ARN for the backend storage used for storing data for file shares. It
// includes a resource ARN with an optional prefix concatenation. The prefix must
// end with a forward slash (/). You can specify LocationARN as a bucket ARN,
// access point ARN or access point alias, as shown in the following examples.
// Bucket ARN: arn:aws:s3:::my-bucket/prefix/ Access point ARN:
// arn:aws:s3:region:account-id:accesspoint/access-point-name/prefix/ If you
// specify an access point, the bucket policy must be configured to delegate access
// control to the access point. For information, see Delegating access control to
// access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-policies.html#access-points-delegating-control)
// in the Amazon S3 User Guide. Access point alias:
// test-ap-ab123cdef4gehijklmn5opqrstuvuse1a-s3alias
//
// This member is required.
LocationARN *string
// The ARN of the Identity and Access Management (IAM) role that an S3 File
// Gateway assumes when it accesses the underlying storage.
//
// This member is required.
Role *string
// The files and folders on this share will only be visible to users with read
// access.
AccessBasedEnumeration *bool
// A list of users or groups in the Active Directory that will be granted
// administrator privileges on the file share. These users can do all file
// operations as the super-user. Acceptable formats include: DOMAIN\User1 , user1 ,
// @group1 , and @DOMAIN\group1 . Use this option very carefully, because any user
// in this list can do anything they like on the file share, regardless of file
// permissions.
AdminUserList []string
// The Amazon Resource Name (ARN) of the storage used for audit logs.
AuditDestinationARN *string
// The authentication method that users use to access the file share. The default
// is ActiveDirectory . Valid Values: ActiveDirectory | GuestAccess
Authentication *string
// Specifies the Region of the S3 bucket where the SMB file share stores files.
// This parameter is required for SMB file shares that connect to Amazon S3 through
// a VPC endpoint, a VPC access point, or an access point alias that points to a
// VPC access point.
BucketRegion *string
// Specifies refresh cache information for the file share.
CacheAttributes *types.CacheAttributes
// The case of an object name in an Amazon S3 bucket. For ClientSpecified , the
// client determines the case sensitivity. For CaseSensitive , the gateway
// determines the case sensitivity. The default value is ClientSpecified .
CaseSensitivity types.CaseSensitivity
// The default storage class for objects put into an Amazon S3 bucket by the S3
// File Gateway. The default value is S3_STANDARD . Optional. Valid Values:
// S3_STANDARD | S3_INTELLIGENT_TIERING | S3_STANDARD_IA | S3_ONEZONE_IA
DefaultStorageClass *string
// The name of the file share. Optional. FileShareName must be set if an S3 prefix
// name is set in LocationARN , or if an access point or access point alias is used.
FileShareName *string
// A value that enables guessing of the MIME type for uploaded objects based on
// file extensions. Set this value to true to enable MIME type guessing, otherwise
// set to false . The default value is true . Valid Values: true | false
GuessMIMETypeEnabled *bool
// A list of users or groups in the Active Directory that are not allowed to
// access the file share. A group must be prefixed with the @ character. Acceptable
// formats include: DOMAIN\User1 , user1 , @group1 , and @DOMAIN\group1 . Can only
// be set if Authentication is set to ActiveDirectory .
InvalidUserList []string
// Set to true to use Amazon S3 server-side encryption with your own KMS key, or
// false to use a key managed by Amazon S3. Optional. Valid Values: true | false
KMSEncrypted *bool
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// The notification policy of the file share. SettlingTimeInSeconds controls the
// number of seconds to wait after the last point in time a client wrote to a file
// before generating an ObjectUploaded notification. Because clients can make many
// small writes to files, it's best to set this parameter for as long as possible
// to avoid generating multiple notifications for the same file in a small time
// period. SettlingTimeInSeconds has no effect on the timing of the object
// uploading to Amazon S3, only the timing of the notification. The following
// example sets NotificationPolicy on with SettlingTimeInSeconds set to 60.
// {"Upload": {"SettlingTimeInSeconds": 60}} The following example sets
// NotificationPolicy off. {}
NotificationPolicy *string
// A value that sets the access control list (ACL) permission for objects in the
// S3 bucket that a S3 File Gateway puts objects into. The default value is private
// .
ObjectACL types.ObjectACL
// Specifies whether opportunistic locking is enabled for the SMB file share.
// Enabling opportunistic locking on case-sensitive shares is not recommended for
// workloads that involve access to files with the same name in different case.
// Valid Values: true | false
OplocksEnabled *bool
// A value that sets the write status of a file share. Set this value to true to
// set the write status to read-only, otherwise set to false . Valid Values: true
// | false
ReadOnly *bool
// A value that sets who pays the cost of the request and the cost associated with
// data download from the S3 bucket. If this value is set to true , the requester
// pays the costs; otherwise, the S3 bucket owner pays. However, the S3 bucket
// owner always pays the cost of storing data. RequesterPays is a configuration
// for the S3 bucket that backs the file share, so make sure that the configuration
// on the file share is the same as the S3 bucket configuration. Valid Values: true
// | false
RequesterPays *bool
// Set this value to true to enable access control list (ACL) on the SMB file
// share. Set it to false to map file and directory permissions to the POSIX
// permissions. For more information, see Using Microsoft Windows ACLs to control
// access to an SMB file share (https://docs.aws.amazon.com/storagegateway/latest/userguide/smb-acl.html)
// in the Storage Gateway User Guide. Valid Values: true | false
SMBACLEnabled *bool
// A list of up to 50 tags that can be assigned to the NFS file share. Each tag is
// a key-value pair. Valid characters for key and value are letters, spaces, and
// numbers representable in UTF-8 format, and the following special characters: + -
// = . _ : / @. The maximum length of a tag's key is 128 characters, and the
// maximum length for a tag's value is 256.
Tags []types.Tag
// Specifies the DNS name for the VPC endpoint that the SMB file share uses to
// connect to Amazon S3. This parameter is required for SMB file shares that
// connect to Amazon S3 through a VPC endpoint, a VPC access point, or an access
// point alias that points to a VPC access point.
VPCEndpointDNSName *string
// A list of users or groups in the Active Directory that are allowed to access
// the file share. A group must be prefixed with the @ character. Acceptable
// formats include: DOMAIN\User1 , user1 , @group1 , and @DOMAIN\group1 . Can only
// be set if Authentication is set to ActiveDirectory .
ValidUserList []string
noSmithyDocumentSerde
}
// CreateSMBFileShareOutput
type CreateSMBFileShareOutput struct {
// The Amazon Resource Name (ARN) of the newly created file share.
FileShareARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSMBFileShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateSMBFileShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateSMBFileShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSMBFileShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSMBFileShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateSMBFileShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CreateSMBFileShare",
}
}
| 291 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Initiates a snapshot of a volume. Storage Gateway provides the ability to back
// up point-in-time snapshots of your data to Amazon Simple Storage (Amazon S3) for
// durable off-site recovery, and also import the data to an Amazon Elastic Block
// Store (EBS) volume in Amazon Elastic Compute Cloud (EC2). You can take snapshots
// of your gateway volume on a scheduled or ad hoc basis. This API enables you to
// take an ad hoc snapshot. For more information, see Editing a snapshot schedule (https://docs.aws.amazon.com/storagegateway/latest/userguide/managing-volumes.html#SchedulingSnapshot)
// . In the CreateSnapshot request, you identify the volume by providing its
// Amazon Resource Name (ARN). You must also provide description for the snapshot.
// When Storage Gateway takes the snapshot of specified volume, the snapshot and
// description appears in the Storage Gateway console. In response, Storage Gateway
// returns you a snapshot ID. You can use this snapshot ID to check the snapshot
// progress or later use it when you want to create a volume from a snapshot. This
// operation is only supported in stored and cached volume gateway type. To list or
// delete a snapshot, you must use the Amazon EC2 API. For more information, see
// DescribeSnapshots (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSnapshots.html)
// or DeleteSnapshot (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteSnapshot.html)
// in the Amazon Elastic Compute Cloud API Reference. Volume and snapshot IDs are
// changing to a longer length ID format. For more information, see the important
// note on the Welcome (https://docs.aws.amazon.com/storagegateway/latest/APIReference/Welcome.html)
// page.
func (c *Client) CreateSnapshot(ctx context.Context, params *CreateSnapshotInput, optFns ...func(*Options)) (*CreateSnapshotOutput, error) {
if params == nil {
params = &CreateSnapshotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSnapshot", params, optFns, c.addOperationCreateSnapshotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSnapshotOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing one or more of the following fields:
// - CreateSnapshotInput$SnapshotDescription
// - CreateSnapshotInput$VolumeARN
type CreateSnapshotInput struct {
// Textual description of the snapshot that appears in the Amazon EC2 console,
// Elastic Block Store snapshots panel in the Description field, and in the Storage
// Gateway snapshot Details pane, Description field.
//
// This member is required.
SnapshotDescription *string
// The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
// return a list of gateway volumes.
//
// This member is required.
VolumeARN *string
// A list of up to 50 tags that can be assigned to a snapshot. Each tag is a
// key-value pair. Valid characters for key and value are letters, spaces, and
// numbers representable in UTF-8 format, and the following special characters: + -
// = . _ : / @. The maximum length of a tag's key is 128 characters, and the
// maximum length for a tag's value is 256.
Tags []types.Tag
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
type CreateSnapshotOutput struct {
// The snapshot ID that is used to refer to the snapshot in future operations such
// as describing snapshots (Amazon Elastic Compute Cloud API DescribeSnapshots ) or
// creating a volume from a snapshot ( CreateStorediSCSIVolume ).
SnapshotId *string
// The Amazon Resource Name (ARN) of the volume of which the snapshot was taken.
VolumeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateSnapshot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateSnapshot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSnapshotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSnapshot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateSnapshot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CreateSnapshot",
}
}
| 168 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Initiates a snapshot of a gateway from a volume recovery point. This operation
// is only supported in the cached volume gateway type. A volume recovery point is
// a point in time at which all data of the volume is consistent and from which you
// can create a snapshot. To get a list of volume recovery point for cached volume
// gateway, use ListVolumeRecoveryPoints . In the
// CreateSnapshotFromVolumeRecoveryPoint request, you identify the volume by
// providing its Amazon Resource Name (ARN). You must also provide a description
// for the snapshot. When the gateway takes a snapshot of the specified volume, the
// snapshot and its description appear in the Storage Gateway console. In response,
// the gateway returns you a snapshot ID. You can use this snapshot ID to check the
// snapshot progress or later use it when you want to create a volume from a
// snapshot. To list or delete a snapshot, you must use the Amazon EC2 API. For
// more information, see DescribeSnapshots (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSnapshots.html)
// or DeleteSnapshot (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteSnapshot.html)
// in the Amazon Elastic Compute Cloud API Reference.
func (c *Client) CreateSnapshotFromVolumeRecoveryPoint(ctx context.Context, params *CreateSnapshotFromVolumeRecoveryPointInput, optFns ...func(*Options)) (*CreateSnapshotFromVolumeRecoveryPointOutput, error) {
if params == nil {
params = &CreateSnapshotFromVolumeRecoveryPointInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSnapshotFromVolumeRecoveryPoint", params, optFns, c.addOperationCreateSnapshotFromVolumeRecoveryPointMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSnapshotFromVolumeRecoveryPointOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSnapshotFromVolumeRecoveryPointInput struct {
// Textual description of the snapshot that appears in the Amazon EC2 console,
// Elastic Block Store snapshots panel in the Description field, and in the Storage
// Gateway snapshot Details pane, Description field.
//
// This member is required.
SnapshotDescription *string
// The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
// DescribeStorediSCSIVolumes operation to return to retrieve the TargetARN for
// specified VolumeARN.
//
// This member is required.
VolumeARN *string
// A list of up to 50 tags that can be assigned to a snapshot. Each tag is a
// key-value pair. Valid characters for key and value are letters, spaces, and
// numbers representable in UTF-8 format, and the following special characters: + -
// = . _ : / @. The maximum length of a tag's key is 128 characters, and the
// maximum length for a tag's value is 256.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateSnapshotFromVolumeRecoveryPointOutput struct {
// The ID of the snapshot.
SnapshotId *string
// The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
// DescribeStorediSCSIVolumes operation to return to retrieve the TargetARN for
// specified VolumeARN.
VolumeARN *string
// The time the volume was created from the recovery point.
VolumeRecoveryPointTime *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSnapshotFromVolumeRecoveryPointMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateSnapshotFromVolumeRecoveryPoint{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateSnapshotFromVolumeRecoveryPoint{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSnapshotFromVolumeRecoveryPointValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSnapshotFromVolumeRecoveryPoint(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateSnapshotFromVolumeRecoveryPoint(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CreateSnapshotFromVolumeRecoveryPoint",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a volume on a specified gateway. This operation is only supported in
// the stored volume gateway type. The size of the volume to create is inferred
// from the disk size. You can choose to preserve existing data on the disk, create
// volume from an existing snapshot, or create an empty volume. If you choose to
// create an empty gateway volume, then any existing data on the disk is erased. In
// the request, you must specify the gateway and the disk information on which you
// are creating the volume. In response, the gateway creates the volume and returns
// volume information such as the volume Amazon Resource Name (ARN), its size, and
// the iSCSI target ARN that initiators can use to connect to the volume target.
func (c *Client) CreateStorediSCSIVolume(ctx context.Context, params *CreateStorediSCSIVolumeInput, optFns ...func(*Options)) (*CreateStorediSCSIVolumeOutput, error) {
if params == nil {
params = &CreateStorediSCSIVolumeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateStorediSCSIVolume", params, optFns, c.addOperationCreateStorediSCSIVolumeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateStorediSCSIVolumeOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing one or more of the following fields:
// - CreateStorediSCSIVolumeInput$DiskId
// - CreateStorediSCSIVolumeInput$NetworkInterfaceId
// - CreateStorediSCSIVolumeInput$PreserveExistingData
// - CreateStorediSCSIVolumeInput$SnapshotId
// - CreateStorediSCSIVolumeInput$TargetName
type CreateStorediSCSIVolumeInput struct {
// The unique identifier for the gateway local disk that is configured as a stored
// volume. Use ListLocalDisks (https://docs.aws.amazon.com/storagegateway/latest/userguide/API_ListLocalDisks.html)
// to list disk IDs for a gateway.
//
// This member is required.
DiskId *string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The network interface of the gateway on which to expose the iSCSI target. Only
// IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of
// the network interfaces available on a gateway. Valid Values: A valid IP address.
//
// This member is required.
NetworkInterfaceId *string
// Set to true if you want to preserve the data on the local disk. Otherwise, set
// to false to create an empty volume. Valid Values: true | false
//
// This member is required.
PreserveExistingData bool
// The name of the iSCSI target used by an initiator to connect to a volume and
// used as a suffix for the target ARN. For example, specifying TargetName as
// myvolume results in the target ARN of
// arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume
// . The target name must be unique across all volumes on a gateway. If you don't
// specify a value, Storage Gateway uses the value that was previously used for
// this volume as the new target name.
//
// This member is required.
TargetName *string
// Set to true to use Amazon S3 server-side encryption with your own KMS key, or
// false to use a key managed by Amazon S3. Optional. Valid Values: true | false
KMSEncrypted *bool
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// The snapshot ID (e.g., "snap-1122aabb") of the snapshot to restore as the new
// stored volume. Specify this field if you want to create the iSCSI storage volume
// from a snapshot; otherwise, do not include this field. To list snapshots for
// your account use DescribeSnapshots (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html)
// in the Amazon Elastic Compute Cloud API Reference.
SnapshotId *string
// A list of up to 50 tags that can be assigned to a stored volume. Each tag is a
// key-value pair. Valid characters for key and value are letters, spaces, and
// numbers representable in UTF-8 format, and the following special characters: + -
// = . _ : / @. The maximum length of a tag's key is 128 characters, and the
// maximum length for a tag's value is 256.
Tags []types.Tag
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
type CreateStorediSCSIVolumeOutput struct {
// The Amazon Resource Name (ARN) of the volume target, which includes the iSCSI
// name that initiators can use to connect to the target.
TargetARN *string
// The Amazon Resource Name (ARN) of the configured volume.
VolumeARN *string
// The size of the volume in bytes.
VolumeSizeInBytes int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateStorediSCSIVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateStorediSCSIVolume{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateStorediSCSIVolume{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateStorediSCSIVolumeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateStorediSCSIVolume(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateStorediSCSIVolume(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CreateStorediSCSIVolume",
}
}
| 202 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a new custom tape pool. You can use custom tape pool to enable tape
// retention lock on tapes that are archived in the custom pool.
func (c *Client) CreateTapePool(ctx context.Context, params *CreateTapePoolInput, optFns ...func(*Options)) (*CreateTapePoolOutput, error) {
if params == nil {
params = &CreateTapePoolInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateTapePool", params, optFns, c.addOperationCreateTapePoolMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateTapePoolOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateTapePoolInput struct {
// The name of the new custom tape pool.
//
// This member is required.
PoolName *string
// The storage class that is associated with the new custom pool. When you use
// your backup application to eject the tape, the tape is archived directly into
// the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to
// the pool.
//
// This member is required.
StorageClass types.TapeStorageClass
// Tape retention lock time is set in days. Tape retention lock can be enabled for
// up to 100 years (36,500 days).
RetentionLockTimeInDays *int32
// Tape retention lock can be configured in two modes. When configured in
// governance mode, Amazon Web Services accounts with specific IAM permissions are
// authorized to remove the tape retention lock from archived virtual tapes. When
// configured in compliance mode, the tape retention lock cannot be removed by any
// user, including the root Amazon Web Services account.
RetentionLockType types.RetentionLockType
// A list of up to 50 tags that can be assigned to tape pool. Each tag is a
// key-value pair. Valid characters for key and value are letters, spaces, and
// numbers representable in UTF-8 format, and the following special characters: + -
// = . _ : / @. The maximum length of a tag's key is 128 characters, and the
// maximum length for a tag's value is 256.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateTapePoolOutput struct {
// The unique Amazon Resource Name (ARN) that represents the custom tape pool. Use
// the ListTapePools operation to return a list of tape pools for your account and
// Amazon Web Services Region.
PoolARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateTapePoolMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateTapePool{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateTapePool{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateTapePoolValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTapePool(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateTapePool(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CreateTapePool",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates one or more virtual tapes. You write data to the virtual tapes and then
// archive the tapes. This operation is only supported in the tape gateway type.
// Cache storage must be allocated to the gateway before you can create virtual
// tapes. Use the AddCache operation to add cache storage to a gateway.
func (c *Client) CreateTapes(ctx context.Context, params *CreateTapesInput, optFns ...func(*Options)) (*CreateTapesOutput, error) {
if params == nil {
params = &CreateTapesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateTapes", params, optFns, c.addOperationCreateTapesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateTapesOutput)
out.ResultMetadata = metadata
return out, nil
}
// CreateTapesInput
type CreateTapesInput struct {
// A unique identifier that you use to retry a request. If you retry a request,
// use the same ClientToken you specified in the initial request. Using the same
// ClientToken prevents creating the tape multiple times.
//
// This member is required.
ClientToken *string
// The unique Amazon Resource Name (ARN) that represents the gateway to associate
// the virtual tapes with. Use the ListGateways operation to return a list of
// gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The number of virtual tapes that you want to create.
//
// This member is required.
NumTapesToCreate *int32
// A prefix that you append to the barcode of the virtual tape you are creating.
// This prefix makes the barcode unique. The prefix must be 1-4 characters in
// length and must be one of the uppercase letters from A to Z.
//
// This member is required.
TapeBarcodePrefix *string
// The size, in bytes, of the virtual tapes that you want to create. The size must
// be aligned by gigabyte (102410241024 bytes).
//
// This member is required.
TapeSizeInBytes *int64
// Set to true to use Amazon S3 server-side encryption with your own KMS key, or
// false to use a key managed by Amazon S3. Optional. Valid Values: true | false
KMSEncrypted *bool
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// The ID of the pool that you want to add your tape to for archiving. The tape in
// this pool is archived in the S3 storage class that is associated with the pool.
// When you use your backup application to eject the tape, the tape is archived
// directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that
// corresponds to the pool.
PoolId *string
// A list of up to 50 tags that can be assigned to a virtual tape. Each tag is a
// key-value pair. Valid characters for key and value are letters, spaces, and
// numbers representable in UTF-8 format, and the following special characters: + -
// = . _ : / @. The maximum length of a tag's key is 128 characters, and the
// maximum length for a tag's value is 256.
Tags []types.Tag
// Set to TRUE if the tape you are creating is to be configured as a
// write-once-read-many (WORM) tape.
Worm bool
noSmithyDocumentSerde
}
// CreateTapeOutput
type CreateTapesOutput struct {
// A list of unique Amazon Resource Names (ARNs) that represents the virtual tapes
// that were created.
TapeARNs []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateTapesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateTapes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateTapes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateTapesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTapes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateTapes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CreateTapes",
}
}
| 185 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a virtual tape by using your own barcode. You write data to the virtual
// tape and then archive the tape. A barcode is unique and cannot be reused if it
// has already been used on a tape. This applies to barcodes used on deleted tapes.
// This operation is only supported in the tape gateway type. Cache storage must be
// allocated to the gateway before you can create a virtual tape. Use the AddCache
// operation to add cache storage to a gateway.
func (c *Client) CreateTapeWithBarcode(ctx context.Context, params *CreateTapeWithBarcodeInput, optFns ...func(*Options)) (*CreateTapeWithBarcodeOutput, error) {
if params == nil {
params = &CreateTapeWithBarcodeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateTapeWithBarcode", params, optFns, c.addOperationCreateTapeWithBarcodeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateTapeWithBarcodeOutput)
out.ResultMetadata = metadata
return out, nil
}
// CreateTapeWithBarcodeInput
type CreateTapeWithBarcodeInput struct {
// The unique Amazon Resource Name (ARN) that represents the gateway to associate
// the virtual tape with. Use the ListGateways operation to return a list of
// gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The barcode that you want to assign to the tape. Barcodes cannot be reused.
// This includes barcodes used for tapes that have been deleted.
//
// This member is required.
TapeBarcode *string
// The size, in bytes, of the virtual tape that you want to create. The size must
// be aligned by gigabyte (102410241024 bytes).
//
// This member is required.
TapeSizeInBytes *int64
// Set to true to use Amazon S3 server-side encryption with your own KMS key, or
// false to use a key managed by Amazon S3. Optional. Valid Values: true | false
KMSEncrypted *bool
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// The ID of the pool that you want to add your tape to for archiving. The tape in
// this pool is archived in the S3 storage class that is associated with the pool.
// When you use your backup application to eject the tape, the tape is archived
// directly into the storage class (S3 Glacier or S3 Deep Archive) that corresponds
// to the pool.
PoolId *string
// A list of up to 50 tags that can be assigned to a virtual tape that has a
// barcode. Each tag is a key-value pair. Valid characters for key and value are
// letters, spaces, and numbers representable in UTF-8 format, and the following
// special characters: + - = . _ : / @. The maximum length of a tag's key is 128
// characters, and the maximum length for a tag's value is 256.
Tags []types.Tag
// Set to TRUE if the tape you are creating is to be configured as a
// write-once-read-many (WORM) tape.
Worm bool
noSmithyDocumentSerde
}
// CreateTapeOutput
type CreateTapeWithBarcodeOutput struct {
// A unique Amazon Resource Name (ARN) that represents the virtual tape that was
// created.
TapeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateTapeWithBarcodeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateTapeWithBarcode{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateTapeWithBarcode{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateTapeWithBarcodeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTapeWithBarcode(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateTapeWithBarcode(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "CreateTapeWithBarcode",
}
}
| 174 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the automatic tape creation policy of a gateway. If you delete this
// policy, new virtual tapes must be created manually. Use the Amazon Resource Name
// (ARN) of the gateway in your request to remove the policy.
func (c *Client) DeleteAutomaticTapeCreationPolicy(ctx context.Context, params *DeleteAutomaticTapeCreationPolicyInput, optFns ...func(*Options)) (*DeleteAutomaticTapeCreationPolicyOutput, error) {
if params == nil {
params = &DeleteAutomaticTapeCreationPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAutomaticTapeCreationPolicy", params, optFns, c.addOperationDeleteAutomaticTapeCreationPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAutomaticTapeCreationPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAutomaticTapeCreationPolicyInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type DeleteAutomaticTapeCreationPolicyOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAutomaticTapeCreationPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAutomaticTapeCreationPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAutomaticTapeCreationPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteAutomaticTapeCreationPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAutomaticTapeCreationPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteAutomaticTapeCreationPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DeleteAutomaticTapeCreationPolicy",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the bandwidth rate limits of a gateway. You can delete either the
// upload and download bandwidth rate limit, or you can delete both. If you delete
// only one of the limits, the other limit remains unchanged. To specify which
// gateway to work with, use the Amazon Resource Name (ARN) of the gateway in your
// request. This operation is supported only for the stored volume, cached volume,
// and tape gateway types.
func (c *Client) DeleteBandwidthRateLimit(ctx context.Context, params *DeleteBandwidthRateLimitInput, optFns ...func(*Options)) (*DeleteBandwidthRateLimitOutput, error) {
if params == nil {
params = &DeleteBandwidthRateLimitInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteBandwidthRateLimit", params, optFns, c.addOperationDeleteBandwidthRateLimitMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteBandwidthRateLimitOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the following fields:
// - DeleteBandwidthRateLimitInput$BandwidthType
type DeleteBandwidthRateLimitInput struct {
// One of the BandwidthType values that indicates the gateway bandwidth rate limit
// to delete. Valid Values: UPLOAD | DOWNLOAD | ALL
//
// This member is required.
BandwidthType *string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway whose
// bandwidth rate information was deleted.
type DeleteBandwidthRateLimitOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteBandwidthRateLimitMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteBandwidthRateLimit{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteBandwidthRateLimit{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteBandwidthRateLimitValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBandwidthRateLimit(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteBandwidthRateLimit(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DeleteBandwidthRateLimit",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes Challenge-Handshake Authentication Protocol (CHAP) credentials for a
// specified iSCSI target and initiator pair. This operation is supported in volume
// and tape gateway types.
func (c *Client) DeleteChapCredentials(ctx context.Context, params *DeleteChapCredentialsInput, optFns ...func(*Options)) (*DeleteChapCredentialsOutput, error) {
if params == nil {
params = &DeleteChapCredentialsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteChapCredentials", params, optFns, c.addOperationDeleteChapCredentialsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteChapCredentialsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing one or more of the following fields:
// - DeleteChapCredentialsInput$InitiatorName
// - DeleteChapCredentialsInput$TargetARN
type DeleteChapCredentialsInput struct {
// The iSCSI initiator that connects to the target.
//
// This member is required.
InitiatorName *string
// The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
// DescribeStorediSCSIVolumes operation to return to retrieve the TargetARN for
// specified VolumeARN.
//
// This member is required.
TargetARN *string
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
type DeleteChapCredentialsOutput struct {
// The iSCSI initiator that connects to the target.
InitiatorName *string
// The Amazon Resource Name (ARN) of the target.
TargetARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteChapCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteChapCredentials{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteChapCredentials{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteChapCredentialsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteChapCredentials(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteChapCredentials(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DeleteChapCredentials",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a file share from an S3 File Gateway. This operation is only supported
// for S3 File Gateways.
func (c *Client) DeleteFileShare(ctx context.Context, params *DeleteFileShareInput, optFns ...func(*Options)) (*DeleteFileShareOutput, error) {
if params == nil {
params = &DeleteFileShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteFileShare", params, optFns, c.addOperationDeleteFileShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteFileShareOutput)
out.ResultMetadata = metadata
return out, nil
}
// DeleteFileShareInput
type DeleteFileShareInput struct {
// The Amazon Resource Name (ARN) of the file share to be deleted.
//
// This member is required.
FileShareARN *string
// If this value is set to true , the operation deletes a file share immediately
// and aborts all data uploads to Amazon Web Services. Otherwise, the file share is
// not deleted until all data is uploaded to Amazon Web Services. This process
// aborts the data upload process, and the file share enters the FORCE_DELETING
// status. Valid Values: true | false
ForceDelete bool
noSmithyDocumentSerde
}
// DeleteFileShareOutput
type DeleteFileShareOutput struct {
// The Amazon Resource Name (ARN) of the deleted file share.
FileShareARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteFileShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteFileShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteFileShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteFileShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFileShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteFileShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DeleteFileShare",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a gateway. To specify which gateway to delete, use the Amazon Resource
// Name (ARN) of the gateway in your request. The operation deletes the gateway;
// however, it does not delete the gateway virtual machine (VM) from your host
// computer. After you delete a gateway, you cannot reactivate it. Completed
// snapshots of the gateway volumes are not deleted upon deleting the gateway,
// however, pending snapshots will not complete. After you delete a gateway, your
// next step is to remove it from your environment. You no longer pay software
// charges after the gateway is deleted; however, your existing Amazon EBS
// snapshots persist and you will continue to be billed for these snapshots. You
// can choose to remove all remaining Amazon EBS snapshots by canceling your Amazon
// EC2 subscription. If you prefer not to cancel your Amazon EC2 subscription, you
// can delete your snapshots using the Amazon EC2 console. For more information,
// see the Storage Gateway detail page (http://aws.amazon.com/storagegateway) .
func (c *Client) DeleteGateway(ctx context.Context, params *DeleteGatewayInput, optFns ...func(*Options)) (*DeleteGatewayOutput, error) {
if params == nil {
params = &DeleteGatewayInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteGateway", params, optFns, c.addOperationDeleteGatewayMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteGatewayOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the ID of the gateway to delete.
type DeleteGatewayInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// A JSON object containing the ID of the deleted gateway.
type DeleteGatewayOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteGateway{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteGateway{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteGatewayValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteGateway(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteGateway(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DeleteGateway",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a snapshot of a volume. You can take snapshots of your gateway volumes
// on a scheduled or ad hoc basis. This API action enables you to delete a snapshot
// schedule for a volume. For more information, see Backing up your volumes (https://docs.aws.amazon.com/storagegateway/latest/userguide/backing-up-volumes.html)
// . In the DeleteSnapshotSchedule request, you identify the volume by providing
// its Amazon Resource Name (ARN). This operation is only supported for cached
// volume gateway types. To list or delete a snapshot, you must use the Amazon EC2
// API. For more information, go to DescribeSnapshots (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSnapshots.html)
// in the Amazon Elastic Compute Cloud API Reference.
func (c *Client) DeleteSnapshotSchedule(ctx context.Context, params *DeleteSnapshotScheduleInput, optFns ...func(*Options)) (*DeleteSnapshotScheduleOutput, error) {
if params == nil {
params = &DeleteSnapshotScheduleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSnapshotSchedule", params, optFns, c.addOperationDeleteSnapshotScheduleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSnapshotScheduleOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSnapshotScheduleInput struct {
// The volume which snapshot schedule to delete.
//
// This member is required.
VolumeARN *string
noSmithyDocumentSerde
}
type DeleteSnapshotScheduleOutput struct {
// The volume which snapshot schedule was deleted.
VolumeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSnapshotScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteSnapshotSchedule{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteSnapshotSchedule{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSnapshotScheduleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSnapshotSchedule(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteSnapshotSchedule(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DeleteSnapshotSchedule",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified virtual tape. This operation is only supported in the
// tape gateway type.
func (c *Client) DeleteTape(ctx context.Context, params *DeleteTapeInput, optFns ...func(*Options)) (*DeleteTapeOutput, error) {
if params == nil {
params = &DeleteTapeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteTape", params, optFns, c.addOperationDeleteTapeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteTapeOutput)
out.ResultMetadata = metadata
return out, nil
}
// DeleteTapeInput
type DeleteTapeInput struct {
// The unique Amazon Resource Name (ARN) of the gateway that the virtual tape to
// delete is associated with. Use the ListGateways operation to return a list of
// gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The Amazon Resource Name (ARN) of the virtual tape to delete.
//
// This member is required.
TapeARN *string
// Set to TRUE to delete an archived tape that belongs to a custom pool with tape
// retention lock. Only archived tapes with tape retention lock set to governance
// can be deleted. Archived tapes with tape retention lock set to compliance can't
// be deleted.
BypassGovernanceRetention bool
noSmithyDocumentSerde
}
// DeleteTapeOutput
type DeleteTapeOutput struct {
// The Amazon Resource Name (ARN) of the deleted virtual tape.
TapeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteTapeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteTape{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteTape{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteTapeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTape(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteTape(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DeleteTape",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified virtual tape from the virtual tape shelf (VTS). This
// operation is only supported in the tape gateway type.
func (c *Client) DeleteTapeArchive(ctx context.Context, params *DeleteTapeArchiveInput, optFns ...func(*Options)) (*DeleteTapeArchiveOutput, error) {
if params == nil {
params = &DeleteTapeArchiveInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteTapeArchive", params, optFns, c.addOperationDeleteTapeArchiveMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteTapeArchiveOutput)
out.ResultMetadata = metadata
return out, nil
}
// DeleteTapeArchiveInput
type DeleteTapeArchiveInput struct {
// The Amazon Resource Name (ARN) of the virtual tape to delete from the virtual
// tape shelf (VTS).
//
// This member is required.
TapeARN *string
// Set to TRUE to delete an archived tape that belongs to a custom pool with tape
// retention lock. Only archived tapes with tape retention lock set to governance
// can be deleted. Archived tapes with tape retention lock set to compliance can't
// be deleted.
BypassGovernanceRetention bool
noSmithyDocumentSerde
}
// DeleteTapeArchiveOutput
type DeleteTapeArchiveOutput struct {
// The Amazon Resource Name (ARN) of the virtual tape that was deleted from the
// virtual tape shelf (VTS).
TapeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteTapeArchiveMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteTapeArchive{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteTapeArchive{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteTapeArchiveValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTapeArchive(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteTapeArchive(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DeleteTapeArchive",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Delete a custom tape pool. A custom tape pool can only be deleted if there are
// no tapes in the pool and if there are no automatic tape creation policies that
// reference the custom tape pool.
func (c *Client) DeleteTapePool(ctx context.Context, params *DeleteTapePoolInput, optFns ...func(*Options)) (*DeleteTapePoolOutput, error) {
if params == nil {
params = &DeleteTapePoolInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteTapePool", params, optFns, c.addOperationDeleteTapePoolMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteTapePoolOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteTapePoolInput struct {
// The Amazon Resource Name (ARN) of the custom tape pool to delete.
//
// This member is required.
PoolARN *string
noSmithyDocumentSerde
}
type DeleteTapePoolOutput struct {
// The Amazon Resource Name (ARN) of the custom tape pool being deleted.
PoolARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteTapePoolMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteTapePool{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteTapePool{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteTapePoolValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTapePool(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteTapePool(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DeleteTapePool",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified storage volume that you previously created using the
// CreateCachediSCSIVolume or CreateStorediSCSIVolume API. This operation is only
// supported in the cached volume and stored volume types. For stored volume
// gateways, the local disk that was configured as the storage volume is not
// deleted. You can reuse the local disk to create another storage volume. Before
// you delete a volume, make sure there are no iSCSI connections to the volume you
// are deleting. You should also make sure there is no snapshot in progress. You
// can use the Amazon Elastic Compute Cloud (Amazon EC2) API to query snapshots on
// the volume you are deleting and check the snapshot status. For more information,
// go to DescribeSnapshots (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html)
// in the Amazon Elastic Compute Cloud API Reference. In the request, you must
// provide the Amazon Resource Name (ARN) of the storage volume you want to delete.
func (c *Client) DeleteVolume(ctx context.Context, params *DeleteVolumeInput, optFns ...func(*Options)) (*DeleteVolumeOutput, error) {
if params == nil {
params = &DeleteVolumeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteVolume", params, optFns, c.addOperationDeleteVolumeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteVolumeOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the DeleteVolumeInput$VolumeARN to delete.
type DeleteVolumeInput struct {
// The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
// return a list of gateway volumes.
//
// This member is required.
VolumeARN *string
noSmithyDocumentSerde
}
// A JSON object containing the Amazon Resource Name (ARN) of the storage volume
// that was deleted.
type DeleteVolumeOutput struct {
// The Amazon Resource Name (ARN) of the storage volume that was deleted. It is
// the same ARN you provided in the request.
VolumeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteVolume{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteVolume{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteVolumeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVolume(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteVolume(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DeleteVolume",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns information about the most recent high availability monitoring test
// that was performed on the host in a cluster. If a test isn't performed, the
// status and start time in the response would be null.
func (c *Client) DescribeAvailabilityMonitorTest(ctx context.Context, params *DescribeAvailabilityMonitorTestInput, optFns ...func(*Options)) (*DescribeAvailabilityMonitorTestOutput, error) {
if params == nil {
params = &DescribeAvailabilityMonitorTestInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAvailabilityMonitorTest", params, optFns, c.addOperationDescribeAvailabilityMonitorTestMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAvailabilityMonitorTestOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAvailabilityMonitorTestInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type DescribeAvailabilityMonitorTestOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// The time the high availability monitoring test was started. If a test hasn't
// been performed, the value of this field is null.
StartTime *time.Time
// The status of the high availability monitoring test. If a test hasn't been
// performed, the value of this field is null.
Status types.AvailabilityMonitorTestStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAvailabilityMonitorTestMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAvailabilityMonitorTest{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAvailabilityMonitorTest{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAvailabilityMonitorTestValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAvailabilityMonitorTest(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeAvailabilityMonitorTest(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeAvailabilityMonitorTest",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the bandwidth rate limits of a gateway. By default, these limits are
// not set, which means no bandwidth rate limiting is in effect. This operation is
// supported only for the stored volume, cached volume, and tape gateway types. To
// describe bandwidth rate limits for S3 file gateways, use
// DescribeBandwidthRateLimitSchedule . This operation returns a value for a
// bandwidth rate limit only if the limit is set. If no limits are set for the
// gateway, then this operation returns only the gateway ARN in the response body.
// To specify which gateway to describe, use the Amazon Resource Name (ARN) of the
// gateway in your request.
func (c *Client) DescribeBandwidthRateLimit(ctx context.Context, params *DescribeBandwidthRateLimitInput, optFns ...func(*Options)) (*DescribeBandwidthRateLimitOutput, error) {
if params == nil {
params = &DescribeBandwidthRateLimitInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeBandwidthRateLimit", params, optFns, c.addOperationDescribeBandwidthRateLimitMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeBandwidthRateLimitOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway.
type DescribeBandwidthRateLimitInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
type DescribeBandwidthRateLimitOutput struct {
// The average download bandwidth rate limit in bits per second. This field does
// not appear in the response if the download rate limit is not set.
AverageDownloadRateLimitInBitsPerSec *int64
// The average upload bandwidth rate limit in bits per second. This field does not
// appear in the response if the upload rate limit is not set.
AverageUploadRateLimitInBitsPerSec *int64
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeBandwidthRateLimitMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeBandwidthRateLimit{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeBandwidthRateLimit{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeBandwidthRateLimitValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBandwidthRateLimit(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeBandwidthRateLimit(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeBandwidthRateLimit",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about the bandwidth rate limit schedule of a gateway. By
// default, gateways do not have bandwidth rate limit schedules, which means no
// bandwidth rate limiting is in effect. This operation is supported only for
// volume, tape and S3 file gateways. FSx file gateways do not support bandwidth
// rate limits. This operation returns information about a gateway's bandwidth rate
// limit schedule. A bandwidth rate limit schedule consists of one or more
// bandwidth rate limit intervals. A bandwidth rate limit interval defines a period
// of time on one or more days of the week, during which bandwidth rate limits are
// specified for uploading, downloading, or both. A bandwidth rate limit interval
// consists of one or more days of the week, a start hour and minute, an ending
// hour and minute, and bandwidth rate limits for uploading and downloading If no
// bandwidth rate limit schedule intervals are set for the gateway, this operation
// returns an empty response. To specify which gateway to describe, use the Amazon
// Resource Name (ARN) of the gateway in your request.
func (c *Client) DescribeBandwidthRateLimitSchedule(ctx context.Context, params *DescribeBandwidthRateLimitScheduleInput, optFns ...func(*Options)) (*DescribeBandwidthRateLimitScheduleOutput, error) {
if params == nil {
params = &DescribeBandwidthRateLimitScheduleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeBandwidthRateLimitSchedule", params, optFns, c.addOperationDescribeBandwidthRateLimitScheduleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeBandwidthRateLimitScheduleOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeBandwidthRateLimitScheduleInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type DescribeBandwidthRateLimitScheduleOutput struct {
// An array that contains the bandwidth rate limit intervals for a tape or volume
// gateway.
BandwidthRateLimitIntervals []types.BandwidthRateLimitInterval
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeBandwidthRateLimitScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeBandwidthRateLimitSchedule{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeBandwidthRateLimitSchedule{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeBandwidthRateLimitScheduleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBandwidthRateLimitSchedule(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeBandwidthRateLimitSchedule(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeBandwidthRateLimitSchedule",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about the cache of a gateway. This operation is only
// supported in the cached volume, tape, and file gateway types. The response
// includes disk IDs that are configured as cache, and it includes the amount of
// cache allocated and used.
func (c *Client) DescribeCache(ctx context.Context, params *DescribeCacheInput, optFns ...func(*Options)) (*DescribeCacheOutput, error) {
if params == nil {
params = &DescribeCacheInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeCache", params, optFns, c.addOperationDescribeCacheMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeCacheOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeCacheInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type DescribeCacheOutput struct {
// The amount of cache in bytes allocated to a gateway.
CacheAllocatedInBytes int64
// The file share's contribution to the overall percentage of the gateway's cache
// that has not been persisted to Amazon Web Services. The sample is taken at the
// end of the reporting period.
CacheDirtyPercentage float64
// Percent of application read operations from the file shares that are served
// from cache. The sample is taken at the end of the reporting period.
CacheHitPercentage float64
// Percent of application read operations from the file shares that are not served
// from cache. The sample is taken at the end of the reporting period.
CacheMissPercentage float64
// Percent use of the gateway's cache storage. This metric applies only to the
// gateway-cached volume setup. The sample is taken at the end of the reporting
// period.
CacheUsedPercentage float64
// An array of strings that identify disks that are to be configured as working
// storage. Each string has a minimum length of 1 and maximum length of 300. You
// can get the disk IDs from the ListLocalDisks API.
DiskIds []string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeCacheMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCache{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCache{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeCacheValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCache(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeCache(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeCache",
}
}
| 155 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a description of the gateway volumes specified in the request. This
// operation is only supported in the cached volume gateway types. The list of
// gateway volumes in the request must be from one gateway. In the response,
// Storage Gateway returns volume information sorted by volume Amazon Resource Name
// (ARN).
func (c *Client) DescribeCachediSCSIVolumes(ctx context.Context, params *DescribeCachediSCSIVolumesInput, optFns ...func(*Options)) (*DescribeCachediSCSIVolumesOutput, error) {
if params == nil {
params = &DescribeCachediSCSIVolumesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeCachediSCSIVolumes", params, optFns, c.addOperationDescribeCachediSCSIVolumesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeCachediSCSIVolumesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeCachediSCSIVolumesInput struct {
// An array of strings where each string represents the Amazon Resource Name (ARN)
// of a cached volume. All of the specified cached volumes must be from the same
// gateway. Use ListVolumes to get volume ARNs for a gateway.
//
// This member is required.
VolumeARNs []string
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
type DescribeCachediSCSIVolumesOutput struct {
// An array of objects where each object contains metadata about one cached volume.
CachediSCSIVolumes []types.CachediSCSIVolume
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeCachediSCSIVolumesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCachediSCSIVolumes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCachediSCSIVolumes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeCachediSCSIVolumesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCachediSCSIVolumes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeCachediSCSIVolumes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeCachediSCSIVolumes",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns an array of Challenge-Handshake Authentication Protocol (CHAP)
// credentials information for a specified iSCSI target, one for each
// target-initiator pair. This operation is supported in the volume and tape
// gateway types.
func (c *Client) DescribeChapCredentials(ctx context.Context, params *DescribeChapCredentialsInput, optFns ...func(*Options)) (*DescribeChapCredentialsOutput, error) {
if params == nil {
params = &DescribeChapCredentialsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeChapCredentials", params, optFns, c.addOperationDescribeChapCredentialsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeChapCredentialsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the Amazon Resource Name (ARN) of the iSCSI volume
// target.
type DescribeChapCredentialsInput struct {
// The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
// DescribeStorediSCSIVolumes operation to return to retrieve the TargetARN for
// specified VolumeARN.
//
// This member is required.
TargetARN *string
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
type DescribeChapCredentialsOutput struct {
// An array of ChapInfo objects that represent CHAP credentials. Each object in
// the array contains CHAP credential information for one target-initiator pair. If
// no CHAP credentials are set, an empty array is returned. CHAP credential
// information is provided in a JSON object with the following fields:
// - InitiatorName: The iSCSI initiator that connects to the target.
// - SecretToAuthenticateInitiator: The secret key that the initiator (for
// example, the Windows client) must provide to participate in mutual CHAP with the
// target.
// - SecretToAuthenticateTarget: The secret key that the target must provide to
// participate in mutual CHAP with the initiator (e.g. Windows client).
// - TargetARN: The Amazon Resource Name (ARN) of the storage volume.
ChapCredentials []types.ChapInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeChapCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeChapCredentials{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeChapCredentials{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeChapCredentialsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeChapCredentials(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeChapCredentials(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeChapCredentials",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets the file system association information. This operation is only supported
// for FSx File Gateways.
func (c *Client) DescribeFileSystemAssociations(ctx context.Context, params *DescribeFileSystemAssociationsInput, optFns ...func(*Options)) (*DescribeFileSystemAssociationsOutput, error) {
if params == nil {
params = &DescribeFileSystemAssociationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeFileSystemAssociations", params, optFns, c.addOperationDescribeFileSystemAssociationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeFileSystemAssociationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeFileSystemAssociationsInput struct {
// An array containing the Amazon Resource Name (ARN) of each file system
// association to be described.
//
// This member is required.
FileSystemAssociationARNList []string
noSmithyDocumentSerde
}
type DescribeFileSystemAssociationsOutput struct {
// An array containing the FileSystemAssociationInfo data type of each file system
// association to be described.
FileSystemAssociationInfoList []types.FileSystemAssociationInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeFileSystemAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeFileSystemAssociations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeFileSystemAssociations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeFileSystemAssociationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFileSystemAssociations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeFileSystemAssociations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeFileSystemAssociations",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns metadata about a gateway such as its name, network interfaces,
// configured time zone, and the state (whether the gateway is running or not). To
// specify which gateway to describe, use the Amazon Resource Name (ARN) of the
// gateway in your request.
func (c *Client) DescribeGatewayInformation(ctx context.Context, params *DescribeGatewayInformationInput, optFns ...func(*Options)) (*DescribeGatewayInformationOutput, error) {
if params == nil {
params = &DescribeGatewayInformationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeGatewayInformation", params, optFns, c.addOperationDescribeGatewayInformationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeGatewayInformationOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the ID of the gateway.
type DescribeGatewayInformationInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
type DescribeGatewayInformationOutput struct {
// The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used
// to monitor events in the gateway. This field only only exist and returns once it
// have been chosen and set by the SGW service, based on the OS version of the
// gateway VM
CloudWatchLogGroupARN *string
// Date after which this gateway will not receive software updates for new
// features and bug fixes.
DeprecationDate *string
// The ID of the Amazon EC2 instance that was used to launch the gateway.
Ec2InstanceId *string
// The Amazon Web Services Region where the Amazon EC2 instance is located.
Ec2InstanceRegion *string
// The type of endpoint for your gateway. Valid Values: STANDARD | FIPS
EndpointType *string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Specifies the size of the gateway's metadata cache.
GatewayCapacity types.GatewayCapacity
// The unique identifier assigned to your gateway during activation. This ID
// becomes part of the gateway Amazon Resource Name (ARN), which you use as input
// for other operations.
GatewayId *string
// The name you configured for your gateway.
GatewayName *string
// A NetworkInterface array that contains descriptions of the gateway network
// interfaces.
GatewayNetworkInterfaces []types.NetworkInterface
// A value that indicates the operating state of the gateway.
GatewayState *string
// A value that indicates the time zone configured for the gateway.
GatewayTimezone *string
// The type of the gateway.
GatewayType *string
// The type of hardware or software platform on which the gateway is running.
HostEnvironment types.HostEnvironment
// A unique identifier for the specific instance of the host platform running the
// gateway. This value is only available for certain host environments, and its
// format depends on the host environment type.
HostEnvironmentId *string
// The date on which the last software update was applied to the gateway. If the
// gateway has never been updated, this field does not return a value in the
// response. This only only exist and returns once it have been chosen and set by
// the SGW service, based on the OS version of the gateway VM
LastSoftwareUpdate *string
// The date on which an update to the gateway is available. This date is in the
// time zone of the gateway. If the gateway is not available for an update this
// field is not returned in the response.
NextUpdateAvailabilityDate *string
// Date after which this gateway will not receive software updates for new
// features.
SoftwareUpdatesEndDate *string
// A list of the metadata cache sizes that the gateway can support based on its
// current hardware specifications.
SupportedGatewayCapacities []types.GatewayCapacity
// A list of up to 50 tags assigned to the gateway, sorted alphabetically by key
// name. Each tag is a key-value pair. For a gateway with more than 10 tags
// assigned, you can view all tags using the ListTagsForResource API operation.
Tags []types.Tag
// The configuration settings for the virtual private cloud (VPC) endpoint for
// your gateway.
VPCEndpoint *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeGatewayInformationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeGatewayInformation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeGatewayInformation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeGatewayInformationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeGatewayInformation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeGatewayInformation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeGatewayInformation",
}
}
| 211 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns your gateway's weekly maintenance start time including the day and time
// of the week. Note that values are in terms of the gateway's time zone.
func (c *Client) DescribeMaintenanceStartTime(ctx context.Context, params *DescribeMaintenanceStartTimeInput, optFns ...func(*Options)) (*DescribeMaintenanceStartTimeOutput, error) {
if params == nil {
params = &DescribeMaintenanceStartTimeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceStartTime", params, optFns, c.addOperationDescribeMaintenanceStartTimeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeMaintenanceStartTimeOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway.
type DescribeMaintenanceStartTimeInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
// - DescribeMaintenanceStartTimeOutput$DayOfMonth
// - DescribeMaintenanceStartTimeOutput$DayOfWeek
// - DescribeMaintenanceStartTimeOutput$HourOfDay
// - DescribeMaintenanceStartTimeOutput$MinuteOfHour
// - DescribeMaintenanceStartTimeOutput$Timezone
type DescribeMaintenanceStartTimeOutput struct {
// The day of the month component of the maintenance start time represented as an
// ordinal number from 1 to 28, where 1 represents the first day of the month and
// 28 represents the last day of the month.
DayOfMonth *int32
// An ordinal number between 0 and 6 that represents the day of the week, where 0
// represents Sunday and 6 represents Saturday. The day of week is in the time zone
// of the gateway.
DayOfWeek *int32
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// The hour component of the maintenance start time represented as hh, where hh is
// the hour (0 to 23). The hour of the day is in the time zone of the gateway.
HourOfDay *int32
// The minute component of the maintenance start time represented as mm, where mm
// is the minute (0 to 59). The minute of the hour is in the time zone of the
// gateway.
MinuteOfHour *int32
// A value that indicates the time zone that is set for the gateway. The start
// time and day of week specified should be in the time zone of the gateway.
Timezone *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeMaintenanceStartTimeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceStartTime{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMaintenanceStartTime{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeMaintenanceStartTimeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceStartTime(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeMaintenanceStartTime(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeMaintenanceStartTime",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a description for one or more Network File System (NFS) file shares from
// an S3 File Gateway. This operation is only supported for S3 File Gateways.
func (c *Client) DescribeNFSFileShares(ctx context.Context, params *DescribeNFSFileSharesInput, optFns ...func(*Options)) (*DescribeNFSFileSharesOutput, error) {
if params == nil {
params = &DescribeNFSFileSharesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeNFSFileShares", params, optFns, c.addOperationDescribeNFSFileSharesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeNFSFileSharesOutput)
out.ResultMetadata = metadata
return out, nil
}
// DescribeNFSFileSharesInput
type DescribeNFSFileSharesInput struct {
// An array containing the Amazon Resource Name (ARN) of each file share to be
// described.
//
// This member is required.
FileShareARNList []string
noSmithyDocumentSerde
}
// DescribeNFSFileSharesOutput
type DescribeNFSFileSharesOutput struct {
// An array containing a description for each requested file share.
NFSFileShareInfoList []types.NFSFileShareInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeNFSFileSharesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeNFSFileShares{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeNFSFileShares{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeNFSFileSharesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNFSFileShares(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeNFSFileShares(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeNFSFileShares",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a description for one or more Server Message Block (SMB) file shares from
// a S3 File Gateway. This operation is only supported for S3 File Gateways.
func (c *Client) DescribeSMBFileShares(ctx context.Context, params *DescribeSMBFileSharesInput, optFns ...func(*Options)) (*DescribeSMBFileSharesOutput, error) {
if params == nil {
params = &DescribeSMBFileSharesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSMBFileShares", params, optFns, c.addOperationDescribeSMBFileSharesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSMBFileSharesOutput)
out.ResultMetadata = metadata
return out, nil
}
// DescribeSMBFileSharesInput
type DescribeSMBFileSharesInput struct {
// An array containing the Amazon Resource Name (ARN) of each file share to be
// described.
//
// This member is required.
FileShareARNList []string
noSmithyDocumentSerde
}
// DescribeSMBFileSharesOutput
type DescribeSMBFileSharesOutput struct {
// An array containing a description for each requested file share.
SMBFileShareInfoList []types.SMBFileShareInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeSMBFileSharesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSMBFileShares{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSMBFileShares{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeSMBFileSharesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSMBFileShares(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeSMBFileShares(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeSMBFileShares",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a description of a Server Message Block (SMB) file share settings from a
// file gateway. This operation is only supported for file gateways.
func (c *Client) DescribeSMBSettings(ctx context.Context, params *DescribeSMBSettingsInput, optFns ...func(*Options)) (*DescribeSMBSettingsOutput, error) {
if params == nil {
params = &DescribeSMBSettingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSMBSettings", params, optFns, c.addOperationDescribeSMBSettingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSMBSettingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeSMBSettingsInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type DescribeSMBSettingsOutput struct {
// Indicates the status of a gateway that is a member of the Active Directory
// domain.
// - ACCESS_DENIED : Indicates that the JoinDomain operation failed due to an
// authentication error.
// - DETACHED : Indicates that gateway is not joined to a domain.
// - JOINED : Indicates that the gateway has successfully joined a domain.
// - JOINING : Indicates that a JoinDomain operation is in progress.
// - NETWORK_ERROR : Indicates that JoinDomain operation failed due to a network
// or connectivity error.
// - TIMEOUT : Indicates that the JoinDomain operation failed because the
// operation didn't complete within the allotted time.
// - UNKNOWN_ERROR : Indicates that the JoinDomain operation failed due to
// another type of error.
ActiveDirectoryStatus types.ActiveDirectoryStatus
// The name of the domain that the gateway is joined to.
DomainName *string
// The shares on this gateway appear when listing shares. Only supported for S3
// File Gateways.
FileSharesVisible *bool
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// This value is true if a password for the guest user smbguest is set, otherwise
// false . Only supported for S3 File Gateways. Valid Values: true | false
SMBGuestPasswordSet *bool
// A list of Active Directory users and groups that have special permissions for
// SMB file shares on the gateway.
SMBLocalGroups *types.SMBLocalGroups
// The type of security strategy that was specified for file gateway.
// - ClientSpecified : If you use this option, requests are established based on
// what is negotiated by the client. This option is recommended when you want to
// maximize compatibility across different clients in your environment. Only
// supported for S3 File Gateways.
// - MandatorySigning : If you use this option, file gateway only allows
// connections from SMBv2 or SMBv3 clients that have signing enabled. This option
// works with SMB clients on Microsoft Windows Vista, Windows Server 2008 or newer.
//
// - MandatoryEncryption : If you use this option, file gateway only allows
// connections from SMBv3 clients that have encryption enabled. This option is
// highly recommended for environments that handle sensitive data. This option
// works with SMB clients on Microsoft Windows 8, Windows Server 2012 or newer.
SMBSecurityStrategy types.SMBSecurityStrategy
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeSMBSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSMBSettings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSMBSettings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeSMBSettingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSMBSettings(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeSMBSettings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeSMBSettings",
}
}
| 173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the snapshot schedule for the specified gateway volume. The snapshot
// schedule information includes intervals at which snapshots are automatically
// initiated on the volume. This operation is only supported in the cached volume
// and stored volume types.
func (c *Client) DescribeSnapshotSchedule(ctx context.Context, params *DescribeSnapshotScheduleInput, optFns ...func(*Options)) (*DescribeSnapshotScheduleOutput, error) {
if params == nil {
params = &DescribeSnapshotScheduleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSnapshotSchedule", params, optFns, c.addOperationDescribeSnapshotScheduleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSnapshotScheduleOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the DescribeSnapshotScheduleInput$VolumeARN of the
// volume.
type DescribeSnapshotScheduleInput struct {
// The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
// return a list of gateway volumes.
//
// This member is required.
VolumeARN *string
noSmithyDocumentSerde
}
type DescribeSnapshotScheduleOutput struct {
// The snapshot description.
Description *string
// The number of hours between snapshots.
RecurrenceInHours *int32
// The hour of the day at which the snapshot schedule begins represented as hh,
// where hh is the hour (0 to 23). The hour of the day is in the time zone of the
// gateway.
StartAt *int32
// A list of up to 50 tags assigned to the snapshot schedule, sorted
// alphabetically by key name. Each tag is a key-value pair. For a gateway with
// more than 10 tags assigned, you can view all tags using the ListTagsForResource
// API operation.
Tags []types.Tag
// A value that indicates the time zone of the gateway.
Timezone *string
// The Amazon Resource Name (ARN) of the volume that was specified in the request.
VolumeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeSnapshotScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSnapshotSchedule{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSnapshotSchedule{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeSnapshotScheduleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSnapshotSchedule(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeSnapshotSchedule(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeSnapshotSchedule",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the description of the gateway volumes specified in the request. The
// list of gateway volumes in the request must be from one gateway. In the
// response, Storage Gateway returns volume information sorted by volume ARNs. This
// operation is only supported in stored volume gateway type.
func (c *Client) DescribeStorediSCSIVolumes(ctx context.Context, params *DescribeStorediSCSIVolumesInput, optFns ...func(*Options)) (*DescribeStorediSCSIVolumesOutput, error) {
if params == nil {
params = &DescribeStorediSCSIVolumesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeStorediSCSIVolumes", params, optFns, c.addOperationDescribeStorediSCSIVolumesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeStorediSCSIVolumesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing a list of DescribeStorediSCSIVolumesInput$VolumeARNs .
type DescribeStorediSCSIVolumesInput struct {
// An array of strings where each string represents the Amazon Resource Name (ARN)
// of a stored volume. All of the specified stored volumes must be from the same
// gateway. Use ListVolumes to get volume ARNs for a gateway.
//
// This member is required.
VolumeARNs []string
noSmithyDocumentSerde
}
type DescribeStorediSCSIVolumesOutput struct {
// Describes a single unit of output from DescribeStorediSCSIVolumes . The
// following fields are returned:
// - ChapEnabled : Indicates whether mutual CHAP is enabled for the iSCSI target.
// - LunNumber : The logical disk number.
// - NetworkInterfaceId : The network interface ID of the stored volume that
// initiator use to map the stored volume as an iSCSI target.
// - NetworkInterfacePort : The port used to communicate with iSCSI targets.
// - PreservedExistingData : Indicates when the stored volume was created,
// existing data on the underlying local disk was preserved.
// - SourceSnapshotId : If the stored volume was created from a snapshot, this
// field contains the snapshot ID used, e.g. snap-1122aabb . Otherwise, this
// field is not included.
// - StorediSCSIVolumes : An array of StorediSCSIVolume objects where each object
// contains metadata about one stored volume.
// - TargetARN : The Amazon Resource Name (ARN) of the volume target.
// - VolumeARN : The Amazon Resource Name (ARN) of the stored volume.
// - VolumeDiskId : The disk ID of the local disk that was specified in the
// CreateStorediSCSIVolume operation.
// - VolumeId : The unique identifier of the storage volume, e.g. vol-1122AABB .
// - VolumeiSCSIAttributes : An VolumeiSCSIAttributes object that represents a
// collection of iSCSI attributes for one stored volume.
// - VolumeProgress : Represents the percentage complete if the volume is
// restoring or bootstrapping that represents the percent of data transferred. This
// field does not appear in the response if the stored volume is not restoring or
// bootstrapping.
// - VolumeSizeInBytes : The size of the volume in bytes.
// - VolumeStatus : One of the VolumeStatus values that indicates the state of
// the volume.
// - VolumeType : One of the enumeration values describing the type of the
// volume. Currently, only STORED volumes are supported.
StorediSCSIVolumes []types.StorediSCSIVolume
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeStorediSCSIVolumesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeStorediSCSIVolumes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeStorediSCSIVolumes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeStorediSCSIVolumesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeStorediSCSIVolumes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeStorediSCSIVolumes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeStorediSCSIVolumes",
}
}
| 160 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a description of specified virtual tapes in the virtual tape shelf
// (VTS). This operation is only supported in the tape gateway type. If a specific
// TapeARN is not specified, Storage Gateway returns a description of all virtual
// tapes found in the VTS associated with your account.
func (c *Client) DescribeTapeArchives(ctx context.Context, params *DescribeTapeArchivesInput, optFns ...func(*Options)) (*DescribeTapeArchivesOutput, error) {
if params == nil {
params = &DescribeTapeArchivesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTapeArchives", params, optFns, c.addOperationDescribeTapeArchivesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTapeArchivesOutput)
out.ResultMetadata = metadata
return out, nil
}
// DescribeTapeArchivesInput
type DescribeTapeArchivesInput struct {
// Specifies that the number of virtual tapes described be limited to the
// specified number.
Limit *int32
// An opaque string that indicates the position at which to begin describing
// virtual tapes.
Marker *string
// Specifies one or more unique Amazon Resource Names (ARNs) that represent the
// virtual tapes you want to describe.
TapeARNs []string
noSmithyDocumentSerde
}
// DescribeTapeArchivesOutput
type DescribeTapeArchivesOutput struct {
// An opaque string that indicates the position at which the virtual tapes that
// were fetched for description ended. Use this marker in your next request to
// fetch the next set of virtual tapes in the virtual tape shelf (VTS). If there
// are no more virtual tapes to describe, this field does not appear in the
// response.
Marker *string
// An array of virtual tape objects in the virtual tape shelf (VTS). The
// description includes of the Amazon Resource Name (ARN) of the virtual tapes. The
// information returned includes the Amazon Resource Names (ARNs) of the tapes,
// size of the tapes, status of the tapes, progress of the description, and tape
// barcode.
TapeArchives []types.TapeArchive
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTapeArchivesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeTapeArchives{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeTapeArchives{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTapeArchives(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeTapeArchivesAPIClient is a client that implements the
// DescribeTapeArchives operation.
type DescribeTapeArchivesAPIClient interface {
DescribeTapeArchives(context.Context, *DescribeTapeArchivesInput, ...func(*Options)) (*DescribeTapeArchivesOutput, error)
}
var _ DescribeTapeArchivesAPIClient = (*Client)(nil)
// DescribeTapeArchivesPaginatorOptions is the paginator options for
// DescribeTapeArchives
type DescribeTapeArchivesPaginatorOptions struct {
// Specifies that the number of virtual tapes described be limited to the
// specified number.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// DescribeTapeArchivesPaginator is a paginator for DescribeTapeArchives
type DescribeTapeArchivesPaginator struct {
options DescribeTapeArchivesPaginatorOptions
client DescribeTapeArchivesAPIClient
params *DescribeTapeArchivesInput
nextToken *string
firstPage bool
}
// NewDescribeTapeArchivesPaginator returns a new DescribeTapeArchivesPaginator
func NewDescribeTapeArchivesPaginator(client DescribeTapeArchivesAPIClient, params *DescribeTapeArchivesInput, optFns ...func(*DescribeTapeArchivesPaginatorOptions)) *DescribeTapeArchivesPaginator {
if params == nil {
params = &DescribeTapeArchivesInput{}
}
options := DescribeTapeArchivesPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &DescribeTapeArchivesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *DescribeTapeArchivesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next DescribeTapeArchives page.
func (p *DescribeTapeArchivesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTapeArchivesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.DescribeTapeArchives(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opDescribeTapeArchives(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeTapeArchives",
}
}
| 238 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of virtual tape recovery points that are available for the
// specified tape gateway. A recovery point is a point-in-time view of a virtual
// tape at which all the data on the virtual tape is consistent. If your gateway
// crashes, virtual tapes that have recovery points can be recovered to a new
// gateway. This operation is only supported in the tape gateway type.
func (c *Client) DescribeTapeRecoveryPoints(ctx context.Context, params *DescribeTapeRecoveryPointsInput, optFns ...func(*Options)) (*DescribeTapeRecoveryPointsOutput, error) {
if params == nil {
params = &DescribeTapeRecoveryPointsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTapeRecoveryPoints", params, optFns, c.addOperationDescribeTapeRecoveryPointsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTapeRecoveryPointsOutput)
out.ResultMetadata = metadata
return out, nil
}
// DescribeTapeRecoveryPointsInput
type DescribeTapeRecoveryPointsInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// Specifies that the number of virtual tape recovery points that are described be
// limited to the specified number.
Limit *int32
// An opaque string that indicates the position at which to begin describing the
// virtual tape recovery points.
Marker *string
noSmithyDocumentSerde
}
// DescribeTapeRecoveryPointsOutput
type DescribeTapeRecoveryPointsOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// An opaque string that indicates the position at which the virtual tape recovery
// points that were listed for description ended. Use this marker in your next
// request to list the next set of virtual tape recovery points in the list. If
// there are no more recovery points to describe, this field does not appear in the
// response.
Marker *string
// An array of TapeRecoveryPointInfos that are available for the specified gateway.
TapeRecoveryPointInfos []types.TapeRecoveryPointInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTapeRecoveryPointsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeTapeRecoveryPoints{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeTapeRecoveryPoints{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTapeRecoveryPointsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTapeRecoveryPoints(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeTapeRecoveryPointsAPIClient is a client that implements the
// DescribeTapeRecoveryPoints operation.
type DescribeTapeRecoveryPointsAPIClient interface {
DescribeTapeRecoveryPoints(context.Context, *DescribeTapeRecoveryPointsInput, ...func(*Options)) (*DescribeTapeRecoveryPointsOutput, error)
}
var _ DescribeTapeRecoveryPointsAPIClient = (*Client)(nil)
// DescribeTapeRecoveryPointsPaginatorOptions is the paginator options for
// DescribeTapeRecoveryPoints
type DescribeTapeRecoveryPointsPaginatorOptions struct {
// Specifies that the number of virtual tape recovery points that are described be
// limited to the specified number.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// DescribeTapeRecoveryPointsPaginator is a paginator for
// DescribeTapeRecoveryPoints
type DescribeTapeRecoveryPointsPaginator struct {
options DescribeTapeRecoveryPointsPaginatorOptions
client DescribeTapeRecoveryPointsAPIClient
params *DescribeTapeRecoveryPointsInput
nextToken *string
firstPage bool
}
// NewDescribeTapeRecoveryPointsPaginator returns a new
// DescribeTapeRecoveryPointsPaginator
func NewDescribeTapeRecoveryPointsPaginator(client DescribeTapeRecoveryPointsAPIClient, params *DescribeTapeRecoveryPointsInput, optFns ...func(*DescribeTapeRecoveryPointsPaginatorOptions)) *DescribeTapeRecoveryPointsPaginator {
if params == nil {
params = &DescribeTapeRecoveryPointsInput{}
}
options := DescribeTapeRecoveryPointsPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &DescribeTapeRecoveryPointsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *DescribeTapeRecoveryPointsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next DescribeTapeRecoveryPoints page.
func (p *DescribeTapeRecoveryPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTapeRecoveryPointsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.DescribeTapeRecoveryPoints(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opDescribeTapeRecoveryPoints(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeTapeRecoveryPoints",
}
}
| 246 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a description of the specified Amazon Resource Name (ARN) of virtual
// tapes. If a TapeARN is not specified, returns a description of all virtual
// tapes associated with the specified gateway. This operation is only supported in
// the tape gateway type.
func (c *Client) DescribeTapes(ctx context.Context, params *DescribeTapesInput, optFns ...func(*Options)) (*DescribeTapesOutput, error) {
if params == nil {
params = &DescribeTapesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTapes", params, optFns, c.addOperationDescribeTapesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTapesOutput)
out.ResultMetadata = metadata
return out, nil
}
// DescribeTapesInput
type DescribeTapesInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// Specifies that the number of virtual tapes described be limited to the
// specified number. Amazon Web Services may impose its own limit, if this field is
// not set.
Limit *int32
// A marker value, obtained in a previous call to DescribeTapes . This marker
// indicates which page of results to retrieve. If not specified, the first page of
// results is retrieved.
Marker *string
// Specifies one or more unique Amazon Resource Names (ARNs) that represent the
// virtual tapes you want to describe. If this parameter is not specified, Tape
// gateway returns a description of all virtual tapes associated with the specified
// gateway.
TapeARNs []string
noSmithyDocumentSerde
}
// DescribeTapesOutput
type DescribeTapesOutput struct {
// An opaque string that can be used as part of a subsequent DescribeTapes call to
// retrieve the next page of results. If a response does not contain a marker, then
// there are no more results to be retrieved.
Marker *string
// An array of virtual tape descriptions.
Tapes []types.Tape
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTapesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeTapes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeTapes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTapesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTapes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeTapesAPIClient is a client that implements the DescribeTapes operation.
type DescribeTapesAPIClient interface {
DescribeTapes(context.Context, *DescribeTapesInput, ...func(*Options)) (*DescribeTapesOutput, error)
}
var _ DescribeTapesAPIClient = (*Client)(nil)
// DescribeTapesPaginatorOptions is the paginator options for DescribeTapes
type DescribeTapesPaginatorOptions struct {
// Specifies that the number of virtual tapes described be limited to the
// specified number. Amazon Web Services may impose its own limit, if this field is
// not set.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// DescribeTapesPaginator is a paginator for DescribeTapes
type DescribeTapesPaginator struct {
options DescribeTapesPaginatorOptions
client DescribeTapesAPIClient
params *DescribeTapesInput
nextToken *string
firstPage bool
}
// NewDescribeTapesPaginator returns a new DescribeTapesPaginator
func NewDescribeTapesPaginator(client DescribeTapesAPIClient, params *DescribeTapesInput, optFns ...func(*DescribeTapesPaginatorOptions)) *DescribeTapesPaginator {
if params == nil {
params = &DescribeTapesInput{}
}
options := DescribeTapesPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &DescribeTapesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *DescribeTapesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next DescribeTapes page.
func (p *DescribeTapesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTapesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.DescribeTapes(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opDescribeTapes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeTapes",
}
}
| 244 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about the upload buffer of a gateway. This operation is
// supported for the stored volume, cached volume, and tape gateway types. The
// response includes disk IDs that are configured as upload buffer space, and it
// includes the amount of upload buffer space allocated and used.
func (c *Client) DescribeUploadBuffer(ctx context.Context, params *DescribeUploadBufferInput, optFns ...func(*Options)) (*DescribeUploadBufferOutput, error) {
if params == nil {
params = &DescribeUploadBufferInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeUploadBuffer", params, optFns, c.addOperationDescribeUploadBufferMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeUploadBufferOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeUploadBufferInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type DescribeUploadBufferOutput struct {
// An array of the gateway's local disk IDs that are configured as working
// storage. Each local disk ID is specified as a string (minimum length of 1 and
// maximum length of 300). If no local disks are configured as working storage,
// then the DiskIds array is empty.
DiskIds []string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// The total number of bytes allocated in the gateway's as upload buffer.
UploadBufferAllocatedInBytes int64
// The total number of bytes being used in the gateway's upload buffer.
UploadBufferUsedInBytes int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeUploadBufferMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeUploadBuffer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeUploadBuffer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeUploadBufferValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeUploadBuffer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeUploadBuffer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeUploadBuffer",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a description of virtual tape library (VTL) devices for the specified
// tape gateway. In the response, Storage Gateway returns VTL device information.
// This operation is only supported in the tape gateway type.
func (c *Client) DescribeVTLDevices(ctx context.Context, params *DescribeVTLDevicesInput, optFns ...func(*Options)) (*DescribeVTLDevicesOutput, error) {
if params == nil {
params = &DescribeVTLDevicesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeVTLDevices", params, optFns, c.addOperationDescribeVTLDevicesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeVTLDevicesOutput)
out.ResultMetadata = metadata
return out, nil
}
// DescribeVTLDevicesInput
type DescribeVTLDevicesInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// Specifies that the number of VTL devices described be limited to the specified
// number.
Limit *int32
// An opaque string that indicates the position at which to begin describing the
// VTL devices.
Marker *string
// An array of strings, where each string represents the Amazon Resource Name
// (ARN) of a VTL device. All of the specified VTL devices must be from the same
// gateway. If no VTL devices are specified, the result will contain all devices on
// the specified gateway.
VTLDeviceARNs []string
noSmithyDocumentSerde
}
// DescribeVTLDevicesOutput
type DescribeVTLDevicesOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// An opaque string that indicates the position at which the VTL devices that were
// fetched for description ended. Use the marker in your next request to fetch the
// next set of VTL devices in the list. If there are no more VTL devices to
// describe, this field does not appear in the response.
Marker *string
// An array of VTL device objects composed of the Amazon Resource Name (ARN) of
// the VTL devices.
VTLDevices []types.VTLDevice
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeVTLDevicesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeVTLDevices{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeVTLDevices{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeVTLDevicesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVTLDevices(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeVTLDevicesAPIClient is a client that implements the DescribeVTLDevices
// operation.
type DescribeVTLDevicesAPIClient interface {
DescribeVTLDevices(context.Context, *DescribeVTLDevicesInput, ...func(*Options)) (*DescribeVTLDevicesOutput, error)
}
var _ DescribeVTLDevicesAPIClient = (*Client)(nil)
// DescribeVTLDevicesPaginatorOptions is the paginator options for
// DescribeVTLDevices
type DescribeVTLDevicesPaginatorOptions struct {
// Specifies that the number of VTL devices described be limited to the specified
// number.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// DescribeVTLDevicesPaginator is a paginator for DescribeVTLDevices
type DescribeVTLDevicesPaginator struct {
options DescribeVTLDevicesPaginatorOptions
client DescribeVTLDevicesAPIClient
params *DescribeVTLDevicesInput
nextToken *string
firstPage bool
}
// NewDescribeVTLDevicesPaginator returns a new DescribeVTLDevicesPaginator
func NewDescribeVTLDevicesPaginator(client DescribeVTLDevicesAPIClient, params *DescribeVTLDevicesInput, optFns ...func(*DescribeVTLDevicesPaginatorOptions)) *DescribeVTLDevicesPaginator {
if params == nil {
params = &DescribeVTLDevicesInput{}
}
options := DescribeVTLDevicesPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &DescribeVTLDevicesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *DescribeVTLDevicesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next DescribeVTLDevices page.
func (p *DescribeVTLDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVTLDevicesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.DescribeVTLDevices(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opDescribeVTLDevices(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeVTLDevices",
}
}
| 248 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about the working storage of a gateway. This operation is
// only supported in the stored volumes gateway type. This operation is deprecated
// in cached volumes API version (20120630). Use DescribeUploadBuffer instead.
// Working storage is also referred to as upload buffer. You can also use the
// DescribeUploadBuffer operation to add upload buffer to a stored volume gateway.
// The response includes disk IDs that are configured as working storage, and it
// includes the amount of working storage allocated and used.
func (c *Client) DescribeWorkingStorage(ctx context.Context, params *DescribeWorkingStorageInput, optFns ...func(*Options)) (*DescribeWorkingStorageOutput, error) {
if params == nil {
params = &DescribeWorkingStorageInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeWorkingStorage", params, optFns, c.addOperationDescribeWorkingStorageMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeWorkingStorageOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway.
type DescribeWorkingStorageInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
type DescribeWorkingStorageOutput struct {
// An array of the gateway's local disk IDs that are configured as working
// storage. Each local disk ID is specified as a string (minimum length of 1 and
// maximum length of 300). If no local disks are configured as working storage,
// then the DiskIds array is empty.
DiskIds []string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// The total working storage in bytes allocated for the gateway. If no working
// storage is configured for the gateway, this field returns 0.
WorkingStorageAllocatedInBytes int64
// The total working storage in bytes in use by the gateway. If no working storage
// is configured for the gateway, this field returns 0.
WorkingStorageUsedInBytes int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeWorkingStorageMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeWorkingStorage{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeWorkingStorage{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeWorkingStorageValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeWorkingStorage(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeWorkingStorage(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DescribeWorkingStorage",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disconnects a volume from an iSCSI connection and then detaches the volume from
// the specified gateway. Detaching and attaching a volume enables you to recover
// your data from one gateway to a different gateway without creating a snapshot.
// It also makes it easier to move your volumes from an on-premises gateway to a
// gateway hosted on an Amazon EC2 instance. This operation is only supported in
// the volume gateway type.
func (c *Client) DetachVolume(ctx context.Context, params *DetachVolumeInput, optFns ...func(*Options)) (*DetachVolumeOutput, error) {
if params == nil {
params = &DetachVolumeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DetachVolume", params, optFns, c.addOperationDetachVolumeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DetachVolumeOutput)
out.ResultMetadata = metadata
return out, nil
}
// AttachVolumeInput
type DetachVolumeInput struct {
// The Amazon Resource Name (ARN) of the volume to detach from the gateway.
//
// This member is required.
VolumeARN *string
// Set to true to forcibly remove the iSCSI connection of the target volume and
// detach the volume. The default is false . If this value is set to false , you
// must manually disconnect the iSCSI connection from the target volume. Valid
// Values: true | false
ForceDetach *bool
noSmithyDocumentSerde
}
// AttachVolumeOutput
type DetachVolumeOutput struct {
// The Amazon Resource Name (ARN) of the volume that was detached.
VolumeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDetachVolumeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDetachVolume{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDetachVolume{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDetachVolumeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetachVolume(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDetachVolume(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DetachVolume",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disables a tape gateway when the gateway is no longer functioning. For example,
// if your gateway VM is damaged, you can disable the gateway so you can recover
// virtual tapes. Use this operation for a tape gateway that is not reachable or
// not functioning. This operation is only supported in the tape gateway type.
// After a gateway is disabled, it cannot be enabled.
func (c *Client) DisableGateway(ctx context.Context, params *DisableGatewayInput, optFns ...func(*Options)) (*DisableGatewayOutput, error) {
if params == nil {
params = &DisableGatewayInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisableGateway", params, optFns, c.addOperationDisableGatewayMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisableGatewayOutput)
out.ResultMetadata = metadata
return out, nil
}
// DisableGatewayInput
type DisableGatewayInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// DisableGatewayOutput
type DisableGatewayOutput struct {
// The unique Amazon Resource Name (ARN) of the disabled gateway.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisableGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisableGateway{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisableGateway{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDisableGatewayValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableGateway(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDisableGateway(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DisableGateway",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disassociates an Amazon FSx file system from the specified gateway. After the
// disassociation process finishes, the gateway can no longer access the Amazon FSx
// file system. This operation is only supported in the FSx File Gateway type.
func (c *Client) DisassociateFileSystem(ctx context.Context, params *DisassociateFileSystemInput, optFns ...func(*Options)) (*DisassociateFileSystemOutput, error) {
if params == nil {
params = &DisassociateFileSystemInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisassociateFileSystem", params, optFns, c.addOperationDisassociateFileSystemMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisassociateFileSystemOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisassociateFileSystemInput struct {
// The Amazon Resource Name (ARN) of the file system association to be deleted.
//
// This member is required.
FileSystemAssociationARN *string
// If this value is set to true, the operation disassociates an Amazon FSx file
// system immediately. It ends all data uploads to the file system, and the file
// system association enters the FORCE_DELETING status. If this value is set to
// false, the Amazon FSx file system does not disassociate until all data is
// uploaded.
ForceDelete bool
noSmithyDocumentSerde
}
type DisassociateFileSystemOutput struct {
// The Amazon Resource Name (ARN) of the deleted file system association.
FileSystemAssociationARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisassociateFileSystemMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateFileSystem{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateFileSystem{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDisassociateFileSystemValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateFileSystem(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDisassociateFileSystem(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "DisassociateFileSystem",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the automatic tape creation policies for a gateway. If there are no
// automatic tape creation policies for the gateway, it returns an empty list. This
// operation is only supported for tape gateways.
func (c *Client) ListAutomaticTapeCreationPolicies(ctx context.Context, params *ListAutomaticTapeCreationPoliciesInput, optFns ...func(*Options)) (*ListAutomaticTapeCreationPoliciesOutput, error) {
if params == nil {
params = &ListAutomaticTapeCreationPoliciesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAutomaticTapeCreationPolicies", params, optFns, c.addOperationListAutomaticTapeCreationPoliciesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAutomaticTapeCreationPoliciesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAutomaticTapeCreationPoliciesInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
noSmithyDocumentSerde
}
type ListAutomaticTapeCreationPoliciesOutput struct {
// Gets a listing of information about the gateway's automatic tape creation
// policies, including the automatic tape creation rules and the gateway that is
// using the policies.
AutomaticTapeCreationPolicyInfos []types.AutomaticTapeCreationPolicyInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAutomaticTapeCreationPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAutomaticTapeCreationPolicies{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAutomaticTapeCreationPolicies{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAutomaticTapeCreationPolicies(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListAutomaticTapeCreationPolicies(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListAutomaticTapeCreationPolicies",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of the file shares for a specific S3 File Gateway, or the list of
// file shares that belong to the calling user account. This operation is only
// supported for S3 File Gateways.
func (c *Client) ListFileShares(ctx context.Context, params *ListFileSharesInput, optFns ...func(*Options)) (*ListFileSharesOutput, error) {
if params == nil {
params = &ListFileSharesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListFileShares", params, optFns, c.addOperationListFileSharesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListFileSharesOutput)
out.ResultMetadata = metadata
return out, nil
}
// ListFileShareInput
type ListFileSharesInput struct {
// The Amazon Resource Name (ARN) of the gateway whose file shares you want to
// list. If this field is not present, all file shares under your account are
// listed.
GatewayARN *string
// The maximum number of file shares to return in the response. The value must be
// an integer with a value greater than zero. Optional.
Limit *int32
// Opaque pagination token returned from a previous ListFileShares operation. If
// present, Marker specifies where to continue the list from after a previous call
// to ListFileShares. Optional.
Marker *string
noSmithyDocumentSerde
}
// ListFileShareOutput
type ListFileSharesOutput struct {
// An array of information about the S3 File Gateway's file shares.
FileShareInfoList []types.FileShareInfo
// If the request includes Marker , the response returns that value in this field.
Marker *string
// If a value is present, there are more file shares to return. In a subsequent
// request, use NextMarker as the value for Marker to retrieve the next set of
// file shares.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListFileSharesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListFileShares{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListFileShares{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFileShares(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListFileSharesAPIClient is a client that implements the ListFileShares
// operation.
type ListFileSharesAPIClient interface {
ListFileShares(context.Context, *ListFileSharesInput, ...func(*Options)) (*ListFileSharesOutput, error)
}
var _ ListFileSharesAPIClient = (*Client)(nil)
// ListFileSharesPaginatorOptions is the paginator options for ListFileShares
type ListFileSharesPaginatorOptions struct {
// The maximum number of file shares to return in the response. The value must be
// an integer with a value greater than zero. Optional.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListFileSharesPaginator is a paginator for ListFileShares
type ListFileSharesPaginator struct {
options ListFileSharesPaginatorOptions
client ListFileSharesAPIClient
params *ListFileSharesInput
nextToken *string
firstPage bool
}
// NewListFileSharesPaginator returns a new ListFileSharesPaginator
func NewListFileSharesPaginator(client ListFileSharesAPIClient, params *ListFileSharesInput, optFns ...func(*ListFileSharesPaginatorOptions)) *ListFileSharesPaginator {
if params == nil {
params = &ListFileSharesInput{}
}
options := ListFileSharesPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &ListFileSharesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListFileSharesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListFileShares page.
func (p *ListFileSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFileSharesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.ListFileShares(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListFileShares(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListFileShares",
}
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of FileSystemAssociationSummary objects. Each object contains a
// summary of a file system association. This operation is only supported for FSx
// File Gateways.
func (c *Client) ListFileSystemAssociations(ctx context.Context, params *ListFileSystemAssociationsInput, optFns ...func(*Options)) (*ListFileSystemAssociationsOutput, error) {
if params == nil {
params = &ListFileSystemAssociationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListFileSystemAssociations", params, optFns, c.addOperationListFileSystemAssociationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListFileSystemAssociationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListFileSystemAssociationsInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// The maximum number of file system associations to return in the response. If
// present, Limit must be an integer with a value greater than zero. Optional.
Limit *int32
// Opaque pagination token returned from a previous ListFileSystemAssociations
// operation. If present, Marker specifies where to continue the list from after a
// previous call to ListFileSystemAssociations . Optional.
Marker *string
noSmithyDocumentSerde
}
type ListFileSystemAssociationsOutput struct {
// An array of information about the Amazon FSx gateway's file system associations.
FileSystemAssociationSummaryList []types.FileSystemAssociationSummary
// If the request includes Marker , the response returns that value in this field.
Marker *string
// If a value is present, there are more file system associations to return. In a
// subsequent request, use NextMarker as the value for Marker to retrieve the next
// set of file system associations.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListFileSystemAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListFileSystemAssociations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListFileSystemAssociations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFileSystemAssociations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListFileSystemAssociationsAPIClient is a client that implements the
// ListFileSystemAssociations operation.
type ListFileSystemAssociationsAPIClient interface {
ListFileSystemAssociations(context.Context, *ListFileSystemAssociationsInput, ...func(*Options)) (*ListFileSystemAssociationsOutput, error)
}
var _ ListFileSystemAssociationsAPIClient = (*Client)(nil)
// ListFileSystemAssociationsPaginatorOptions is the paginator options for
// ListFileSystemAssociations
type ListFileSystemAssociationsPaginatorOptions struct {
// The maximum number of file system associations to return in the response. If
// present, Limit must be an integer with a value greater than zero. Optional.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListFileSystemAssociationsPaginator is a paginator for
// ListFileSystemAssociations
type ListFileSystemAssociationsPaginator struct {
options ListFileSystemAssociationsPaginatorOptions
client ListFileSystemAssociationsAPIClient
params *ListFileSystemAssociationsInput
nextToken *string
firstPage bool
}
// NewListFileSystemAssociationsPaginator returns a new
// ListFileSystemAssociationsPaginator
func NewListFileSystemAssociationsPaginator(client ListFileSystemAssociationsAPIClient, params *ListFileSystemAssociationsInput, optFns ...func(*ListFileSystemAssociationsPaginatorOptions)) *ListFileSystemAssociationsPaginator {
if params == nil {
params = &ListFileSystemAssociationsInput{}
}
options := ListFileSystemAssociationsPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &ListFileSystemAssociationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListFileSystemAssociationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListFileSystemAssociations page.
func (p *ListFileSystemAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFileSystemAssociationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.ListFileSystemAssociations(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListFileSystemAssociations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListFileSystemAssociations",
}
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists gateways owned by an Amazon Web Services account in an Amazon Web
// Services Region specified in the request. The returned list is ordered by
// gateway Amazon Resource Name (ARN). By default, the operation returns a maximum
// of 100 gateways. This operation supports pagination that allows you to
// optionally reduce the number of gateways returned in a response. If you have
// more gateways than are returned in a response (that is, the response returns
// only a truncated list of your gateways), the response contains a marker that you
// can specify in your next request to fetch the next page of gateways.
func (c *Client) ListGateways(ctx context.Context, params *ListGatewaysInput, optFns ...func(*Options)) (*ListGatewaysOutput, error) {
if params == nil {
params = &ListGatewaysInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListGateways", params, optFns, c.addOperationListGatewaysMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListGatewaysOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing zero or more of the following fields:
// - ListGatewaysInput$Limit
// - ListGatewaysInput$Marker
type ListGatewaysInput struct {
// Specifies that the list of gateways returned be limited to the specified number
// of items.
Limit *int32
// An opaque string that indicates the position at which to begin the returned
// list of gateways.
Marker *string
noSmithyDocumentSerde
}
type ListGatewaysOutput struct {
// An array of GatewayInfo objects.
Gateways []types.GatewayInfo
// Use the marker in your next request to fetch the next set of gateways in the
// list. If there are no more gateways to list, this field does not appear in the
// response.
Marker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListGateways{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListGateways{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListGateways(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListGatewaysAPIClient is a client that implements the ListGateways operation.
type ListGatewaysAPIClient interface {
ListGateways(context.Context, *ListGatewaysInput, ...func(*Options)) (*ListGatewaysOutput, error)
}
var _ ListGatewaysAPIClient = (*Client)(nil)
// ListGatewaysPaginatorOptions is the paginator options for ListGateways
type ListGatewaysPaginatorOptions struct {
// Specifies that the list of gateways returned be limited to the specified number
// of items.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListGatewaysPaginator is a paginator for ListGateways
type ListGatewaysPaginator struct {
options ListGatewaysPaginatorOptions
client ListGatewaysAPIClient
params *ListGatewaysInput
nextToken *string
firstPage bool
}
// NewListGatewaysPaginator returns a new ListGatewaysPaginator
func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator {
if params == nil {
params = &ListGatewaysInput{}
}
options := ListGatewaysPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &ListGatewaysPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListGatewaysPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListGateways page.
func (p *ListGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewaysOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.ListGateways(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListGateways(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListGateways",
}
}
| 231 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of the gateway's local disks. To specify which gateway to
// describe, you use the Amazon Resource Name (ARN) of the gateway in the body of
// the request. The request returns a list of all disks, specifying which are
// configured as working storage, cache storage, or stored volume or not configured
// at all. The response includes a DiskStatus field. This field can have a value
// of present (the disk is available to use), missing (the disk is no longer
// connected to the gateway), or mismatch (the disk node is occupied by a disk that
// has incorrect metadata or the disk content is corrupted).
func (c *Client) ListLocalDisks(ctx context.Context, params *ListLocalDisksInput, optFns ...func(*Options)) (*ListLocalDisksOutput, error) {
if params == nil {
params = &ListLocalDisksInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLocalDisks", params, optFns, c.addOperationListLocalDisksMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLocalDisksOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway.
type ListLocalDisksInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type ListLocalDisksOutput struct {
// A JSON object containing the following fields:
// - ListLocalDisksOutput$Disks
Disks []types.Disk
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLocalDisksMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLocalDisks{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLocalDisks{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListLocalDisksValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLocalDisks(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListLocalDisks(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListLocalDisks",
}
}
| 139 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the tags that have been added to the specified resource. This operation
// is supported in storage gateways of all types.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
// ListTagsForResourceInput
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) of the resource for which you want to list tags.
//
// This member is required.
ResourceARN *string
// Specifies that the list of tags returned be limited to the specified number of
// items.
Limit *int32
// An opaque string that indicates the position at which to begin returning the
// list of tags.
Marker *string
noSmithyDocumentSerde
}
// ListTagsForResourceOutput
type ListTagsForResourceOutput struct {
// An opaque string that indicates the position at which to stop returning the
// list of tags.
Marker *string
// The Amazon Resource Name (ARN) of the resource for which you want to list tags.
ResourceARN *string
// An array that contains the tags for the specified resource.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListTagsForResourceAPIClient is a client that implements the
// ListTagsForResource operation.
type ListTagsForResourceAPIClient interface {
ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error)
}
var _ ListTagsForResourceAPIClient = (*Client)(nil)
// ListTagsForResourcePaginatorOptions is the paginator options for
// ListTagsForResource
type ListTagsForResourcePaginatorOptions struct {
// Specifies that the list of tags returned be limited to the specified number of
// items.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTagsForResourcePaginator is a paginator for ListTagsForResource
type ListTagsForResourcePaginator struct {
options ListTagsForResourcePaginatorOptions
client ListTagsForResourceAPIClient
params *ListTagsForResourceInput
nextToken *string
firstPage bool
}
// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator
func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator {
if params == nil {
params = &ListTagsForResourceInput{}
}
options := ListTagsForResourcePaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &ListTagsForResourcePaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTagsForResourcePaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTagsForResource page.
func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListTagsForResource",
}
}
| 236 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists custom tape pools. You specify custom tape pools to list by specifying
// one or more custom tape pool Amazon Resource Names (ARNs). If you don't specify
// a custom tape pool ARN, the operation lists all custom tape pools. This
// operation supports pagination. You can optionally specify the Limit parameter
// in the body to limit the number of tape pools in the response. If the number of
// tape pools returned in the response is truncated, the response includes a Marker
// element that you can use in your subsequent request to retrieve the next set of
// tape pools.
func (c *Client) ListTapePools(ctx context.Context, params *ListTapePoolsInput, optFns ...func(*Options)) (*ListTapePoolsOutput, error) {
if params == nil {
params = &ListTapePoolsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTapePools", params, optFns, c.addOperationListTapePoolsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTapePoolsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTapePoolsInput struct {
// An optional number limit for the tape pools in the list returned by this call.
Limit *int32
// A string that indicates the position at which to begin the returned list of
// tape pools.
Marker *string
// The Amazon Resource Name (ARN) of each of the custom tape pools you want to
// list. If you don't specify a custom tape pool ARN, the response lists all custom
// tape pools.
PoolARNs []string
noSmithyDocumentSerde
}
type ListTapePoolsOutput struct {
// A string that indicates the position at which to begin the returned list of
// tape pools. Use the marker in your next request to continue pagination of tape
// pools. If there are no more tape pools to list, this element does not appear in
// the response body.
Marker *string
// An array of PoolInfo objects, where each object describes a single custom tape
// pool. If there are no custom tape pools, the PoolInfos is an empty array.
PoolInfos []types.PoolInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTapePoolsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTapePools{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTapePools{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTapePools(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListTapePoolsAPIClient is a client that implements the ListTapePools operation.
type ListTapePoolsAPIClient interface {
ListTapePools(context.Context, *ListTapePoolsInput, ...func(*Options)) (*ListTapePoolsOutput, error)
}
var _ ListTapePoolsAPIClient = (*Client)(nil)
// ListTapePoolsPaginatorOptions is the paginator options for ListTapePools
type ListTapePoolsPaginatorOptions struct {
// An optional number limit for the tape pools in the list returned by this call.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTapePoolsPaginator is a paginator for ListTapePools
type ListTapePoolsPaginator struct {
options ListTapePoolsPaginatorOptions
client ListTapePoolsAPIClient
params *ListTapePoolsInput
nextToken *string
firstPage bool
}
// NewListTapePoolsPaginator returns a new ListTapePoolsPaginator
func NewListTapePoolsPaginator(client ListTapePoolsAPIClient, params *ListTapePoolsInput, optFns ...func(*ListTapePoolsPaginatorOptions)) *ListTapePoolsPaginator {
if params == nil {
params = &ListTapePoolsInput{}
}
options := ListTapePoolsPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &ListTapePoolsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTapePoolsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTapePools page.
func (p *ListTapePoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTapePoolsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.ListTapePools(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListTapePools(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListTapePools",
}
}
| 233 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists virtual tapes in your virtual tape library (VTL) and your virtual tape
// shelf (VTS). You specify the tapes to list by specifying one or more tape Amazon
// Resource Names (ARNs). If you don't specify a tape ARN, the operation lists all
// virtual tapes in both your VTL and VTS. This operation supports pagination. By
// default, the operation returns a maximum of up to 100 tapes. You can optionally
// specify the Limit parameter in the body to limit the number of tapes in the
// response. If the number of tapes returned in the response is truncated, the
// response includes a Marker element that you can use in your subsequent request
// to retrieve the next set of tapes. This operation is only supported in the tape
// gateway type.
func (c *Client) ListTapes(ctx context.Context, params *ListTapesInput, optFns ...func(*Options)) (*ListTapesOutput, error) {
if params == nil {
params = &ListTapesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTapes", params, optFns, c.addOperationListTapesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTapesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object that contains one or more of the following fields:
// - ListTapesInput$Limit
// - ListTapesInput$Marker
// - ListTapesInput$TapeARNs
type ListTapesInput struct {
// An optional number limit for the tapes in the list returned by this call.
Limit *int32
// A string that indicates the position at which to begin the returned list of
// tapes.
Marker *string
// The Amazon Resource Name (ARN) of each of the tapes you want to list. If you
// don't specify a tape ARN, the response lists all tapes in both your VTL and VTS.
TapeARNs []string
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
// - ListTapesOutput$Marker
// - ListTapesOutput$VolumeInfos
type ListTapesOutput struct {
// A string that indicates the position at which to begin returning the next list
// of tapes. Use the marker in your next request to continue pagination of tapes.
// If there are no more tapes to list, this element does not appear in the response
// body.
Marker *string
// An array of TapeInfo objects, where each object describes a single tape. If
// there are no tapes in the tape library or VTS, then the TapeInfos is an empty
// array.
TapeInfos []types.TapeInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTapesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTapes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTapes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTapes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListTapesAPIClient is a client that implements the ListTapes operation.
type ListTapesAPIClient interface {
ListTapes(context.Context, *ListTapesInput, ...func(*Options)) (*ListTapesOutput, error)
}
var _ ListTapesAPIClient = (*Client)(nil)
// ListTapesPaginatorOptions is the paginator options for ListTapes
type ListTapesPaginatorOptions struct {
// An optional number limit for the tapes in the list returned by this call.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTapesPaginator is a paginator for ListTapes
type ListTapesPaginator struct {
options ListTapesPaginatorOptions
client ListTapesAPIClient
params *ListTapesInput
nextToken *string
firstPage bool
}
// NewListTapesPaginator returns a new ListTapesPaginator
func NewListTapesPaginator(client ListTapesAPIClient, params *ListTapesInput, optFns ...func(*ListTapesPaginatorOptions)) *ListTapesPaginator {
if params == nil {
params = &ListTapesInput{}
}
options := ListTapesPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &ListTapesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTapesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTapes page.
func (p *ListTapesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTapesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.ListTapes(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListTapes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListTapes",
}
}
| 242 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists iSCSI initiators that are connected to a volume. You can use this
// operation to determine whether a volume is being used or not. This operation is
// only supported in the cached volume and stored volume gateway types.
func (c *Client) ListVolumeInitiators(ctx context.Context, params *ListVolumeInitiatorsInput, optFns ...func(*Options)) (*ListVolumeInitiatorsOutput, error) {
if params == nil {
params = &ListVolumeInitiatorsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListVolumeInitiators", params, optFns, c.addOperationListVolumeInitiatorsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListVolumeInitiatorsOutput)
out.ResultMetadata = metadata
return out, nil
}
// ListVolumeInitiatorsInput
type ListVolumeInitiatorsInput struct {
// The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
// return a list of gateway volumes for the gateway.
//
// This member is required.
VolumeARN *string
noSmithyDocumentSerde
}
// ListVolumeInitiatorsOutput
type ListVolumeInitiatorsOutput struct {
// The host names and port numbers of all iSCSI initiators that are connected to
// the gateway.
Initiators []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListVolumeInitiatorsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListVolumeInitiators{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListVolumeInitiators{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListVolumeInitiatorsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVolumeInitiators(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListVolumeInitiators(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListVolumeInitiators",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the recovery points for a specified gateway. This operation is only
// supported in the cached volume gateway type. Each cache volume has one recovery
// point. A volume recovery point is a point in time at which all data of the
// volume is consistent and from which you can create a snapshot or clone a new
// cached volume from a source volume. To create a snapshot from a volume recovery
// point use the CreateSnapshotFromVolumeRecoveryPoint operation.
func (c *Client) ListVolumeRecoveryPoints(ctx context.Context, params *ListVolumeRecoveryPointsInput, optFns ...func(*Options)) (*ListVolumeRecoveryPointsOutput, error) {
if params == nil {
params = &ListVolumeRecoveryPointsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListVolumeRecoveryPoints", params, optFns, c.addOperationListVolumeRecoveryPointsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListVolumeRecoveryPointsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListVolumeRecoveryPointsInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type ListVolumeRecoveryPointsOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// An array of VolumeRecoveryPointInfo objects.
VolumeRecoveryPointInfos []types.VolumeRecoveryPointInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListVolumeRecoveryPointsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListVolumeRecoveryPoints{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListVolumeRecoveryPoints{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListVolumeRecoveryPointsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVolumeRecoveryPoints(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListVolumeRecoveryPoints(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListVolumeRecoveryPoints",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the iSCSI stored volumes of a gateway. Results are sorted by volume ARN.
// The response includes only the volume ARNs. If you want additional volume
// information, use the DescribeStorediSCSIVolumes or the
// DescribeCachediSCSIVolumes API. The operation supports pagination. By default,
// the operation returns a maximum of up to 100 volumes. You can optionally specify
// the Limit field in the body to limit the number of volumes in the response. If
// the number of volumes returned in the response is truncated, the response
// includes a Marker field. You can use this Marker value in your subsequent
// request to retrieve the next set of volumes. This operation is only supported in
// the cached volume and stored volume gateway types.
func (c *Client) ListVolumes(ctx context.Context, params *ListVolumesInput, optFns ...func(*Options)) (*ListVolumesOutput, error) {
if params == nil {
params = &ListVolumesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListVolumes", params, optFns, c.addOperationListVolumesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListVolumesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object that contains one or more of the following fields:
// - ListVolumesInput$Limit
// - ListVolumesInput$Marker
type ListVolumesInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Specifies that the list of volumes returned be limited to the specified number
// of items.
Limit *int32
// A string that indicates the position at which to begin the returned list of
// volumes. Obtain the marker from the response of a previous List iSCSI Volumes
// request.
Marker *string
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
// - ListVolumesOutput$Marker
// - ListVolumesOutput$VolumeInfos
type ListVolumesOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Use the marker in your next request to continue pagination of iSCSI volumes. If
// there are no more volumes to list, this field does not appear in the response
// body.
Marker *string
// An array of VolumeInfo objects, where each object describes an iSCSI volume. If
// no volumes are defined for the gateway, then VolumeInfos is an empty array "[]".
VolumeInfos []types.VolumeInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListVolumesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListVolumes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListVolumes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVolumes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListVolumesAPIClient is a client that implements the ListVolumes operation.
type ListVolumesAPIClient interface {
ListVolumes(context.Context, *ListVolumesInput, ...func(*Options)) (*ListVolumesOutput, error)
}
var _ ListVolumesAPIClient = (*Client)(nil)
// ListVolumesPaginatorOptions is the paginator options for ListVolumes
type ListVolumesPaginatorOptions struct {
// Specifies that the list of volumes returned be limited to the specified number
// of items.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListVolumesPaginator is a paginator for ListVolumes
type ListVolumesPaginator struct {
options ListVolumesPaginatorOptions
client ListVolumesAPIClient
params *ListVolumesInput
nextToken *string
firstPage bool
}
// NewListVolumesPaginator returns a new ListVolumesPaginator
func NewListVolumesPaginator(client ListVolumesAPIClient, params *ListVolumesInput, optFns ...func(*ListVolumesPaginatorOptions)) *ListVolumesPaginator {
if params == nil {
params = &ListVolumesInput{}
}
options := ListVolumesPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &ListVolumesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListVolumesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListVolumes page.
func (p *ListVolumesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVolumesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.Limit = limit
result, err := p.client.ListVolumes(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListVolumes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ListVolumes",
}
}
| 246 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sends you notification through CloudWatch Events when all files written to your
// file share have been uploaded to S3. Amazon S3. Storage Gateway can send a
// notification through Amazon CloudWatch Events when all files written to your
// file share up to that point in time have been uploaded to Amazon S3. These files
// include files written to the file share up to the time that you make a request
// for notification. When the upload is done, Storage Gateway sends you
// notification through an Amazon CloudWatch Event. You can configure CloudWatch
// Events to send the notification through event targets such as Amazon SNS or
// Lambda function. This operation is only supported for S3 File Gateways. For more
// information, see Getting file upload notification (https://docs.aws.amazon.com/storagegateway/latest/userguide/monitoring-file-gateway.html#get-upload-notification)
// in the Storage Gateway User Guide.
func (c *Client) NotifyWhenUploaded(ctx context.Context, params *NotifyWhenUploadedInput, optFns ...func(*Options)) (*NotifyWhenUploadedOutput, error) {
if params == nil {
params = &NotifyWhenUploadedInput{}
}
result, metadata, err := c.invokeOperation(ctx, "NotifyWhenUploaded", params, optFns, c.addOperationNotifyWhenUploadedMiddlewares)
if err != nil {
return nil, err
}
out := result.(*NotifyWhenUploadedOutput)
out.ResultMetadata = metadata
return out, nil
}
type NotifyWhenUploadedInput struct {
// The Amazon Resource Name (ARN) of the file share.
//
// This member is required.
FileShareARN *string
noSmithyDocumentSerde
}
type NotifyWhenUploadedOutput struct {
// The Amazon Resource Name (ARN) of the file share.
FileShareARN *string
// The randomly generated ID of the notification that was sent. This ID is in UUID
// format.
NotificationId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationNotifyWhenUploadedMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpNotifyWhenUploaded{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpNotifyWhenUploaded{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpNotifyWhenUploadedValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opNotifyWhenUploaded(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opNotifyWhenUploaded(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "NotifyWhenUploaded",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Refreshes the cached inventory of objects for the specified file share. This
// operation finds objects in the Amazon S3 bucket that were added, removed, or
// replaced since the gateway last listed the bucket's contents and cached the
// results. This operation does not import files into the S3 File Gateway cache
// storage. It only updates the cached inventory to reflect changes in the
// inventory of the objects in the S3 bucket. This operation is only supported in
// the S3 File Gateway types. You can subscribe to be notified through an Amazon
// CloudWatch event when your RefreshCache operation completes. For more
// information, see Getting notified about file operations (https://docs.aws.amazon.com/storagegateway/latest/userguide/monitoring-file-gateway.html#get-notification)
// in the Storage Gateway User Guide. This operation is Only supported for S3 File
// Gateways. When this API is called, it only initiates the refresh operation. When
// the API call completes and returns a success code, it doesn't necessarily mean
// that the file refresh has completed. You should use the refresh-complete
// notification to determine that the operation has completed before you check for
// new files on the gateway file share. You can subscribe to be notified through a
// CloudWatch event when your RefreshCache operation completes. Throttle limit:
// This API is asynchronous, so the gateway will accept no more than two refreshes
// at any time. We recommend using the refresh-complete CloudWatch event
// notification before issuing additional requests. For more information, see
// Getting notified about file operations (https://docs.aws.amazon.com/storagegateway/latest/userguide/monitoring-file-gateway.html#get-notification)
// in the Storage Gateway User Guide.
// - Wait at least 60 seconds between consecutive RefreshCache API requests.
// - RefreshCache does not evict cache entries if invoked consecutively within
// 60 seconds of a previous RefreshCache request.
// - If you invoke the RefreshCache API when two requests are already being
// processed, any new request will cause an InvalidGatewayRequestException error
// because too many requests were sent to the server.
//
// The S3 bucket name does not need to be included when entering the list of
// folders in the FolderList parameter. For more information, see Getting notified
// about file operations (https://docs.aws.amazon.com/storagegateway/latest/userguide/monitoring-file-gateway.html#get-notification)
// in the Storage Gateway User Guide.
func (c *Client) RefreshCache(ctx context.Context, params *RefreshCacheInput, optFns ...func(*Options)) (*RefreshCacheOutput, error) {
if params == nil {
params = &RefreshCacheInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RefreshCache", params, optFns, c.addOperationRefreshCacheMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RefreshCacheOutput)
out.ResultMetadata = metadata
return out, nil
}
// RefreshCacheInput
type RefreshCacheInput struct {
// The Amazon Resource Name (ARN) of the file share you want to refresh.
//
// This member is required.
FileShareARN *string
// A comma-separated list of the paths of folders to refresh in the cache. The
// default is [ "/" ]. The default refreshes objects and folders at the root of the
// Amazon S3 bucket. If Recursive is set to true , the entire S3 bucket that the
// file share has access to is refreshed.
FolderList []string
// A value that specifies whether to recursively refresh folders in the cache. The
// refresh includes folders that were in the cache the last time the gateway listed
// the folder's contents. If this value set to true , each folder that is listed in
// FolderList is recursively updated. Otherwise, subfolders listed in FolderList
// are not refreshed. Only objects that are in folders listed directly under
// FolderList are found and used for the update. The default is true . Valid
// Values: true | false
Recursive *bool
noSmithyDocumentSerde
}
// RefreshCacheOutput
type RefreshCacheOutput struct {
// The Amazon Resource Name (ARN) of the file share.
FileShareARN *string
// The randomly generated ID of the notification that was sent. This ID is in UUID
// format.
NotificationId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRefreshCacheMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRefreshCache{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRefreshCache{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRefreshCacheValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRefreshCache(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opRefreshCache(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "RefreshCache",
}
}
| 176 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes one or more tags from the specified resource. This operation is
// supported in storage gateways of all types.
func (c *Client) RemoveTagsFromResource(ctx context.Context, params *RemoveTagsFromResourceInput, optFns ...func(*Options)) (*RemoveTagsFromResourceOutput, error) {
if params == nil {
params = &RemoveTagsFromResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemoveTagsFromResource", params, optFns, c.addOperationRemoveTagsFromResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemoveTagsFromResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
// RemoveTagsFromResourceInput
type RemoveTagsFromResourceInput struct {
// The Amazon Resource Name (ARN) of the resource you want to remove the tags from.
//
// This member is required.
ResourceARN *string
// The keys of the tags you want to remove from the specified resource. A tag is
// composed of a key-value pair.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
// RemoveTagsFromResourceOutput
type RemoveTagsFromResourceOutput struct {
// The Amazon Resource Name (ARN) of the resource that the tags were removed from.
ResourceARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemoveTagsFromResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveTagsFromResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveTagsFromResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRemoveTagsFromResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveTagsFromResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opRemoveTagsFromResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "RemoveTagsFromResource",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Resets all cache disks that have encountered an error and makes the disks
// available for reconfiguration as cache storage. If your cache disk encounters an
// error, the gateway prevents read and write operations on virtual tapes in the
// gateway. For example, an error can occur when a disk is corrupted or removed
// from the gateway. When a cache is reset, the gateway loses its cache storage. At
// this point, you can reconfigure the disks as cache disks. This operation is only
// supported in the cached volume and tape types. If the cache disk you are
// resetting contains data that has not been uploaded to Amazon S3 yet, that data
// can be lost. After you reset cache disks, there will be no configured cache
// disks left in the gateway, so you must configure at least one new cache disk for
// your gateway to function properly.
func (c *Client) ResetCache(ctx context.Context, params *ResetCacheInput, optFns ...func(*Options)) (*ResetCacheOutput, error) {
if params == nil {
params = &ResetCacheInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ResetCache", params, optFns, c.addOperationResetCacheMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ResetCacheOutput)
out.ResultMetadata = metadata
return out, nil
}
type ResetCacheInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type ResetCacheOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationResetCacheMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpResetCache{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpResetCache{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpResetCacheValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetCache(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opResetCache(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ResetCache",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves an archived virtual tape from the virtual tape shelf (VTS) to a tape
// gateway. Virtual tapes archived in the VTS are not associated with any gateway.
// However after a tape is retrieved, it is associated with a gateway, even though
// it is also listed in the VTS, that is, archive. This operation is only supported
// in the tape gateway type. Once a tape is successfully retrieved to a gateway, it
// cannot be retrieved again to another gateway. You must archive the tape again
// before you can retrieve it to another gateway. This operation is only supported
// in the tape gateway type.
func (c *Client) RetrieveTapeArchive(ctx context.Context, params *RetrieveTapeArchiveInput, optFns ...func(*Options)) (*RetrieveTapeArchiveOutput, error) {
if params == nil {
params = &RetrieveTapeArchiveInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RetrieveTapeArchive", params, optFns, c.addOperationRetrieveTapeArchiveMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RetrieveTapeArchiveOutput)
out.ResultMetadata = metadata
return out, nil
}
// RetrieveTapeArchiveInput
type RetrieveTapeArchiveInput struct {
// The Amazon Resource Name (ARN) of the gateway you want to retrieve the virtual
// tape to. Use the ListGateways operation to return a list of gateways for your
// account and Amazon Web Services Region. You retrieve archived virtual tapes to
// only one gateway and the gateway must be a tape gateway.
//
// This member is required.
GatewayARN *string
// The Amazon Resource Name (ARN) of the virtual tape you want to retrieve from
// the virtual tape shelf (VTS).
//
// This member is required.
TapeARN *string
noSmithyDocumentSerde
}
// RetrieveTapeArchiveOutput
type RetrieveTapeArchiveOutput struct {
// The Amazon Resource Name (ARN) of the retrieved virtual tape.
TapeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRetrieveTapeArchiveMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRetrieveTapeArchive{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRetrieveTapeArchive{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRetrieveTapeArchiveValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRetrieveTapeArchive(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opRetrieveTapeArchive(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "RetrieveTapeArchive",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the recovery point for the specified virtual tape. This operation is
// only supported in the tape gateway type. A recovery point is a point in time
// view of a virtual tape at which all the data on the tape is consistent. If your
// gateway crashes, virtual tapes that have recovery points can be recovered to a
// new gateway. The virtual tape can be retrieved to only one gateway. The
// retrieved tape is read-only. The virtual tape can be retrieved to only a tape
// gateway. There is no charge for retrieving recovery points.
func (c *Client) RetrieveTapeRecoveryPoint(ctx context.Context, params *RetrieveTapeRecoveryPointInput, optFns ...func(*Options)) (*RetrieveTapeRecoveryPointOutput, error) {
if params == nil {
params = &RetrieveTapeRecoveryPointInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RetrieveTapeRecoveryPoint", params, optFns, c.addOperationRetrieveTapeRecoveryPointMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RetrieveTapeRecoveryPointOutput)
out.ResultMetadata = metadata
return out, nil
}
// RetrieveTapeRecoveryPointInput
type RetrieveTapeRecoveryPointInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The Amazon Resource Name (ARN) of the virtual tape for which you want to
// retrieve the recovery point.
//
// This member is required.
TapeARN *string
noSmithyDocumentSerde
}
// RetrieveTapeRecoveryPointOutput
type RetrieveTapeRecoveryPointOutput struct {
// The Amazon Resource Name (ARN) of the virtual tape for which the recovery point
// was retrieved.
TapeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRetrieveTapeRecoveryPointMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRetrieveTapeRecoveryPoint{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRetrieveTapeRecoveryPoint{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRetrieveTapeRecoveryPointValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRetrieveTapeRecoveryPoint(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opRetrieveTapeRecoveryPoint(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "RetrieveTapeRecoveryPoint",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sets the password for your VM local console. When you log in to the local
// console for the first time, you log in to the VM with the default credentials.
// We recommend that you set a new password. You don't need to know the default
// password to set a new password.
func (c *Client) SetLocalConsolePassword(ctx context.Context, params *SetLocalConsolePasswordInput, optFns ...func(*Options)) (*SetLocalConsolePasswordOutput, error) {
if params == nil {
params = &SetLocalConsolePasswordInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SetLocalConsolePassword", params, optFns, c.addOperationSetLocalConsolePasswordMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SetLocalConsolePasswordOutput)
out.ResultMetadata = metadata
return out, nil
}
// SetLocalConsolePasswordInput
type SetLocalConsolePasswordInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The password you want to set for your VM local console.
//
// This member is required.
LocalConsolePassword *string
noSmithyDocumentSerde
}
type SetLocalConsolePasswordOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSetLocalConsolePasswordMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSetLocalConsolePassword{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSetLocalConsolePassword{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSetLocalConsolePasswordValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetLocalConsolePassword(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opSetLocalConsolePassword(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "SetLocalConsolePassword",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sets the password for the guest user smbguest . The smbguest user is the user
// when the authentication method for the file share is set to GuestAccess . This
// operation only supported for S3 File Gateways
func (c *Client) SetSMBGuestPassword(ctx context.Context, params *SetSMBGuestPasswordInput, optFns ...func(*Options)) (*SetSMBGuestPasswordOutput, error) {
if params == nil {
params = &SetSMBGuestPasswordInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SetSMBGuestPassword", params, optFns, c.addOperationSetSMBGuestPasswordMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SetSMBGuestPasswordOutput)
out.ResultMetadata = metadata
return out, nil
}
// SetSMBGuestPasswordInput
type SetSMBGuestPasswordInput struct {
// The Amazon Resource Name (ARN) of the S3 File Gateway the SMB file share is
// associated with.
//
// This member is required.
GatewayARN *string
// The password that you want to set for your SMB server.
//
// This member is required.
Password *string
noSmithyDocumentSerde
}
type SetSMBGuestPasswordOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSetSMBGuestPasswordMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSetSMBGuestPassword{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSetSMBGuestPassword{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSetSMBGuestPasswordValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetSMBGuestPassword(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opSetSMBGuestPassword(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "SetSMBGuestPassword",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Shuts down a gateway. To specify which gateway to shut down, use the Amazon
// Resource Name (ARN) of the gateway in the body of your request. The operation
// shuts down the gateway service component running in the gateway's virtual
// machine (VM) and not the host VM. If you want to shut down the VM, it is
// recommended that you first shut down the gateway component in the VM to avoid
// unpredictable conditions. After the gateway is shutdown, you cannot call any
// other API except StartGateway , DescribeGatewayInformation , and ListGateways .
// For more information, see ActivateGateway . Your applications cannot read from
// or write to the gateway's storage volumes, and there are no snapshots taken.
// When you make a shutdown request, you will get a 200 OK success response
// immediately. However, it might take some time for the gateway to shut down. You
// can call the DescribeGatewayInformation API to check the status. For more
// information, see ActivateGateway . If do not intend to use the gateway again,
// you must delete the gateway (using DeleteGateway ) to no longer pay software
// charges associated with the gateway.
func (c *Client) ShutdownGateway(ctx context.Context, params *ShutdownGatewayInput, optFns ...func(*Options)) (*ShutdownGatewayOutput, error) {
if params == nil {
params = &ShutdownGatewayInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ShutdownGateway", params, optFns, c.addOperationShutdownGatewayMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ShutdownGatewayOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway to shut
// down.
type ShutdownGatewayInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway that was
// shut down.
type ShutdownGatewayOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationShutdownGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpShutdownGateway{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpShutdownGateway{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpShutdownGatewayValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opShutdownGateway(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opShutdownGateway(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "ShutdownGateway",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Start a test that verifies that the specified gateway is configured for High
// Availability monitoring in your host environment. This request only initiates
// the test and that a successful response only indicates that the test was
// started. It doesn't indicate that the test passed. For the status of the test,
// invoke the DescribeAvailabilityMonitorTest API. Starting this test will cause
// your gateway to go offline for a brief period.
func (c *Client) StartAvailabilityMonitorTest(ctx context.Context, params *StartAvailabilityMonitorTestInput, optFns ...func(*Options)) (*StartAvailabilityMonitorTestOutput, error) {
if params == nil {
params = &StartAvailabilityMonitorTestInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartAvailabilityMonitorTest", params, optFns, c.addOperationStartAvailabilityMonitorTestMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartAvailabilityMonitorTestOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartAvailabilityMonitorTestInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type StartAvailabilityMonitorTestOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartAvailabilityMonitorTestMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartAvailabilityMonitorTest{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartAvailabilityMonitorTest{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartAvailabilityMonitorTestValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartAvailabilityMonitorTest(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartAvailabilityMonitorTest(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "StartAvailabilityMonitorTest",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts a gateway that you previously shut down (see ShutdownGateway ). After the
// gateway starts, you can then make other API calls, your applications can read
// from or write to the gateway's storage volumes and you will be able to take
// snapshot backups. When you make a request, you will get a 200 OK success
// response immediately. However, it might take some time for the gateway to be
// ready. You should call DescribeGatewayInformation and check the status before
// making any additional API calls. For more information, see ActivateGateway . To
// specify which gateway to start, use the Amazon Resource Name (ARN) of the
// gateway in your request.
func (c *Client) StartGateway(ctx context.Context, params *StartGatewayInput, optFns ...func(*Options)) (*StartGatewayOutput, error) {
if params == nil {
params = &StartGatewayInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartGateway", params, optFns, c.addOperationStartGatewayMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartGatewayOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway to start.
type StartGatewayInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway that was
// restarted.
type StartGatewayOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartGateway{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartGateway{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartGatewayValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartGateway(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opStartGateway(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "StartGateway",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the automatic tape creation policy of a gateway. Use this to update the
// policy with a new set of automatic tape creation rules. This is only supported
// for tape gateways. By default, there is no automatic tape creation policy. A
// gateway can have only one automatic tape creation policy.
func (c *Client) UpdateAutomaticTapeCreationPolicy(ctx context.Context, params *UpdateAutomaticTapeCreationPolicyInput, optFns ...func(*Options)) (*UpdateAutomaticTapeCreationPolicyOutput, error) {
if params == nil {
params = &UpdateAutomaticTapeCreationPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateAutomaticTapeCreationPolicy", params, optFns, c.addOperationUpdateAutomaticTapeCreationPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAutomaticTapeCreationPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAutomaticTapeCreationPolicyInput struct {
// An automatic tape creation policy consists of a list of automatic tape creation
// rules. The rules determine when and how to automatically create new tapes.
//
// This member is required.
AutomaticTapeCreationRules []types.AutomaticTapeCreationRule
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type UpdateAutomaticTapeCreationPolicyOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAutomaticTapeCreationPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAutomaticTapeCreationPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateAutomaticTapeCreationPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateAutomaticTapeCreationPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAutomaticTapeCreationPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateAutomaticTapeCreationPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateAutomaticTapeCreationPolicy",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the bandwidth rate limits of a gateway. You can update both the upload
// and download bandwidth rate limit or specify only one of the two. If you don't
// set a bandwidth rate limit, the existing rate limit remains. This operation is
// supported only for the stored volume, cached volume, and tape gateway types. To
// update bandwidth rate limits for S3 file gateways, use
// UpdateBandwidthRateLimitSchedule . By default, a gateway's bandwidth rate limits
// are not set. If you don't set any limit, the gateway does not have any
// limitations on its bandwidth usage and could potentially use the maximum
// available bandwidth. To specify which gateway to update, use the Amazon Resource
// Name (ARN) of the gateway in your request.
func (c *Client) UpdateBandwidthRateLimit(ctx context.Context, params *UpdateBandwidthRateLimitInput, optFns ...func(*Options)) (*UpdateBandwidthRateLimitOutput, error) {
if params == nil {
params = &UpdateBandwidthRateLimitInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateBandwidthRateLimit", params, optFns, c.addOperationUpdateBandwidthRateLimitMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateBandwidthRateLimitOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing one or more of the following fields:
// - UpdateBandwidthRateLimitInput$AverageDownloadRateLimitInBitsPerSec
// - UpdateBandwidthRateLimitInput$AverageUploadRateLimitInBitsPerSec
type UpdateBandwidthRateLimitInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The average download bandwidth rate limit in bits per second.
AverageDownloadRateLimitInBitsPerSec *int64
// The average upload bandwidth rate limit in bits per second.
AverageUploadRateLimitInBitsPerSec *int64
noSmithyDocumentSerde
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway whose
// throttle information was updated.
type UpdateBandwidthRateLimitOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateBandwidthRateLimitMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateBandwidthRateLimit{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateBandwidthRateLimit{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateBandwidthRateLimitValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBandwidthRateLimit(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateBandwidthRateLimit(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateBandwidthRateLimit",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the bandwidth rate limit schedule for a specified gateway. By default,
// gateways do not have bandwidth rate limit schedules, which means no bandwidth
// rate limiting is in effect. Use this to initiate or update a gateway's bandwidth
// rate limit schedule. This operation is supported only for volume, tape and S3
// file gateways. FSx file gateways do not support bandwidth rate limits.
func (c *Client) UpdateBandwidthRateLimitSchedule(ctx context.Context, params *UpdateBandwidthRateLimitScheduleInput, optFns ...func(*Options)) (*UpdateBandwidthRateLimitScheduleOutput, error) {
if params == nil {
params = &UpdateBandwidthRateLimitScheduleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateBandwidthRateLimitSchedule", params, optFns, c.addOperationUpdateBandwidthRateLimitScheduleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateBandwidthRateLimitScheduleOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateBandwidthRateLimitScheduleInput struct {
// An array containing bandwidth rate limit schedule intervals for a gateway. When
// no bandwidth rate limit intervals have been scheduled, the array is empty.
//
// This member is required.
BandwidthRateLimitIntervals []types.BandwidthRateLimitInterval
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type UpdateBandwidthRateLimitScheduleOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateBandwidthRateLimitScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateBandwidthRateLimitSchedule{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateBandwidthRateLimitSchedule{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateBandwidthRateLimitScheduleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBandwidthRateLimitSchedule(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateBandwidthRateLimitSchedule(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateBandwidthRateLimitSchedule",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the Challenge-Handshake Authentication Protocol (CHAP) credentials for
// a specified iSCSI target. By default, a gateway does not have CHAP enabled;
// however, for added security, you might use it. This operation is supported in
// the volume and tape gateway types. When you update CHAP credentials, all
// existing connections on the target are closed and initiators must reconnect with
// the new credentials.
func (c *Client) UpdateChapCredentials(ctx context.Context, params *UpdateChapCredentialsInput, optFns ...func(*Options)) (*UpdateChapCredentialsOutput, error) {
if params == nil {
params = &UpdateChapCredentialsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateChapCredentials", params, optFns, c.addOperationUpdateChapCredentialsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateChapCredentialsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing one or more of the following fields:
// - UpdateChapCredentialsInput$InitiatorName
// - UpdateChapCredentialsInput$SecretToAuthenticateInitiator
// - UpdateChapCredentialsInput$SecretToAuthenticateTarget
// - UpdateChapCredentialsInput$TargetARN
type UpdateChapCredentialsInput struct {
// The iSCSI initiator that connects to the target.
//
// This member is required.
InitiatorName *string
// The secret key that the initiator (for example, the Windows client) must
// provide to participate in mutual CHAP with the target. The secret key must be
// between 12 and 16 bytes when encoded in UTF-8.
//
// This member is required.
SecretToAuthenticateInitiator *string
// The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
// DescribeStorediSCSIVolumes operation to return the TargetARN for specified
// VolumeARN.
//
// This member is required.
TargetARN *string
// The secret key that the target must provide to participate in mutual CHAP with
// the initiator (e.g. Windows client). Byte constraints: Minimum bytes of 12.
// Maximum bytes of 16. The secret key must be between 12 and 16 bytes when encoded
// in UTF-8.
SecretToAuthenticateTarget *string
noSmithyDocumentSerde
}
// A JSON object containing the following fields:
type UpdateChapCredentialsOutput struct {
// The iSCSI initiator that connects to the target. This is the same initiator
// name specified in the request.
InitiatorName *string
// The Amazon Resource Name (ARN) of the target. This is the same target specified
// in the request.
TargetARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateChapCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateChapCredentials{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateChapCredentials{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateChapCredentialsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateChapCredentials(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateChapCredentials(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateChapCredentials",
}
}
| 160 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a file system association. This operation is only supported in the FSx
// File Gateways.
func (c *Client) UpdateFileSystemAssociation(ctx context.Context, params *UpdateFileSystemAssociationInput, optFns ...func(*Options)) (*UpdateFileSystemAssociationOutput, error) {
if params == nil {
params = &UpdateFileSystemAssociationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateFileSystemAssociation", params, optFns, c.addOperationUpdateFileSystemAssociationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateFileSystemAssociationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateFileSystemAssociationInput struct {
// The Amazon Resource Name (ARN) of the file system association that you want to
// update.
//
// This member is required.
FileSystemAssociationARN *string
// The Amazon Resource Name (ARN) of the storage used for the audit logs.
AuditDestinationARN *string
// The refresh cache information for the file share or FSx file systems.
CacheAttributes *types.CacheAttributes
// The password of the user credential.
Password *string
// The user name of the user credential that has permission to access the root
// share D$ of the Amazon FSx file system. The user account must belong to the
// Amazon FSx delegated admin user group.
UserName *string
noSmithyDocumentSerde
}
type UpdateFileSystemAssociationOutput struct {
// The ARN of the updated file system association.
FileSystemAssociationARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateFileSystemAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateFileSystemAssociation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateFileSystemAssociation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateFileSystemAssociationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFileSystemAssociation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateFileSystemAssociation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateFileSystemAssociation",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a gateway's metadata, which includes the gateway's name and time zone.
// To specify which gateway to update, use the Amazon Resource Name (ARN) of the
// gateway in your request. For gateways activated after September 2, 2015, the
// gateway's ARN contains the gateway ID rather than the gateway name. However,
// changing the name of the gateway has no effect on the gateway's ARN.
func (c *Client) UpdateGatewayInformation(ctx context.Context, params *UpdateGatewayInformationInput, optFns ...func(*Options)) (*UpdateGatewayInformationOutput, error) {
if params == nil {
params = &UpdateGatewayInformationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateGatewayInformation", params, optFns, c.addOperationUpdateGatewayInformationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateGatewayInformationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateGatewayInformationInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that you want
// to use to monitor and log events in the gateway. For more information, see What
// is Amazon CloudWatch Logs? (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html)
CloudWatchLogGroupARN *string
// Specifies the size of the gateway's metadata cache.
GatewayCapacity types.GatewayCapacity
// The name you configured for your gateway.
GatewayName *string
// A value that indicates the time zone of the gateway.
GatewayTimezone *string
noSmithyDocumentSerde
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway that was
// updated.
type UpdateGatewayInformationOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// The name you configured for your gateway.
GatewayName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateGatewayInformationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateGatewayInformation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateGatewayInformation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateGatewayInformationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateGatewayInformation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateGatewayInformation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateGatewayInformation",
}
}
| 150 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the gateway virtual machine (VM) software. The request immediately
// triggers the software update. When you make this request, you get a 200 OK
// success response immediately. However, it might take some time for the update to
// complete. You can call DescribeGatewayInformation to verify the gateway is in
// the STATE_RUNNING state. A software update forces a system restart of your
// gateway. You can minimize the chance of any disruption to your applications by
// increasing your iSCSI Initiators' timeouts. For more information about
// increasing iSCSI Initiator timeouts for Windows and Linux, see Customizing your
// Windows iSCSI settings (https://docs.aws.amazon.com/storagegateway/latest/userguide/ConfiguringiSCSIClientInitiatorWindowsClient.html#CustomizeWindowsiSCSISettings)
// and Customizing your Linux iSCSI settings (https://docs.aws.amazon.com/storagegateway/latest/userguide/ConfiguringiSCSIClientInitiatorRedHatClient.html#CustomizeLinuxiSCSISettings)
// , respectively.
func (c *Client) UpdateGatewaySoftwareNow(ctx context.Context, params *UpdateGatewaySoftwareNowInput, optFns ...func(*Options)) (*UpdateGatewaySoftwareNowOutput, error) {
if params == nil {
params = &UpdateGatewaySoftwareNowInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateGatewaySoftwareNow", params, optFns, c.addOperationUpdateGatewaySoftwareNowMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateGatewaySoftwareNowOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway to
// update.
type UpdateGatewaySoftwareNowInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway that was
// updated.
type UpdateGatewaySoftwareNowOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateGatewaySoftwareNowMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateGatewaySoftwareNow{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateGatewaySoftwareNow{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateGatewaySoftwareNowValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateGatewaySoftwareNow(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateGatewaySoftwareNow(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateGatewaySoftwareNow",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a gateway's weekly maintenance start time information, including day
// and time of the week. The maintenance time is the time in your gateway's time
// zone.
func (c *Client) UpdateMaintenanceStartTime(ctx context.Context, params *UpdateMaintenanceStartTimeInput, optFns ...func(*Options)) (*UpdateMaintenanceStartTimeOutput, error) {
if params == nil {
params = &UpdateMaintenanceStartTimeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateMaintenanceStartTime", params, optFns, c.addOperationUpdateMaintenanceStartTimeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateMaintenanceStartTimeOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing the following fields:
// - UpdateMaintenanceStartTimeInput$DayOfMonth
// - UpdateMaintenanceStartTimeInput$DayOfWeek
// - UpdateMaintenanceStartTimeInput$HourOfDay
// - UpdateMaintenanceStartTimeInput$MinuteOfHour
type UpdateMaintenanceStartTimeInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// The hour component of the maintenance start time represented as hh, where hh is
// the hour (00 to 23). The hour of the day is in the time zone of the gateway.
//
// This member is required.
HourOfDay *int32
// The minute component of the maintenance start time represented as mm, where mm
// is the minute (00 to 59). The minute of the hour is in the time zone of the
// gateway.
//
// This member is required.
MinuteOfHour *int32
// The day of the month component of the maintenance start time represented as an
// ordinal number from 1 to 28, where 1 represents the first day of the month and
// 28 represents the last day of the month.
DayOfMonth *int32
// The day of the week component of the maintenance start time week represented as
// an ordinal number from 0 to 6, where 0 represents Sunday and 6 Saturday.
DayOfWeek *int32
noSmithyDocumentSerde
}
// A JSON object containing the Amazon Resource Name (ARN) of the gateway whose
// maintenance start time is updated.
type UpdateMaintenanceStartTimeOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateMaintenanceStartTimeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateMaintenanceStartTime{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateMaintenanceStartTime{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateMaintenanceStartTimeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMaintenanceStartTime(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateMaintenanceStartTime(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateMaintenanceStartTime",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a Network File System (NFS) file share. This operation is only
// supported in S3 File Gateways. To leave a file share field unchanged, set the
// corresponding input field to null. Updates the following file share settings:
// - Default storage class for your S3 bucket
// - Metadata defaults for your S3 bucket
// - Allowed NFS clients for your file share
// - Squash settings
// - Write status of your file share
func (c *Client) UpdateNFSFileShare(ctx context.Context, params *UpdateNFSFileShareInput, optFns ...func(*Options)) (*UpdateNFSFileShareOutput, error) {
if params == nil {
params = &UpdateNFSFileShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateNFSFileShare", params, optFns, c.addOperationUpdateNFSFileShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateNFSFileShareOutput)
out.ResultMetadata = metadata
return out, nil
}
// UpdateNFSFileShareInput
type UpdateNFSFileShareInput struct {
// The Amazon Resource Name (ARN) of the file share to be updated.
//
// This member is required.
FileShareARN *string
// The Amazon Resource Name (ARN) of the storage used for audit logs.
AuditDestinationARN *string
// Specifies refresh cache information for the file share.
CacheAttributes *types.CacheAttributes
// The list of clients that are allowed to access the S3 File Gateway. The list
// must contain either valid IP addresses or valid CIDR blocks.
ClientList []string
// The default storage class for objects put into an Amazon S3 bucket by the S3
// File Gateway. The default value is S3_STANDARD . Optional. Valid Values:
// S3_STANDARD | S3_INTELLIGENT_TIERING | S3_STANDARD_IA | S3_ONEZONE_IA
DefaultStorageClass *string
// The name of the file share. Optional. FileShareName must be set if an S3 prefix
// name is set in LocationARN , or if an access point or access point alias is used.
FileShareName *string
// A value that enables guessing of the MIME type for uploaded objects based on
// file extensions. Set this value to true to enable MIME type guessing, otherwise
// set to false . The default value is true . Valid Values: true | false
GuessMIMETypeEnabled *bool
// Set to true to use Amazon S3 server-side encryption with your own KMS key, or
// false to use a key managed by Amazon S3. Optional. Valid Values: true | false
KMSEncrypted *bool
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// The default values for the file share. Optional.
NFSFileShareDefaults *types.NFSFileShareDefaults
// The notification policy of the file share. SettlingTimeInSeconds controls the
// number of seconds to wait after the last point in time a client wrote to a file
// before generating an ObjectUploaded notification. Because clients can make many
// small writes to files, it's best to set this parameter for as long as possible
// to avoid generating multiple notifications for the same file in a small time
// period. SettlingTimeInSeconds has no effect on the timing of the object
// uploading to Amazon S3, only the timing of the notification. The following
// example sets NotificationPolicy on with SettlingTimeInSeconds set to 60.
// {"Upload": {"SettlingTimeInSeconds": 60}} The following example sets
// NotificationPolicy off. {}
NotificationPolicy *string
// A value that sets the access control list (ACL) permission for objects in the
// S3 bucket that a S3 File Gateway puts objects into. The default value is private
// .
ObjectACL types.ObjectACL
// A value that sets the write status of a file share. Set this value to true to
// set the write status to read-only, otherwise set to false . Valid Values: true
// | false
ReadOnly *bool
// A value that sets who pays the cost of the request and the cost associated with
// data download from the S3 bucket. If this value is set to true , the requester
// pays the costs; otherwise, the S3 bucket owner pays. However, the S3 bucket
// owner always pays the cost of storing data. RequesterPays is a configuration
// for the S3 bucket that backs the file share, so make sure that the configuration
// on the file share is the same as the S3 bucket configuration. Valid Values: true
// | false
RequesterPays *bool
// The user mapped to anonymous user. Valid values are the following:
// - RootSquash : Only root is mapped to anonymous user.
// - NoSquash : No one is mapped to anonymous user.
// - AllSquash : Everyone is mapped to anonymous user.
Squash *string
noSmithyDocumentSerde
}
// UpdateNFSFileShareOutput
type UpdateNFSFileShareOutput struct {
// The Amazon Resource Name (ARN) of the updated file share.
FileShareARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateNFSFileShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateNFSFileShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateNFSFileShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateNFSFileShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateNFSFileShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateNFSFileShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateNFSFileShare",
}
}
| 207 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a Server Message Block (SMB) file share. This operation is only
// supported for S3 File Gateways. To leave a file share field unchanged, set the
// corresponding input field to null. File gateways require Security Token Service
// (Amazon Web Services STS) to be activated to enable you to create a file share.
// Make sure that Amazon Web Services STS is activated in the Amazon Web Services
// Region you are creating your file gateway in. If Amazon Web Services STS is not
// activated in this Amazon Web Services Region, activate it. For information about
// how to activate Amazon Web Services STS, see Activating and deactivating Amazon
// Web Services STS in an Amazon Web Services Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the Identity and Access Management User Guide. File gateways don't support
// creating hard or symbolic links on a file share.
func (c *Client) UpdateSMBFileShare(ctx context.Context, params *UpdateSMBFileShareInput, optFns ...func(*Options)) (*UpdateSMBFileShareOutput, error) {
if params == nil {
params = &UpdateSMBFileShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSMBFileShare", params, optFns, c.addOperationUpdateSMBFileShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSMBFileShareOutput)
out.ResultMetadata = metadata
return out, nil
}
// UpdateSMBFileShareInput
type UpdateSMBFileShareInput struct {
// The Amazon Resource Name (ARN) of the SMB file share that you want to update.
//
// This member is required.
FileShareARN *string
// The files and folders on this share will only be visible to users with read
// access.
AccessBasedEnumeration *bool
// A list of users or groups in the Active Directory that have administrator
// rights to the file share. A group must be prefixed with the @ character.
// Acceptable formats include: DOMAIN\User1 , user1 , @group1 , and @DOMAIN\group1
// . Can only be set if Authentication is set to ActiveDirectory .
AdminUserList []string
// The Amazon Resource Name (ARN) of the storage used for audit logs.
AuditDestinationARN *string
// Specifies refresh cache information for the file share.
CacheAttributes *types.CacheAttributes
// The case of an object name in an Amazon S3 bucket. For ClientSpecified , the
// client determines the case sensitivity. For CaseSensitive , the gateway
// determines the case sensitivity. The default value is ClientSpecified .
CaseSensitivity types.CaseSensitivity
// The default storage class for objects put into an Amazon S3 bucket by the S3
// File Gateway. The default value is S3_STANDARD . Optional. Valid Values:
// S3_STANDARD | S3_INTELLIGENT_TIERING | S3_STANDARD_IA | S3_ONEZONE_IA
DefaultStorageClass *string
// The name of the file share. Optional. FileShareName must be set if an S3 prefix
// name is set in LocationARN , or if an access point or access point alias is used.
FileShareName *string
// A value that enables guessing of the MIME type for uploaded objects based on
// file extensions. Set this value to true to enable MIME type guessing, otherwise
// set to false . The default value is true . Valid Values: true | false
GuessMIMETypeEnabled *bool
// A list of users or groups in the Active Directory that are not allowed to
// access the file share. A group must be prefixed with the @ character. Acceptable
// formats include: DOMAIN\User1 , user1 , @group1 , and @DOMAIN\group1 . Can only
// be set if Authentication is set to ActiveDirectory .
InvalidUserList []string
// Set to true to use Amazon S3 server-side encryption with your own KMS key, or
// false to use a key managed by Amazon S3. Optional. Valid Values: true | false
KMSEncrypted *bool
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// The notification policy of the file share. SettlingTimeInSeconds controls the
// number of seconds to wait after the last point in time a client wrote to a file
// before generating an ObjectUploaded notification. Because clients can make many
// small writes to files, it's best to set this parameter for as long as possible
// to avoid generating multiple notifications for the same file in a small time
// period. SettlingTimeInSeconds has no effect on the timing of the object
// uploading to Amazon S3, only the timing of the notification. The following
// example sets NotificationPolicy on with SettlingTimeInSeconds set to 60.
// {"Upload": {"SettlingTimeInSeconds": 60}} The following example sets
// NotificationPolicy off. {}
NotificationPolicy *string
// A value that sets the access control list (ACL) permission for objects in the
// S3 bucket that a S3 File Gateway puts objects into. The default value is private
// .
ObjectACL types.ObjectACL
// Specifies whether opportunistic locking is enabled for the SMB file share.
// Enabling opportunistic locking on case-sensitive shares is not recommended for
// workloads that involve access to files with the same name in different case.
// Valid Values: true | false
OplocksEnabled *bool
// A value that sets the write status of a file share. Set this value to true to
// set write status to read-only, otherwise set to false . Valid Values: true |
// false
ReadOnly *bool
// A value that sets who pays the cost of the request and the cost associated with
// data download from the S3 bucket. If this value is set to true , the requester
// pays the costs; otherwise, the S3 bucket owner pays. However, the S3 bucket
// owner always pays the cost of storing data. RequesterPays is a configuration
// for the S3 bucket that backs the file share, so make sure that the configuration
// on the file share is the same as the S3 bucket configuration. Valid Values: true
// | false
RequesterPays *bool
// Set this value to true to enable access control list (ACL) on the SMB file
// share. Set it to false to map file and directory permissions to the POSIX
// permissions. For more information, see Using Microsoft Windows ACLs to control
// access to an SMB file share (https://docs.aws.amazon.com/storagegateway/latest/userguide/smb-acl.html)
// in the Storage Gateway User Guide. Valid Values: true | false
SMBACLEnabled *bool
// A list of users or groups in the Active Directory that are allowed to access
// the file share. A group must be prefixed with the @ character. Acceptable
// formats include: DOMAIN\User1 , user1 , @group1 , and @DOMAIN\group1 . Can only
// be set if Authentication is set to ActiveDirectory .
ValidUserList []string
noSmithyDocumentSerde
}
// UpdateSMBFileShareOutput
type UpdateSMBFileShareOutput struct {
// The Amazon Resource Name (ARN) of the updated SMB file share.
FileShareARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSMBFileShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSMBFileShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSMBFileShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSMBFileShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSMBFileShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSMBFileShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateSMBFileShare",
}
}
| 237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Controls whether the shares on an S3 File Gateway are visible in a net view or
// browse list. The operation is only supported for S3 File Gateways.
func (c *Client) UpdateSMBFileShareVisibility(ctx context.Context, params *UpdateSMBFileShareVisibilityInput, optFns ...func(*Options)) (*UpdateSMBFileShareVisibilityOutput, error) {
if params == nil {
params = &UpdateSMBFileShareVisibilityInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSMBFileShareVisibility", params, optFns, c.addOperationUpdateSMBFileShareVisibilityMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSMBFileShareVisibilityOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSMBFileShareVisibilityInput struct {
// The shares on this gateway appear when listing shares.
//
// This member is required.
FileSharesVisible *bool
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
noSmithyDocumentSerde
}
type UpdateSMBFileShareVisibilityOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSMBFileShareVisibilityMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSMBFileShareVisibility{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSMBFileShareVisibility{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSMBFileShareVisibilityValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSMBFileShareVisibility(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSMBFileShareVisibility(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateSMBFileShareVisibility",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the list of Active Directory users and groups that have special
// permissions for SMB file shares on the gateway.
func (c *Client) UpdateSMBLocalGroups(ctx context.Context, params *UpdateSMBLocalGroupsInput, optFns ...func(*Options)) (*UpdateSMBLocalGroupsOutput, error) {
if params == nil {
params = &UpdateSMBLocalGroupsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSMBLocalGroups", params, optFns, c.addOperationUpdateSMBLocalGroupsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSMBLocalGroupsOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSMBLocalGroupsInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// A list of Active Directory users and groups that you want to grant special
// permissions for SMB file shares on the gateway.
//
// This member is required.
SMBLocalGroups *types.SMBLocalGroups
noSmithyDocumentSerde
}
type UpdateSMBLocalGroupsOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSMBLocalGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSMBLocalGroups{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSMBLocalGroups{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSMBLocalGroupsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSMBLocalGroups(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSMBLocalGroups(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateSMBLocalGroups",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the SMB security strategy on a file gateway. This action is only
// supported in file gateways. This API is called Security level in the User Guide.
// A higher security level can affect performance of the gateway.
func (c *Client) UpdateSMBSecurityStrategy(ctx context.Context, params *UpdateSMBSecurityStrategyInput, optFns ...func(*Options)) (*UpdateSMBSecurityStrategyOutput, error) {
if params == nil {
params = &UpdateSMBSecurityStrategyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSMBSecurityStrategy", params, optFns, c.addOperationUpdateSMBSecurityStrategyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSMBSecurityStrategyOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSMBSecurityStrategyInput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
//
// This member is required.
GatewayARN *string
// Specifies the type of security strategy. ClientSpecified: if you use this
// option, requests are established based on what is negotiated by the client. This
// option is recommended when you want to maximize compatibility across different
// clients in your environment. Supported only in S3 File Gateway.
// MandatorySigning: if you use this option, file gateway only allows connections
// from SMBv2 or SMBv3 clients that have signing enabled. This option works with
// SMB clients on Microsoft Windows Vista, Windows Server 2008 or newer.
// MandatoryEncryption: if you use this option, file gateway only allows
// connections from SMBv3 clients that have encryption enabled. This option is
// highly recommended for environments that handle sensitive data. This option
// works with SMB clients on Microsoft Windows 8, Windows Server 2012 or newer.
//
// This member is required.
SMBSecurityStrategy types.SMBSecurityStrategy
noSmithyDocumentSerde
}
type UpdateSMBSecurityStrategyOutput struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSMBSecurityStrategyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSMBSecurityStrategy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSMBSecurityStrategy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSMBSecurityStrategyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSMBSecurityStrategy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSMBSecurityStrategy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateSMBSecurityStrategy",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a snapshot schedule configured for a gateway volume. This operation is
// only supported in the cached volume and stored volume gateway types. The default
// snapshot schedule for volume is once every 24 hours, starting at the creation
// time of the volume. You can use this API to change the snapshot schedule
// configured for the volume. In the request you must identify the gateway volume
// whose snapshot schedule you want to update, and the schedule information,
// including when you want the snapshot to begin on a day and the frequency (in
// hours) of snapshots.
func (c *Client) UpdateSnapshotSchedule(ctx context.Context, params *UpdateSnapshotScheduleInput, optFns ...func(*Options)) (*UpdateSnapshotScheduleOutput, error) {
if params == nil {
params = &UpdateSnapshotScheduleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSnapshotSchedule", params, optFns, c.addOperationUpdateSnapshotScheduleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSnapshotScheduleOutput)
out.ResultMetadata = metadata
return out, nil
}
// A JSON object containing one or more of the following fields:
// - UpdateSnapshotScheduleInput$Description
// - UpdateSnapshotScheduleInput$RecurrenceInHours
// - UpdateSnapshotScheduleInput$StartAt
// - UpdateSnapshotScheduleInput$VolumeARN
type UpdateSnapshotScheduleInput struct {
// Frequency of snapshots. Specify the number of hours between snapshots.
//
// This member is required.
RecurrenceInHours *int32
// The hour of the day at which the snapshot schedule begins represented as hh,
// where hh is the hour (0 to 23). The hour of the day is in the time zone of the
// gateway.
//
// This member is required.
StartAt *int32
// The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
// return a list of gateway volumes.
//
// This member is required.
VolumeARN *string
// Optional description of the snapshot that overwrites the existing description.
Description *string
// A list of up to 50 tags that can be assigned to a snapshot. Each tag is a
// key-value pair. Valid characters for key and value are letters, spaces, and
// numbers representable in UTF-8 format, and the following special characters: + -
// = . _ : / @. The maximum length of a tag's key is 128 characters, and the
// maximum length for a tag's value is 256.
Tags []types.Tag
noSmithyDocumentSerde
}
// A JSON object containing the Amazon Resource Name (ARN) of the updated storage
// volume.
type UpdateSnapshotScheduleOutput struct {
// The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
// return a list of gateway volumes.
VolumeARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSnapshotScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSnapshotSchedule{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSnapshotSchedule{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSnapshotScheduleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSnapshotSchedule(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSnapshotSchedule(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateSnapshotSchedule",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the type of medium changer in a tape gateway. When you activate a tape
// gateway, you select a medium changer type for the tape gateway. This operation
// enables you to select a different type of medium changer after a tape gateway is
// activated. This operation is only supported in the tape gateway type.
func (c *Client) UpdateVTLDeviceType(ctx context.Context, params *UpdateVTLDeviceTypeInput, optFns ...func(*Options)) (*UpdateVTLDeviceTypeOutput, error) {
if params == nil {
params = &UpdateVTLDeviceTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateVTLDeviceType", params, optFns, c.addOperationUpdateVTLDeviceTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateVTLDeviceTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateVTLDeviceTypeInput struct {
// The type of medium changer you want to select. Valid Values: STK-L700 |
// AWS-Gateway-VTL | IBM-03584L32-0402
//
// This member is required.
DeviceType *string
// The Amazon Resource Name (ARN) of the medium changer you want to select.
//
// This member is required.
VTLDeviceARN *string
noSmithyDocumentSerde
}
// UpdateVTLDeviceTypeOutput
type UpdateVTLDeviceTypeOutput struct {
// The Amazon Resource Name (ARN) of the medium changer you have selected.
VTLDeviceARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateVTLDeviceTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateVTLDeviceType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateVTLDeviceType{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateVTLDeviceTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateVTLDeviceType(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateVTLDeviceType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "storagegateway",
OperationName: "UpdateVTLDeviceType",
}
}
| 134 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.