Class: AWS.Service Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/service.js

Overview

This class is abstract.

The service class representing an AWS service.

Direct Known Subclasses

AWS.ACM, AWS.APIGateway, AWS.AppStream, AWS.ApplicationAutoScaling, AWS.AutoScaling, AWS.Batch, AWS.Budgets, AWS.CUR, AWS.CloudDirectory, AWS.CloudFormation, AWS.CloudFront, AWS.CloudFront_20161125, AWS.CloudHSM, AWS.CloudSearch, AWS.CloudSearchDomain, AWS.CloudSearch_20110201, AWS.CloudTrail, AWS.CloudWatch, AWS.CloudWatchEvents, AWS.CloudWatchLogs, AWS.CodeBuild, AWS.CodeCommit, AWS.CodeDeploy, AWS.CodePipeline, AWS.CodeStar, AWS.CognitoIdentity, AWS.CognitoIdentityServiceProvider, AWS.CognitoSync, AWS.ConfigService, AWS.DMS, AWS.DataPipeline, AWS.DeviceFarm, AWS.DirectConnect, AWS.DirectoryService, AWS.Discovery, AWS.DynamoDB, AWS.DynamoDBStreams, AWS.DynamoDB_20111205, AWS.EC2, AWS.ECR, AWS.ECS, AWS.EFS, AWS.ELB, AWS.ELBv2, AWS.EMR, AWS.ES, AWS.ElastiCache, AWS.ElasticBeanstalk, AWS.ElasticTranscoder, AWS.Firehose, AWS.GameLift, AWS.Glacier, AWS.Health, AWS.IAM, AWS.ImportExport, AWS.Inspector, AWS.Iot, AWS.IotData, AWS.KMS, AWS.Kinesis, AWS.KinesisAnalytics, AWS.Lambda, AWS.Lambda_20141111, AWS.LexModelBuildingService, AWS.LexRuntime, AWS.Lightsail, AWS.MTurk, AWS.MachineLearning, AWS.MarketplaceCommerceAnalytics, AWS.MarketplaceMetering, AWS.MobileAnalytics, AWS.OpsWorks, AWS.OpsWorksCM, AWS.Organizations, AWS.Pinpoint, AWS.Polly, AWS.RDS, AWS.RDS_20130110, AWS.RDS_20130212, AWS.RDS_20130909, AWS.Redshift, AWS.Rekognition, AWS.ResourceGroupsTaggingAPI, AWS.Route53, AWS.Route53Domains, AWS.S3, AWS.SES, AWS.SMS, AWS.SNS, AWS.SQS, AWS.SSM, AWS.STS, AWS.SWF, AWS.ServiceCatalog, AWS.Shield, AWS.SimpleDB, AWS.Snowball, AWS.StepFunctions, AWS.StorageGateway, AWS.Support, AWS.WAF, AWS.WAFRegional, AWS.WorkDocs, AWS.WorkSpaces, AWS.XRay

Constructor Summary collapse

Property Summary collapse

Method Summary collapse

Constructor Details

new AWS.Service(config) ⇒ void

Create a new service object with a configuration object

Parameters:

  • config (map)

    a map of configuration options

Property Details

apiVersionsArray<String> (readonly)

Returns the list of API versions supported by this service.

Returns:

  • (Array<String>)

    the list of API versions supported by this service.

Method Details

defineService(serviceIdentifier, versions, features) ⇒ Class<Service>

Defines a new Service class using a service identifier and list of versions including an optional set of features (functions) to apply to the class prototype.

Parameters:

  • serviceIdentifier (String)

    the identifier for the service

  • versions (Array<String>)

    a list of versions that work with this service

  • features (Object)

    an object to attach to the prototype

Returns:

  • (Class<Service>)

    the service class defined by this function.

makeRequest(operation, params, callback) ⇒ void

Calls an operation on a service with the given input parameters.

Parameters:

  • operation (String)

    the name of the operation to call on the service.

  • params (map)

    a map of input options for the operation

Callback (callback):

  • function(err, data) { ... }

    If a callback is supplied, it is called when a response is returned from the service.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

makeUnauthenticatedRequest(operation, params, callback) ⇒ void

Calls an operation on a service with the given input parameters, without any authentication data. This method is useful for "public" API operations.

Parameters:

  • operation (String)

    the name of the operation to call on the service.

  • params (map)

    a map of input options for the operation

Callback (callback):

  • function(err, data) { ... }

    If a callback is supplied, it is called when a response is returned from the service.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

setupRequestListeners() ⇒ void

This property is abstract.

Override this method to setup any custom request listeners for each new request to the service.

waitFor(state, params, callback) ⇒ void

Waits for a given state

Parameters:

  • state (String)

    the state on the service to wait for

  • params (map)

    a map of parameters to pass with each request

Callback (callback):

  • function(err, data) { ... }

    If a callback is supplied, it is called when a response is returned from the service.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Options Hash (params):

  • $waiter (map)

    a map of configuration options for the waiter

  • $waiter.delay (Number)

    The number of seconds to wait between requests

  • $waiter.maxAttempts (Number)

    The maximum number of requests to send while waiting