GithubHelp home page GithubHelp logo

aliyun / openapi-core-ruby-sdk Goto Github PK

View Code? Open in Web Editor NEW
37.0 5.0 25.0 67 KB

Alibaba Cloud Core SDK for Ruby

Home Page: https://rubygems.org/gems/aliyunsdkcore?locale=en

License: MIT License

Ruby 98.80% Makefile 1.20%
alibabacloud alibaba sdk core client ruby gems

openapi-core-ruby-sdk's Introduction

English | 简体中文

Alibaba Cloud Core SDK for Ruby

Gem Version Build Status Build status codecov

Alibaba Cloud Core SDK for Ruby allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests.

This document introduces how to install and use Alibaba Cloud Core SDK for Ruby.

Troubleshoot

Troubleshoot Provide OpenAPI diagnosis service to help developers locate quickly and provide solutions for developers through RequestID or error message.

Installation

$ gem install aliyunsdkcore

Usage

The RPC demo:

require 'aliyunsdkcore'

client = RPCClient.new(
  endpoint:          'https://ecs.aliyuncs.com',
  api_version:       '2014-05-26',
  access_key_id:     ENV['ACCESS_KEY_ID'],
  access_key_secret: ENV['ACCESS_KEY_SECRET'],
)

params         = { key: (1..11).to_a.map(&:to_s) }
request_option = { method: 'POST', timeout: 15000 }
response       = client.request(
  action: 'DescribeRegions',
  params: params,
  opts: request_option
)

print response

The ROA demo:

require 'aliyunsdkcore'

client = ROAClient.new(
  endpoint:          'http://ros.aliyuncs.com',
  api_version:       '2015-09-01',
  access_key_id:     ENV['ACCESS_KEY_ID'],
  access_key_secret: ENV['ACCESS_KEY_SECRET'],
)

response = client.request(
  method: 'GET',
  uri: '/regions',
  options: {
    timeout: 15000
  }
)

print response.body

Issues

Opening an Issue, Issues not conforming to the guidelines may be closed immediately.

Changelog

Detailed changes for each release are documented in the release notes.

Contribution

Please make sure to read the Contributing Guide before making a pull request.

License

MIT

Copyright 1999-2019 Alibaba Group Holding Ltd.

openapi-core-ruby-sdk's People

Contributors

aliguyong avatar axiosleo avatar huacnlee avatar jacksontian avatar jiangyongkang avatar peze avatar thankssiralex avatar yuuu avatar zhandao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

openapi-core-ruby-sdk's Issues

出错了

activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- ./rpc_client.rb (LoadError)

README 里面给出来的案例跑不过

Ruby 版本 :rbenv 安装的 2.7.0

client = RPCClient.new(
  endpoint:          'https://ecs.aliyuncs.com',
  api_version:       '2014-05-26',
  access_key_id:     ENV['ALI_ACCESS_KEY'],
  access_key_secret: ENV['ALI_ACCESS_KEY_SECRET'],
  )

params         = { key: (1..11).to_a.map(&:to_s) }
request_option = { method: 'POST', timeout: 15000 }
response       = client.request(
  action: 'DescribeRegions',
  params: params,
  opts: request_option
)

报错如下:

StandardError (Code: IncompleteSignature, Message: The request signature does not conform to Aliyun standards. server string to sign is:POST&%2F&AccessKeyId%XXXXXXX%26Action%3DDescribeRegions%26Format%3DJSON%26Key.1%3D1%26Key.10%3D10%26Key.11%3D11%26Key.2%3D2%26Key.3%3D3%26Key.4%3D4%26Key.5%3D5%26Key.6%3D6%26Key.7%3D7%26Key.8%3D8%26Key.9%3D9%26SignatureMethod%3DHMAC-SHA1%26SignatureNonce%3Ddb43695041184ed44082891e0b0cec85%26SignatureVersion%3D1.0%26Timestamp%3D2020-05-12T10%253A29%253A49Z%26Version%3D2014-05-26, URL: /)

AccessKeyId 我隐去了。

用的 Gem 版本是刚发出来的 0.0.16

同理我请求 Action 是:ExecuteRequest 也有类似的错误。

另外:params 这边能否给出更加具体的案例,毕竟 json 字符串很有歧义

rspec tests fail

  • Ruby Version: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
  • Platform: Darwin bxzy 20.6.0 Darwin Kernel Version 20.6.0: Wed Nov 10 22:23:07 PST 2021; root:xnu-7195.141.14~1/RELEASE_X86_64 x86_64
  • Product:
  • Product Version:
  • API:

steps to reproduce:

  1. git clone
  2. make install
  3. make test

attempt to fix rspec ./spec/roa_client_integration_spec.rb:19 # roa request request by changing lib/aliyunsdkcore/roa_client.rb:43 from request_body = body to request_body = body.presence.to_s
but it was not working.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.