
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Add this line to your application's Gemfile:
gem 'yandex_cloud'
And then execute:
$ bundle
Or install it yourself as:
$ gem install yandex_cloud
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
You can use your Oauth token directly in spesific requests or put it to the ENV variables.
Request for getting IAM-token for access to cloud API. Valid 12 hours.
# with oauth_token in ENV
auth_service = YandexCloud::Auth.new
auth_service.token
# or with oauth_token in service declaration
auth_service = YandexCloud::Auth.new(oauth_token: oauth_token)
auth_service.token
# successful response
{ 'iamToken' => iam_token }
# response with errors
{ 'code' => 16, 'message' => 'Token is invalid or has expired.', 'details' => [...] }
For using Translate service you need additionally get FOLDER_ID.
Instruction for getting FOLDER_ID is here
You can use your FOLDER_ID directly in spesific requests or put it to the ENV variables.
# with FOLDER_ID in ENV
translator = YandexCloud::Translate.new(iam_token: iam_token)
# or with FOLDER_ID in service declaration
translator = YandexCloud::Translate.new(iam_token: iam_token, folder_id: '12345')
iam_token - IAM-token, required
folder_id - folder ID of your account at YandexCloud, optional
Request for getting list of supported languages is #languages.
translator.languages()
# successful response
{ 'languages' => [...] }
# response with errors
{ 'error_message' => '' }
Request for detecting language of text is #detect.
translator.detect(text: 'Hello')
text - text for detection, required
hint - list of possible languages, optional, example - 'en,ru'
# successful response
{ 'language' => 'es' }
# response with errors
{ 'error_message' => '' }
Request for translating text is #translate.
translator.translate(text: 'Hola', target: 'en')
text - text for detection, required
source - source language, ISO 639-1 format (like 'en'), optional
target - target language, ISO 639-1 format (like 'ru'), required
format - text format, one of the [plain|html], default - plain, optional
# successful response
{ 'translations' => [{ 'text' => 'Hello' }]}
# response with errors
{ 'error_message' => '' }
Bug reports and pull requests are welcome on GitHub at https://github.com/kortirso/yandex_cloud.
The gem is available as open source under the terms of the MIT License.
Use this package at your own peril and risk.
Everyone interacting in the YandexCloud project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that yandex_cloud demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.