README.md in yandex_cloud-0.1.0 vs README.md in yandex_cloud-0.2.0
- old
+ new
@@ -14,24 +14,56 @@
Or install it yourself as:
$ gem install yandex_cloud
-## Usage
+## Get access to API
-## Development
+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.
-After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
+Instructions for getting Oauth token is [here](https://cloud.yandex.com/docs/iam/operations/iam-token/create)
-To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
+### 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. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
+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/[USERNAME]/yandex_cloud/blob/master/CODE_OF_CONDUCT.md).
+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).