ibm_cloud_iam

IbmCloudIam - the Ruby gem for the IAM Identity Services API

The IAM Identity Service API allows for the management of Identities (Service IDs, ApiKeys).

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build ibm_cloud_iam.gemspec

Then either install the gem locally:

gem install ./ibm_cloud_iam-1.0.0.gem

(for development, run gem install --dev ./ibm_cloud_iam-1.0.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'ibm_cloud_iam', '~> 1.0.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'ibm_cloud_iam', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'ibm_cloud_iam'

api_instance = IbmCloudIam::IdentityOperationsApi.new
create_api_key_request = IbmCloudIam::CreateApiKeyRequest.new # CreateApiKeyRequest | Request to create an API key
opts = {
  authorization: 'authorization_example', # String | Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Please make sure that the provided token has the required authority for the request.
  entity_lock: 'false' # String | Indicates if the API key is locked for further write operations. False by default.
}

begin
  #Create an API key
  result = api_instance.create_api_key(create_api_key_request, opts)
  p result
rescue IbmCloudIam::ApiError => e
  puts "Exception when calling IdentityOperationsApi->create_api_key: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://iam.cloud.ibm.com

Class Method HTTP request Description
IbmCloudIam::IdentityOperationsApi create_api_key POST /v1/apikeys Create an API key
IbmCloudIam::IdentityOperationsApi create_service_id POST /v1/serviceids/ Create a service ID
IbmCloudIam::IdentityOperationsApi delete_api_key DELETE /v1/apikeys/id Deletes an API key
IbmCloudIam::IdentityOperationsApi delete_service_id DELETE /v1/serviceids/id Deletes a service ID and associated API keys
IbmCloudIam::IdentityOperationsApi get_api_key GET /v1/apikeys/id Get details of an API key
IbmCloudIam::IdentityOperationsApi get_api_keys_details GET /v1/apikeys/details Get details of an API key by its value
IbmCloudIam::IdentityOperationsApi get_service_id GET /v1/serviceids/id Get details of a service ID
IbmCloudIam::IdentityOperationsApi list_api_keys GET /v1/apikeys Get API keys for a given service or user IAM ID and account ID
IbmCloudIam::IdentityOperationsApi list_service_ids GET /v1/serviceids/ List service IDs
IbmCloudIam::IdentityOperationsApi lock_api_key POST /v1/apikeys/id/lock Lock the API key
IbmCloudIam::IdentityOperationsApi lock_service_id POST /v1/serviceids/id/lock Lock the service ID
IbmCloudIam::IdentityOperationsApi unlock_api_key DELETE /v1/apikeys/id/lock Unlock the API key
IbmCloudIam::IdentityOperationsApi unlock_service_id DELETE /v1/serviceids/id/lock Unlock the service ID
IbmCloudIam::IdentityOperationsApi update_api_key PUT /v1/apikeys/id Updates an API key
IbmCloudIam::IdentityOperationsApi update_service_id PUT /v1/serviceids/id Update service ID
IbmCloudIam::TokenOperationsApi get_token_api_key POST /identity/token#apikey Create an IAM access token for a user or service ID using an API key
IbmCloudIam::TokenOperationsApi get_token_api_key_delegated_refresh_token POST /identity/token#apikey-delegated-refresh-token Create an IAM access token and delegated refresh token for a user or service ID
IbmCloudIam::TokenOperationsApi get_token_iam_authz POST /identity/token#iam-authz Create an IAM access token based on an authorization policy
IbmCloudIam::TokenOperationsApi get_token_password POST /identity/token#password Create an IAM access token for a user using username / password credentials and an optional account identifier

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.