Sha256: 2b24d7288e6390445f88b4ea9e29767774e6c037fffbc77cfb0780e47f662ef8

Contents?: true

Size: 1.61 KB

Versions: 1

Compression:

Stored size: 1.61 KB

Contents

# YandexCloud

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'yandex_cloud'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install yandex_cloud

## Get access to API

To make api requests in Yandex.Cloud you must include IAM-token in request headers and for getting IAM-token you must have Oauth token.

Instructions for getting Oauth token is [here](https://cloud.yandex.com/docs/iam/operations/iam-token/create)

### Configuration

You can use your Oauth token directly in spesific requests or put it to the ENV variables.

## Using

### Get IAM-token for cloud API access

Request for getting IAM-token for access to cloud API. Valid 12 hours.

```ruby
# with oauth_token in ENV
auth_service = YandexCloud::Auth.new
auth_service.token

# or with oauth_token in request
auth_service = YandexCloud::Auth.new(oauth_token: oauth_token)
auth_service.token
```

#### Responses

```ruby
# successful response
{ "iamToken" => iam_token }

# response with errors
{ "code" => 16, "message" => "Token is invalid or has expired.", "details" => [...] } 
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kortirso/yandex_cloud.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

## Disclaimer

Use this package at your own peril and risk.

## Code of Conduct

Everyone interacting in the YandexCloud project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kortirso/yandex_cloud/blob/master/CODE_OF_CONDUCT.md).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yandex_cloud-0.2.0 README.md