Skip to content

Commit

Permalink
Merge pull request #11 from rallets-network/business-api
Browse files Browse the repository at this point in the history
Add BUSINESS service
  • Loading branch information
Lax authored Feb 19, 2019
2 parents c1a6ad8 + b991470 commit abbc3dd
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Current support these services:
* `:rds` => `RDS` (Relational Database Service)
* `:slb` => `SLB` (Server Load Balancer)
* `:sts` => `STS` (Security Token Service)
* `:vpc` => `VPC` (Virtual Private Cloud)
* `:business` => `Business` (Aliyun Account Management)

## Contributing

Expand All @@ -70,4 +72,4 @@ Current support these services:


## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FLax%2Faliyun.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FLax%2Faliyun?ref=badge_large)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FLax%2Faliyun.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FLax%2Faliyun?ref=badge_large)
4 changes: 3 additions & 1 deletion lib/aliyun/services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require "aliyun/services/slb"
require "aliyun/services/sts"
require "aliyun/services/vpc"
require "aliyun/services/business"

module Aliyun
SERVICES = {
Expand All @@ -18,6 +19,7 @@ module Aliyun
:rds => RDSConfig,
:slb => SLBConfig,
:sts => STSConfig,
:vpc => VPCConfig
:vpc => VPCConfig,
:business => BusinessConfig
}
end
24 changes: 24 additions & 0 deletions lib/aliyun/services/business.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module Aliyun
class BusinessConfig < APIConfig
def self.info
"Aliyu Business Service"
end
def self.endpoint
'https://business.aliyuncs.com/'
end
def self.default_parameters
{
:Format=>"JSON",
:Version=>"2017-12-14",
:SignatureMethod=>"HMAC-SHA1",
:SignatureVersion=>"1.0"
}
end
def self.separator
super
end
def self.http_method
super
end
end
end
12 changes: 12 additions & 0 deletions spec/aliyun_business_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'spec_helper'

describe Aliyun do
it 'can create aliyun business service' do
options = load_options
options[:service] = :business
service = Aliyun::Service.new options

expect(service).to be_instance_of(Aliyun::Service)
expect(service.service).to be(Aliyun::BusinessConfig)
end
end

0 comments on commit abbc3dd

Please sign in to comment.