Feature #3874

Ask astakos for service endpoints

Added by Stavros Sachtouris almost 8 years ago. Updated almost 8 years ago.

Status:Closed Start date:05/29/2013
Priority:High Due date:05/31/2013
Assignee:Stavros Sachtouris % Done:

100%

Category:kamaki Spent time: 14.00 hours
Target version:v0.9 Estimated time:12.00 hours

Description

Use /astakos/api/tokens call to get service endpoints

Service endpoints will be used instead of the <service>.url option.

kamaki will first try to get endpoints from astakos and, if failed, it will search for them in the config file

Also, the following global arguments will be introduced:

--urls-from-config is a flag argument that will enforce the use of urls specified in the config file over the ones aquired by calling astakos
--with-astakos-url <url> is a value argument equivalent to -o user.url <url> and it will be used to get endpoints on the fly


Related issues

related to ./kamaki - Feature #3913: Add multiple remotes and switch between them Closed 06/03/2013 06/04/2013

Associated revisions

Revision 528550d9
Added by Stavros Sachtouris almost 8 years ago

Enrich/rename astakos client calls with endpoints

Refs: #3874

Kamaki.clients.astakos.AstakosClient is now a high-level client lib that
offers access to token-authenticated astakos-aquired cached information.
Users who need an astakos client should use the snf-astakosclient instead.

Usage:

astakos_cache = AstakosClient(&lt;astakos/base/url/with/identity/api&gt;)
astakos_cache.authenticate(&lt;token&gt;)
user_info = astakos_cache.user_info()
compute_endpoints = astakos_cache.get_service_endpoints('compute', 'v2')

Major changes:

Modify ReST call from /im/authenticate to /tokens

New methods as AstakosClient instance cache accessors:
get_services
get_service_details
get_service_endpoints

Method renaiming for existing AstakosClient instance cache accessors:
info --> user_info
user --> list_users

Revision 05e144e2
Added by Stavros Sachtouris almost 8 years ago

Create config file version 3

Refs: #3874

Minimum config file:
[global]
token = <user token>

Changes:

- Only one field "cli" for user command specs, to map command groups to CLIs:

[cli]
user = astakos
file = pithos
server = cyclades
...

- Specify client services/apis and versions.
General format:
[client]
type = <service>
version = <api version>

Example:
[cyclades]
type = compute
version = v2.0

Revision f724cd35
Added by Stavros Sachtouris almost 8 years ago

Get endpoint urls for all CLI operations

Refs: #3874

Use kamaki.clients.astakos.AstakosClient as a cached astakos client to get
user information and, most importantly, endpoints. Allow users to authenticate
multiple tokens on the same session. In every session there must be at most
one authentication per user/token.

Major change: top kamaki.cli.commands class now contains a base_auth field
with the cached authenticating client. All urls are drained from this field.

Revision 8cec3671
Added by Stavros Sachtouris almost 8 years ago

Use explicitely set services urls if no auth_url

Refs: #3874

In current configuration, kamaki checks for auth_url. If that fails,
it raises an error. If it is not set, it prints a warning and attempts
to read the <service>.url option from the configuration file.

Service urls: astakos.url, pithos.url, cyclades.url, plankton.url

Revision 54b6be76
Added by Stavros Sachtouris almost 8 years ago

Use explicitely set services urls if no auth_url

Refs: #3874

In current configuration, kamaki checks for auth_url. If that fails,
it raises an error. If it is not set, it prints a warning and attempts
to read the <service>.url option from the configuration file.

Service urls: astakos.url, pithos.url, cyclades.url, plankton.url

Revision ef00bc31
Added by Stavros Sachtouris almost 8 years ago

Apply servce.url options to cross-sercice calls

Refs: #3874

Let cross-service initializations to use explicit service endpoint urls if
there is no single authentication url.
- In Image commands, there are calls that use astakos and pithos clients
- In pithos there are calls that use astakos client

Revision 3c346c91
Added by Stavros Sachtouris almost 8 years ago

Apply servce.url options to cross-sercice calls

Refs: #3874

Let cross-service initializations to use explicit service endpoint urls if
there is no single authentication url.
- In Image commands, there are calls that use astakos and pithos clients
- In pithos there are calls that use astakos client

History

#1 Updated by Stavros Sachtouris almost 8 years ago

Two types of authentication: username/password and token

Response format:

{'serviceCatalog': [ {'endpoints': [{
'SNF:uiURL': 'https://node1.example.com/ui/',
'adminURL': 'https://node1.example.com/v1',
'internalUrl': 'https://node1.example.com/v1',
'publicURL': 'https://node1.example.com/v1',
'region': 'cyclades'}],
'name': 'cyclades',
'type': 'compute'}, {
'SNF:uiURL': 'https://node1.example.com/ui/',
'adminURL': 'https://node1.example.com/v1',
'internalUrl': 'https://node1.example.com/v1',
'publicURL': 'https://node1.example.com/v1',
'region': 'cyclades'}],
'name': 'pithos',
'type': 'storage'}
],
'token': {
'expires': '2013-06-19T15:23:59.975572+00:00',
'id': 'CDEe2k0T/HdiJWBMMbHyOA==',
'tenant': {'id': 'c18088be-16b1-4263-8180-043c54e22903',
'name': 'Firstname Lastname'}
},
'user': {'id': 'c18088be-16b1-4263-8180-043c54e22903',
'name': 'Firstname Lastname',
'roles': [{'id': 1, 'name': 'default'}],
'roles_links': []}
}

#2 Updated by Stavros Sachtouris almost 8 years ago

  • Target version changed from v0.10 to v0.9

#3 Updated by Stavros Sachtouris almost 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#4 Updated by Stavros Sachtouris almost 8 years ago

  • % Done changed from 50 to 100

#5 Updated by Stavros Sachtouris almost 8 years ago

Recent changes:

Rename: the single authenticatil URL used to automatically discover all service endpoints is now named auth_url

Explicit Endpoints: Allow kamaki to support explicit service endpoint URLs. If a single Authentication URL (auth_url) is not set, kamaki will look for the following service endpoints:

  • astakos.url
  • cyclades.url
  • pithos.url
  • plankton.url

#6 Updated by Stavros Sachtouris almost 8 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF