api_connect_client 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/api_connect_client.rb +1 -0
- data/lib/api_connect_client/admin.rb +17 -0
- data/lib/api_connect_client/developer.rb +10 -0
- data/lib/api_connect_client/manager.rb +2 -2
- data/lib/api_connect_client/user.rb +11 -6
- data/lib/api_connect_client/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 318e7dcda856d10e17e4161ce29974e9c151d3fe221fee3a0d8b785a5c1ce351
|
4
|
+
data.tar.gz: 1977f40a67f6843793a1121037d78007f13fb28c789cbb6b36388e9183a44d10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20f48825709bf373e79aba1aaf8e18b287a85a2c87c201e8fe9120ecc8f40c3dd9d740e83d8027721d9be1fdce71ff109e9f1ce00c80c9f3b5b870d734e465f5
|
7
|
+
data.tar.gz: 9b4828fbaf12f85d6cf78bd6163f6d3f49b75b3b61f8e9e90efb445b5c343593d4ce7f1e718c4bee62b5393512db0fe719d85506710f732558bb0475a10cddb7
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
|
3
|
-
# Api Connect Client [![Build Status](https://travis-ci.org/
|
3
|
+
# Api Connect Client [![Build Status](https://travis-ci.org/cffiebigc/api-connect-client.svg?branch=master)](https://travis-ci.org/cffiebigc/api-connect-client) [![Gem Version](https://badge.fury.io/rb/api_connect_client.svg)](https://badge.fury.io/rb/api_connect_client)
|
4
4
|
|
5
5
|
This gem is used to interact with the [Developer Portal REST APIs](https://www.ibm.com/support/knowledgecenter/en/SSFS6T/com.ibm.apic.apirest.doc/dev_portal_apis.html)
|
6
6
|
to perform some of the operations that are normally carried out in the Developer Portal UI.
|
data/lib/api_connect_client.rb
CHANGED
@@ -4,6 +4,7 @@ module ApiConnectClient
|
|
4
4
|
require_relative './api_connect_client/base'
|
5
5
|
require_relative './api_connect_client/product'
|
6
6
|
require_relative './api_connect_client/user'
|
7
|
+
require_relative './api_connect_client/admin'
|
7
8
|
require_relative './api_connect_client/application'
|
8
9
|
require_relative './api_connect_client/manager'
|
9
10
|
require_relative './api_connect_client/developer'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module ApiConnectClient
|
2
|
+
class Admin < Base
|
3
|
+
def initialize(admin_user, admin_pass)
|
4
|
+
super()
|
5
|
+
@headers = {
|
6
|
+
'X-IBM-APIManagement-Context': ApiConnectClient::Config.context
|
7
|
+
}
|
8
|
+
@admin_user = admin_user
|
9
|
+
@admin_pass = admin_pass
|
10
|
+
end
|
11
|
+
|
12
|
+
def register_developer(body)
|
13
|
+
post('/users/register', body, @admin_user, @admin_pass)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -80,5 +80,15 @@ module ApiConnectClient
|
|
80
80
|
app = ApiConnectClient::Application.new(@@organization_id, @username, @password)
|
81
81
|
app.unsubscribe(app_id, subscription_id)
|
82
82
|
end
|
83
|
+
|
84
|
+
def get_profile_information
|
85
|
+
user = ApiConnectClient::User.new(@username, @password)
|
86
|
+
user.get_info
|
87
|
+
end
|
88
|
+
|
89
|
+
def list_organizations
|
90
|
+
user = ApiConnectClient::User.new(@username, @password)
|
91
|
+
user.list_organizations
|
92
|
+
end
|
83
93
|
end
|
84
94
|
end
|
@@ -13,8 +13,8 @@ module ApiConnectClient
|
|
13
13
|
"password" => password,
|
14
14
|
"username" => username
|
15
15
|
}
|
16
|
-
|
17
|
-
|
16
|
+
admin = ApiConnectClient::Admin.new(@admin_user, @admin_pass)
|
17
|
+
admin.register_developer(body.to_json)
|
18
18
|
end
|
19
19
|
|
20
20
|
def list_products
|
@@ -1,16 +1,21 @@
|
|
1
1
|
module ApiConnectClient
|
2
2
|
class User < Base
|
3
|
-
def initialize(
|
3
|
+
def initialize(username, password)
|
4
4
|
super()
|
5
5
|
@headers = {
|
6
6
|
'X-IBM-APIManagement-Context': ApiConnectClient::Config.context
|
7
7
|
}
|
8
|
-
@
|
9
|
-
@
|
8
|
+
@username = username
|
9
|
+
@password = password
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
13
|
-
|
12
|
+
def get_info
|
13
|
+
get("/me", @username, @password)
|
14
14
|
end
|
15
|
+
|
16
|
+
def list_organizations
|
17
|
+
get("/orgs", @username, @password)
|
18
|
+
end
|
19
|
+
|
15
20
|
end
|
16
|
-
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_connect_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Fiebig
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- bin/console
|
135
135
|
- bin/setup
|
136
136
|
- lib/api_connect_client.rb
|
137
|
+
- lib/api_connect_client/admin.rb
|
137
138
|
- lib/api_connect_client/api.rb
|
138
139
|
- lib/api_connect_client/application.rb
|
139
140
|
- lib/api_connect_client/base.rb
|