Tokens

1. auth_for_admin(auth, update_session=True)

Authenticates and generates a token.

Parameters:

Name Type Description
auth Dict authentication
update_session Bool whether to update the token for session

Parameters example:

        auth = {
            "auth": {
                "tenantName": "admin",
                "passwordCredentials": {
                    "username": "admin",
                    "password": "inesa2014"
                }
            }
        }

Return value: Token Object

Return value example:

{
    access: {
        u 'token': {
            u 'issued_at': u '2016-08-28T00:56:52.546273',
            u 'expires': u '2016-08-28T01:56:52Z',
            u 'id': u '94772c0ca6e14602bd7c98daf18609a7',
            u 'tenant': {
                u 'enabled': True,
                u 'description': u 'admin tenant',
                u 'name': u 'admin',
                u 'id': u 'cde9cbf5a7f1401a9389c84ba98bdcf6'
            },
            u 'audit_ids': [u 'acg7mN6DRFCe8ZQwTY-1LQ']
        },
        u 'serviceCatalog': [{
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:9511/v1',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:9511/v1',
                u 'internalURL': u 'http://10.200.43.31:9511/v1',
                u 'id': u '09c38752916e499f82bf4d54de24bcb8'
            }],
            u 'type': u 'container',
            u 'name': u 'magnum'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:9696',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:9696',
                u 'internalURL': u 'http://10.200.43.31:9696',
                u 'id': u '551c5e7996ce4a67818c0fc808268c3a'
            }],
            u 'type': u 'network',
            u 'name': u 'neutron'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8776/v2/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8776/v2/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'internalURL': u 'http://10.200.43.31:8776/v2/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'id': u '5b0c3c534e864486a3ac55d76d8a6125'
            }],
            u 'type': u 'volumev2',
            u 'name': u 'cinderv2'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://127.0.0.1:8774/v3',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://127.0.0.1:8774/v3',
                u 'internalURL': u 'http://127.0.0.1:8774/v3',
                u 'id': u '136e37c8d7da48a283b16c648f63897a'
            }],
            u 'type': u 'computev3',
            u 'name': u 'novav3'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8080',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8080',
                u 'internalURL': u 'http://10.200.43.31:8080',
                u 'id': u '0b439c142ad947958e7a61acadd38b94'
            }],
            u 'type': u 's3',
            u 'name': u 'swift_s3'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:9292',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:9292',
                u 'internalURL': u 'http://10.200.43.31:9292',
                u 'id': u '909d85aa93c7451fbf472b6637406e9c'
            }],
            u 'type': u 'image',
            u 'name': u 'glance'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8779/v1.0/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8779/v1.0/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'internalURL': u 'http://10.200.43.31:8779/v1.0/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'id': u '2228df33525047aeaa766e1cd473c71e'
            }],
            u 'type': u 'database',
            u 'name': u 'trove'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8777',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8777',
                u 'internalURL': u 'http://10.200.43.31:8777',
                u 'id': u '04ee4cd3452048a586011a63903543f7'
            }],
            u 'type': u 'metering',
            u 'name': u 'ceilometer'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8000/v1',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8000/v1',
                u 'internalURL': u 'http://10.200.43.31:8000/v1',
                u 'id': u '12a27bde829740df8e5b10a43c7b1ba8'
            }],
            u 'type': u 'cloudformation',
            u 'name': u 'heat-cfn'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8776/v1/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8776/v1/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'internalURL': u 'http://10.200.43.31:8776/v1/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'id': u '1d6321e4794647b69778bb19fe5fef9b'
            }],
            u 'type': u 'volume',
            u 'name': u 'cinder'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8774/v2/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8774/v2/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'internalURL': u 'http://10.200.43.31:8774/v2/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'id': u '19b67eca42484456b90eed0109ce08fc'
            }],
            u 'type': u 'compute',
            u 'name': u 'nova'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8773/services/Admin',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8773/services/Cloud',
                u 'internalURL': u 'http://10.200.43.31:8773/services/Cloud',
                u 'id': u '0838d371493641bb9e49bc6d3ae13e3e'
            }],
            u 'type': u 'ec2',
            u 'name': u 'nova_ec2'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8004/v1/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8004/v1/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'internalURL': u 'http://10.200.43.31:8004/v1/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'id': u '8ed4cda192aa467b8b24e75f655541ea'
            }],
            u 'type': u 'orchestration',
            u 'name': u 'heat'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8080',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8080/v1/AUTH_cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'internalURL': u 'http://10.200.43.31:8080/v1/AUTH_cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'id': u '62c4b6eb8804429099242e8ace9c5af1'
            }],
            u 'type': u 'object-store',
            u 'name': u 'swift'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:8386/v1.1/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:8386/v1.1/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'internalURL': u 'http://10.200.43.31:8386/v1.1/cde9cbf5a7f1401a9389c84ba98bdcf6',
                u 'id': u '357fb7e1f2134a3a905fd6c6a70316f5'
            }],
            u 'type': u 'data-processing',
            u 'name': u 'sahara'
        }, {
            u 'endpoints_links': [],
            u 'endpoints': [{
                u 'adminURL': u 'http://10.200.43.31:35357/v2.0',
                u 'region': u 'RegionOne',
                u 'publicURL': u 'http://10.200.43.31:5000/v2.0',
                u 'internalURL': u 'http://10.200.43.31:5000/v2.0',
                u 'id': u '374dd2f73e174ed99869ffc3b8acdaea'
            }],
            u 'type': u 'identity',
            u 'name': u 'keystone'
        }],
        u 'user': {
            u 'username': u 'admin',
            u 'roles_links': [],
            u 'id': u '8408b8a050b74920b83e7bba5ff5cbfb',
            u 'roles': [{
                u 'name': u '_member_'
            }, {
                u 'name': u 'heat_stack_owner'
            }, {
                u 'name': u 'admin'
            }],
            u 'name': u 'admin'
        },
        u 'metadata': {
            u 'is_admin': 0,
            u 'roles': [u '9fe2ff9ee4384b1894a90878d3e92bab', u 'cf483f358a60464ea3f8ab5a978b2d9e', u 'bff8544bffce41bb9f45dba90e5931a5']
        }
    }
    id: 94772 c0ca6e14602bd7c98daf18609a7
}

