View Source AliyunOpenAPI.Specs.RPC (aliyun_open_api v0.6.0)

Describes an RPC style API.

APIs in the RPC style include:

  • Elastic Compute Service (ECS)
  • Content Delivery Network (CDN)
  • ApsaraDB RDS
  • ...

Examples

alias AliyunOpenAPI.Config
alias AliyunOpenAPI.Specs.RPC

config =
  Config.new!(
    access_key_id: "...",
    access_key_secret: "..."
  )

RPC.new!(config,
  endpoint: "https://ecs-cn-hangzhou.aliyuncs.com/",
  method: :post,
  version: "2015-11-23",
  action: "DescribeInstanceStatus",
  params: %{
    "RegionId" => "cn-hangzhou"
  }
)

Summary

Types

@type action() :: String.t()
@type endpoint() :: String.t()
@type headers() :: %{
  optional(name :: String.t()) =>
    value :: nil | boolean() | number() | String.t()
}
@type method() :: :get | :post
@type params() ::
  %{
    optional(name :: String.t()) =>
      value :: nil | boolean() | number() | String.t()
  }
  | nil
@type spec_opt() ::
  {:endpoint, endpoint()}
  | {:method, method()}
  | {:headers, headers()}
  | {:version, version()}
  | {:action, action()}
  | {:params, params()}
@type spec_opts() :: [spec_opt()]
@type t() :: %AliyunOpenAPI.Specs.RPC{
  action: action(),
  config: AliyunOpenAPI.Config.t(),
  endpoint: endpoint(),
  headers: headers(),
  method: method(),
  params: params(),
  version: version()
}
@type version() :: String.t()

Functions

@spec new!(AliyunOpenAPI.Config.t(), spec_opts()) :: t()