You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::AutoScaling::NotificationConfiguration

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb

Defined Under Namespace

Classes: Collection

Actions collapse

Associations collapse

Read-Only Attributes collapse

Instance Method Summary collapse

Constructor Details

#initialize(group_name, type, topic_arn, options = {}) ⇒ NotificationConfiguration #initialize(options = {}) ⇒ NotificationConfiguration

Returns a new instance of NotificationConfiguration

Overloads:

  • #initialize(group_name, type, topic_arn, options = {}) ⇒ NotificationConfiguration

    Parameters:

    • group_name (String)
    • type (String)
    • topic_arn (String)

    Options Hash (options):

  • #initialize(options = {}) ⇒ NotificationConfiguration

    Options Hash (options):

    • :group_name (required, String)
    • :type (required, String)
    • :topic_arn (required, String)
    • :client (Client)


23
24
25
26
27
28
29
30
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb', line 23

def initialize(*args)
  options = Hash === args.last ? args.pop.dup : {}
  @group_name = extract_group_name(args, options)
  @type = extract_type(args, options)
  @topic_arn = extract_topic_arn(args, options)
  @data = options.delete(:data)
  @client = options.delete(:client) || Client.new(options)
end

Instance Method Details

#clientClient

Returns:



54
55
56
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb', line 54

def client
  @client
end

#dataTypes::NotificationConfiguration

Returns the data for this Aws::AutoScaling::NotificationConfiguration.

Returns:

Raises:



69
70
71
72
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb', line 69

def data
  load unless @data
  @data
end

#data_loaded?Boolean

Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.

Returns:

  • (Boolean)

    Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.



77
78
79
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb', line 77

def data_loaded?
  !!@data
end

#delete(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


notification_configuration.delete()

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Returns:

  • (EmptyStructure)


88
89
90
91
92
93
94
95
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb', line 88

def delete(options = {})
  options = options.merge(
    auto_scaling_group_name: @group_name,
    topic_arn: @topic_arn
  )
  resp = @client.delete_notification_configuration(options)
  resp.data
end

#groupAutoScalingGroup

Returns:



115
116
117
118
119
120
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb', line 115

def group
  AutoScalingGroup.new(
    name: @group_name,
    client: @client
  )
end

#group_nameString Also known as: auto_scaling_group_name

Returns:

  • (String)


35
36
37
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb', line 35

def group_name
  @group_name
end

#put(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


notification_configuration.put()

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Returns:

  • (EmptyStructure)


102
103
104
105
106
107
108
109
110
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb', line 102

def put(options = {})
  options = Aws::Util.deep_merge(options,
    auto_scaling_group_name: @name,
    topic_arn: @topic_arn,
    notification_types: [@notification_type]
  )
  resp = @client.put_notification_configuration(options)
  resp.data
end

#topic_arnString

Returns:

  • (String)


47
48
49
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb', line 47

def topic_arn
  @topic_arn
end

#typeString Also known as: notification_type

Returns:

  • (String)


41
42
43
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/notification_configuration.rb', line 41

def type
  @type
end