2. validate_token(token_id, admin=False, belongsTo=None)

Validates a token and confirms that it belongs to a tenant.

Parameters: tokenID(string), query(array)

Name Type Description
token_id String The authentication token for which to perform the operation
admin(optional) Bool Validate for admin
belongsTo(optional) String validate if the token belongs to a tenant

Return value: Token Object

Return value example:

token: {
    u 'issued_at': u '2016-08-28T00:56:52.546273',
    u 'expires': u '2016-08-28T01:56:52Z',
    u 'id': u '94772c0ca6e14602bd7c98daf18609a7',
    u 'tenant': {
        u 'description': u 'admin tenant',
        u 'enabled': True,
        u 'id': u 'cde9cbf5a7f1401a9389c84ba98bdcf6',
        u 'name': u 'admin'
    },
    u 'audit_ids': [u 'acg7mN6DRFCe8ZQwTY-1LQ']
}
...

3. delete_token(token_id)

Delete a token.

Parameters: tokenId(string),

Name Type Description
token_id String The authentication token for which to perform the operation

Return value: Status Code

Normal response codes: 204

Error response codes: 413,405,404,403,401,400,503

4. endpoints(token_id)

Lists the endpoints associated with a token

Parameters: token_id(string)

Return value: Dict

Return value example:

{
    u 'endpoints': [{
        u 'name': u 'magnum',
        u 'adminURL': u 'http://10.200.43.31:9511/v1',
        u 'region': u 'RegionOne',
        u 'internalURL': u 'http://10.200.43.31:9511/v1',
        u 'type': u 'container',
        u 'id': u '09c38752916e499f82bf4d54de24bcb8',
        u 'publicURL': u 'http://10.200.43.31:9511/v1'
    }, {
        u 'name': u 'neutron',
        u 'adminURL': u 'http://10.200.43.31:9696',
        u 'region': u 'RegionOne',
        u 'internalURL': u 'http://10.200.43.31:9696',
        u 'type': u 'network',
        u 'id': u '551c5e7996ce4a67818c0fc808268c3a',
        u 'publicURL': u 'http://10.200.43.31:9696'
    }, {
        u 'name': u 'cinderv2',
        u 'adminURL': u 'http://10.200.43.31:8776/v2/cde9cbf5a7f1401a9389c84ba98bdcf6',
        u 'region': u 'RegionOne',
        u 'internalURL': u 'http://10.200.43.31:8776/v2/cde9cbf5a7f1401a9389c84ba98bdcf6',
        u 'type': u 'volumev2',
        u 'id': u '5b0c3c534e864486a3ac55d76d8a6125',
        u 'publicURL': u 'http://10.200.43.31:8776/v2/cde9cbf5a7f1401a9389c84ba98bdcf6'
    }, {
        u 'name': u 'novav3',
        u 'adminURL': u 'http://127.0.0.1:8774/v3',
        u 'region': u 'RegionOne',
        u 'internalURL': u 'http://127.0.0.1:8774/v3',
        u 'type': u 'computev3',
        u 'id': u '136e37c8d7da48a283b16c648f63897a',
        u 'publicURL': u 'http://127.0.0.1:8774/v3'
}, 
...

results matching ""

    No results matching ""