Class | AWS::SimpleWorkflow::DomainCollection |
In: |
lib/aws/simple_workflow/domain_collection.rb
|
Parent: | Object |
The primary interface for registering, listing and deprecating domains.
## Creating a Domain
To create a domain you need to pass a unique name to create.
domain = simple_workflow.domains.create('my-domain', :none) #=> #<AWS::SimpleWorkflow::Domain name:my-domain>
## Getting a Domain
Domains are indexed by their name.
domain = simple_workflow.domains['my-domain']
## Enumerating Domains
You can call Enumerable methods on a domain collection to iterate the domains controlled by your account.
simple_workflow.domains.each {|domain| ... }
By default only registered domains are enumerated. If you would like to enumerate deprecated (deleted) domains you need to pass the `:deprecated` option.
# returns an array of names for all deprecated domains simple_workflow.domains.deprecated.map(&:name)
See {AWS::Core::Collection} to see other useful methods you can call against a domain collection (e.g. enum, page, each_batch).
@return [DomainCollection] Returns a domain collection that
will only enumerate deprecated (deleted) domains.
Registers a new domain.
# register a domain named 'domain' that has no expiry on workflow # execution history domain = AWS::SimpleWorkflow.new.domains.register('domain', :none)
@param [String] name Name of the domain to register. The name must
be unique.
@param [Integer,:none] retention_period A duration (in days)
for which the record (including the history) of workflow executions in this domain should be kept by the service. After the retention period, the workflow execution will not be available in the results of visibility calls. If you pass the symbol `:none` then there is no expiration for workflow execution history (effectively an infinite retention period).
@param [Hash] options
@option [String] :description (nil) Textual description of the domain.
@return [DomainCollection] Returns a domain collection that
will only enumerate registered domains.
@return [DomainCollection] Returns a domain collection that
enumerates domains in reverse alphabetical order. Default ordering is ascending alphabetical.