0
我想使用ruby aws-sdk client函數Aws::EC2::Client.describe-instance-status
僅返回Scheduled Events的實例列表。這是我在這個當前的嘗試:Ruby aws-sdk只爲具有事件的實例描述實例狀態
ec2 = Aws::EC2::Client.new(
region: ENV['REGION'],
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
)
ec2_events = ec2.describe_instance_status({
dry_run: false,
filters: [
{
name: "events",
values: ["event.description"],
},
],
})
這是我得到的錯誤信息:
/Users/myusername/.gems/gems/aws-sdk-core-2.5.11/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call': The filter 'events' is invalid (Aws::EC2::Errors::InvalidParameterValue)
from /Users/myusername/.gems/gems/aws-sdk-core-2.5.11/lib/aws-sdk-core/plugins/param_converter.rb:20:in `call'
from /Users/myusername/.gems/gems/aws-sdk-core-2.5.11/lib/aws-sdk-core/plugins/response_paging.rb:26:in `call'
from /Users/myusername/.gems/gems/aws-sdk-core-2.5.11/lib/seahorse/client/plugins/response_target.rb:21:in `call'
from /Users/myusername/.gems/gems/aws-sdk-core-2.5.11/lib/seahorse/client/request.rb:70:in `send_request'
from /Users/myusername/.gems/gems/aws-sdk-core-2.5.11/lib/seahorse/client/base.rb:207:in `block (2 levels) in define_operation_methods'
from test.rb:30:in `<main>'
有一個簡單的辦法有AWS-SDK稱讚了只有預定活動的實例?我知道常規的aws cli工具有這個option,但我真的想用aws-sdk gem代替。
它說事件無效。 – Abhinay