Class: Aliyun::STS::Client
- Inherits:
-
Object
- Object
- Aliyun::STS::Client
- Defined in:
- lib/aliyun/sts/client.rb
Overview
STS服务的客户端,用于向STS申请临时token。
Instance Method Summary collapse
-
#assume_role(role, session, policy = nil, duration = 3600) ⇒ STS::Token
Assume a role.
-
#initialize(opts) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(opts) ⇒ Client
Returns a new instance of Client.
19 20 21 22 |
# File 'lib/aliyun/sts/client.rb', line 19 def initialize(opts) @config = Config.new(opts) @protocol = Protocol.new(@config) end |
Instance Method Details
#assume_role(role, session, policy = nil, duration = 3600) ⇒ STS::Token
Assume a role
31 32 33 |
# File 'lib/aliyun/sts/client.rb', line 31 def assume_role(role, session, policy = nil, duration = 3600) @protocol.assume_role(role, session, policy, duration) end |