From b99147025295ac15924fe305bdf785e0365a782b Mon Sep 17 00:00:00 2001 From: Jiawei Li Date: Mon, 18 Feb 2019 16:21:59 +0800 Subject: [PATCH] Add BUSINESS service --- README.md | 4 +++- lib/aliyun/services.rb | 4 +++- lib/aliyun/services/business.rb | 24 ++++++++++++++++++++++++ spec/aliyun_business_spec.rb | 12 ++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 lib/aliyun/services/business.rb create mode 100644 spec/aliyun_business_spec.rb diff --git a/README.md b/README.md index a9f8fe5..4f2708b 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) \ No newline at end of file +[![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) diff --git a/lib/aliyun/services.rb b/lib/aliyun/services.rb index 39d0dd2..4037866 100644 --- a/lib/aliyun/services.rb +++ b/lib/aliyun/services.rb @@ -7,6 +7,7 @@ require "aliyun/services/slb" require "aliyun/services/sts" require "aliyun/services/vpc" +require "aliyun/services/business" module Aliyun SERVICES = { @@ -18,6 +19,7 @@ module Aliyun :rds => RDSConfig, :slb => SLBConfig, :sts => STSConfig, - :vpc => VPCConfig + :vpc => VPCConfig, + :business => BusinessConfig } end diff --git a/lib/aliyun/services/business.rb b/lib/aliyun/services/business.rb new file mode 100644 index 0000000..e39aeec --- /dev/null +++ b/lib/aliyun/services/business.rb @@ -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 diff --git a/spec/aliyun_business_spec.rb b/spec/aliyun_business_spec.rb new file mode 100644 index 0000000..5f2f344 --- /dev/null +++ b/spec/aliyun_business_spec.rb @@ -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