Страница:
Generating Ruby SDK
Страницы
Azure SDK gems
Azure Stack API Steps to regenerate SDKs
Basic Specification for SDK
Generating Ruby SDK
Home
Installing Azure Ruby SDK
Prerequisites
Repositories
Repository Structure
Sample Repositories
Testing on Windows Guide
Using Azure Ruby SDK
Using Azure SDK for Ruby
Versioning Information
1
Generating Ruby SDK
mozehgir редактировал(а) эту страницу 2017-11-17 11:53:47 -08:00
Этот файл содержит неоднозначные символы Юникода!
Этот файл содержит неоднозначные символы Юникода, которые могут быть перепутаны с другими в текущей локали. Если это намеренно, можете спокойно проигнорировать это предупреждение. Используйте кнопку Экранировать, чтобы подсветить эти символы.
Generate Ruby SDK for local code generation validation
- Install AutoRest
- Call autorest with the following arguments:
- If you have a readme.md file associated with the specification(s) you’re generating an SDK for:
autorest path --ruby --azure-arm --output-folder --package-version --package-name --namespace
Where these placeholders are replaced by the following:
path = path to the readme file
output-folder = path to where you want the generated code
package-version = gem version
package-name = name of the package ex. azure_mgmt_compute
namespace = namespace for your service ex. Azure::Compute::Mgmt::V2017_03_30
If you need to generate code for a specific tag from the readme.md file, you can also pass:
--tag (name of the tag to use)
- If you’re looking to generate code based on a specific swagger file, you can replace path ro readme file with the path to the swagger file
path = --input-file (path to the swagger file)
- Our current configuration values for each of the parameters are here.
- For more info on AutoRest command line.
Updates to existing specs already picked up in the Ruby SDK
- When an update is made to a spec in azure-rest-api-specs repo, that’s already getting picked up by the Ruby SDK via:
https://github.com/Azure/azure-sdk-for-ruby/blob/master/swagger_to_sdk_config.json
A PR will get automatically created in azure-sdk-for-ruby repo with the corresponding changes. - Feel free to comment on the PR
- The Ruby SDK will pick it up from here, if you need to merge the change as soon as possible, please comment on the PR and/or send email to Azure DevEx Ruby team.
New gem to be included in the Ruby SDK
Currently done by the Ruby SDK team. Send an email to Azure DevX Ruby team to request a new gem in the Ruby SDK.
Service teams can also do the process themselves if they choose to do so by following the instructions below:
- Create a PR against azure-sdk-for-ruby repo containing:
- Folder for the new gem with the name of the package as the folder name:
- You can copy&paste an existing folder like
https://github.com/Azure/azure-sdk-for-ruby/tree/master/management/azure_mgmt_compute
- You can copy&paste an existing folder like
- Include .gemspec file, Rakefile, License.txt, .rspec, README.md, spec folder (with spec_helper.rb boiler plate code or tests), lib folder
- Update https://github.com/Azure/azure-sdk-for-ruby/blob/master/config.json with the necessary configuration for the new service
- Update https://github.com/Azure/azure-sdk-for-ruby/blob/master/swagger_to_sdk_config.json with the necessary configuration for the new service
- Update https://github.com/Azure/azure-sdk-for-ruby/blob/master/GEM_VERSIONS
- Update https://github.com/Azure/azure-sdk-for-ruby/blob/master/GEMS_TO_RELEASE if it’s expected to be released.
- Update https://github.com/Azure/azure-sdk-for-ruby/blob/master/profile_specs/profiles.json
- Under “rollup” section: to have the new gem included in the “Lastest” azure_sdk roll-up gem.
- Under “management” section: to have a profile created for the gem which includes the necessary API versions.
- To generate the SDK Run “rake arm:regen” – Note: the current rake tasks generate the full SDK with all services, if you want to generate just yours, comment out all except the one you added in config.json. Please have a separate commit with the generated code, as including all changes in 1 commit makes it hard to review.
Building gems
- Use rake arm:build task to build gems for everything in:
https://github.com/Azure/azure-sdk-for-ruby/blob/master/swagger_to_sdk_config.json
Or - Run rake build from your gems folder to build that individual gem.
Releasing to RubyGems
Please email Azure DevEx Ruby team to kick off a release.