This adds a custom (i.e. not-autogenerated) Ruby SDK, designed specifically around Ubicloud. Examples of use: ```ruby require "ubicloud" # Setup SDK context UBI = Ubicloud.new(:net_http, token: "YOUR_API_TOKEN", project_id: "pj...") # Get list of VMs UBI.vm.list # Create a firewall UBI.firewall.create(location: "eu-central-h1", name: "my-fw") # Retrieive a load balancer, lb = UBI["1b345678901234567890123456"] # then destroy it lb.destroy # Schedule a PostgreSQL database restart UBI.postgres.new("eu-central-h1/my-fw").restart ``` The SDK comes with two adapters, net_http and rack. net_http uses the net/http standard library to submit HTTP requests. rack directly calls rack applications. Users are expected to use net_http. The following commit will use the rack adapter to implement Ubicloud's CLI using the Ruby SDK. This adds a rake task to build the SDK gem. # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Tue Mar 25 17:01:03 2025 -0700 # # On branch jeremy-ruby-sdk # Changes to be committed: # modified: .gitignore # modified: Rakefile # new file: sdk/ruby/MIT-LICENSE # new file: sdk/ruby/README.md # new file: sdk/ruby/lib/ubicloud.rb # new file: sdk/ruby/lib/ubicloud/adapter.rb # new file: sdk/ruby/lib/ubicloud/adapter/net_http.rb # new file: sdk/ruby/lib/ubicloud/adapter/rack.rb # new file: sdk/ruby/lib/ubicloud/context.rb # new file: sdk/ruby/lib/ubicloud/model.rb # new file: sdk/ruby/lib/ubicloud/model/firewall.rb # new file: sdk/ruby/lib/ubicloud/model/load_balancer.rb # new file: sdk/ruby/lib/ubicloud/model/postgres.rb # new file: sdk/ruby/lib/ubicloud/model/private_subnet.rb # new file: sdk/ruby/lib/ubicloud/model/vm.rb # new file: sdk/ruby/lib/ubicloud/model_adapter.rb # new file: sdk/ruby/ubicloud.gemspec # new file: spec/ruby_sdk_spec.rb # modified: spec/thawed_mock.rb # # Changes not staged for commit: # modified: cli-commands/fw/post/add-rule.rb # modified: cli-commands/fw/post/attach-subnet.rb # modified: cli-commands/fw/post/create.rb # modified: cli-commands/fw/post/delete-rule.rb # modified: cli-commands/fw/post/detach-subnet.rb # modified: cli-commands/fw/post/show.rb # modified: cli-commands/lb/post/attach-vm.rb # modified: cli-commands/lb/post/create.rb # modified: cli-commands/lb/post/detach-vm.rb # modified: cli-commands/lb/post/show.rb # modified: cli-commands/lb/post/update.rb # modified: cli-commands/pg/post/add-firewall-rule.rb # modified: cli-commands/pg/post/add-metric-destination.rb # modified: cli-commands/pg/post/create.rb # modified: cli-commands/pg/post/delete-firewall-rule.rb # modified: cli-commands/pg/post/delete-metric-destination.rb # modified: cli-commands/pg/post/reset-superuser-password.rb # modified: cli-commands/pg/post/restart.rb # modified: cli-commands/pg/post/restore.rb # modified: cli-commands/pg/post/show.rb # modified: cli-commands/ps/post/connect.rb # modified: cli-commands/ps/post/create.rb # modified: cli-commands/ps/post/disconnect.rb # modified: cli-commands/ps/post/show.rb # modified: cli-commands/vm/post/create.rb # modified: cli-commands/vm/post/restart.rb # modified: cli-commands/vm/post/show.rb # modified: lib/ubi_cli.rb # modified: spec/routes/api/cli/golden-files/vm vmdzyppz6j166jh5e9t0dwrfas show.txt #
41 lines
797 B
Plaintext
41 lines
797 B
Plaintext
/.env.rb
|
|
/coverage
|
|
/spec/examples.txt
|
|
/demo/.env
|
|
/var/*
|
|
/tmp/*
|
|
/assets/css/app.css
|
|
/.auto-parallel-tests
|
|
/sdk/ruby/*.gem
|
|
/sql.log
|
|
/sql_query_parameterization_analysis.txt
|
|
/spec/routes/api/cli/spec-output-files
|
|
/cli-golden-files.diff
|
|
|
|
# Used by rake by
|
|
/bin/by
|
|
|
|
# rhizome/Gemfile is combination of all Gemfiles in subdirectories, so does rhizome/Gemfile.lock
|
|
/rhizome/*/Gemfile.lock
|
|
|
|
# Frontend
|
|
/node_modules
|
|
|
|
# vscode: https://github.com/github/gitignore/blob/4488915eec0b3a45b5c63ead28f286819c0917de/Global/VisualStudioCode.gitignore
|
|
/.vscode/*
|
|
!/.vscode/settings.json
|
|
!/.vscode/tasks.json
|
|
!/.vscode/launch.json
|
|
!/.vscode/extensions.json
|
|
!/.vscode/*.code-snippets
|
|
|
|
# Local History for Visual Studio Code
|
|
/.history/
|
|
|
|
# Built Visual Studio Code Extensions
|
|
/*.vsix
|
|
|
|
# CLI binary
|
|
/cli/ubi
|
|
/cli/ubi-*
|