View Source CozyAliyunOpenAPI.Specs.RPC (cozy_aliyun_open_api v0.3.0)

Describes an RPC style API.

APIs in the RPC style include:

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

Examples

alias CozyAliyunOpenAPI.Config
alias CozyAliyunOpenAPI.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_config() :: %{
  endpoint: endpoint(),
  method: method(),
  headers: headers(),
  version: version(),
  action: action(),
  params: params()
}
@type t() :: %CozyAliyunOpenAPI.Specs.RPC{
  action: action(),
  config: CozyAliyunOpenAPI.Config.t(),
  endpoint: endpoint(),
  headers: headers(),
  method: method(),
  params: params(),
  version: version()
}
@type version() :: String.t()

Functions

Link to this function

new!(config, spec_config)

View Source
@spec new!(CozyAliyunOpenAPI.Config.t(), spec_config()) :: t()