9. APIs code

9.1. Command Specifications

9.1.1. astakos

Features: user, project, quota, resource, commission, endpoint, service

class kamaki.cli.cmds.astakos.PolicyArgument(help='', parsed_name=None, default=None)[source]

A Policy argument

policies = ('auto', 'moderated', 'closed')
value[source]
class kamaki.cli.cmds.astakos.ProjectResourceArgument(help='', parsed_name=None, default=None)[source]

“A <resource>=<member_capacity>,<project_capacity> argument e.g., –resource cyclades.cpu=5,1

value[source]
kamaki.cli.cmds.astakos.apply_notification(func)[source]
class kamaki.cli.cmds.astakos.commission_accept(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Accept a pending commission (special privileges required)

description = 'Accept a pending commission (special privileges required)'
long_description = ''
main(commission_id)[source]
syntax = '<commission id> '
class kamaki.cli.cmds.astakos.commission_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get commission info (special privileges required)

description = 'Get commission info (special privileges required)'
long_description = ''
main(commission_id)[source]
syntax = '<commission id> '
class kamaki.cli.cmds.astakos.commission_issue(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Issue commissions as a json string (special privileges required)

arguments = {'source': <kamaki.cli.argument.ValueArgument object at 0x260ae50>, 'force': <kamaki.cli.argument.FlagArgument object at 0x260af50>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x260ad50>, 'file_path': <kamaki.cli.argument.ValueArgument object at 0x260ae90>, 'accept': <kamaki.cli.argument.FlagArgument object at 0x260af90>, 'description': <kamaki.cli.argument.ValueArgument object at 0x260aed0>}
description = 'Issue commissions as a json string (special privileges required)'
long_description = ''
main()[source]
required = ('uuid', 'source', 'file_path')
syntax = ' '
class kamaki.cli.cmds.astakos.commission_pending(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List pending commissions (special privileges required)

description = 'List pending commissions (special privileges required)'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.commission_reject(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Reject a pending commission (special privileges required)

description = 'Reject a pending commission (special privileges required)'
long_description = ''
main(commission_id)[source]
syntax = '<commission id> '
class kamaki.cli.cmds.astakos.commission_resolve(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Resolve multiple commissions (special privileges required)

arguments = {'accept': <kamaki.cli.argument.CommaSeparatedListArgument object at 0x260abd0>, 'reject': <kamaki.cli.argument.CommaSeparatedListArgument object at 0x260acd0>}
description = 'Resolve multiple commissions (special privileges required)'
long_description = ''
main()[source]
required = ['accept', 'reject']
syntax = ' '
class kamaki.cli.cmds.astakos.endpoint_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get endpoints service endpoints

arguments = {'endpoint_type': <kamaki.cli.argument.ValueArgument object at 0x260e150>}
description = 'Get endpoints service endpoints'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.membership(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Project membership management commands

description = 'Project membership management commands'
long_description = ''
syntax = ' '
class kamaki.cli.cmds.astakos.membership_accept(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Accept a membership for a project you manage

action = 'accept'
description = 'Accept a membership for a project you manage'
long_description = ''
syntax = '<membership id> '
class kamaki.cli.cmds.astakos.membership_cancel(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Cancel your (probably pending) membership to a project

action = 'cancel'
description = 'Cancel your (probably pending) membership to a project'
long_description = ''
syntax = '<membership id> '
class kamaki.cli.cmds.astakos.membership_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Details on a membership

description = 'Details on a membership'
long_description = ''
main(membership_id)[source]
syntax = '<membership id> '
class kamaki.cli.cmds.astakos.membership_leave(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Leave a project you have membership to

action = 'leave'
description = 'Leave a project you have membership to'
long_description = ''
syntax = '<membership id> '
class kamaki.cli.cmds.astakos.membership_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List all memberships

arguments = {'project_id': <kamaki.cli.argument.ValueArgument object at 0x26128d0>}
description = 'List all memberships'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.membership_reject(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Reject a membership for a project you manage

action = 'reject'
description = 'Reject a membership for a project you manage'
long_description = ''
syntax = '<membership id> '
class kamaki.cli.cmds.astakos.membership_remove(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Remove a membership for a project you manage

action = 'remove'
description = 'Remove a membership for a project you manage'
long_description = ''
syntax = '<membership id> '
class kamaki.cli.cmds.astakos.project_approve(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Approve an application (special privileges needed)

action = 'approve'
description = 'Approve an application (special privileges needed)'
long_description = ''
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_cancel(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Cancel your application

action = 'cancel'
description = 'Cancel your application'
long_description = ''
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_create(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Apply for a new project { “name”: name, “owner”: uuid, # if omitted, request user assumed “homepage”: homepage, # optional “description”: description, # optional “comments”: comments, # optional “max_members”: max_members, # optional “private”: true | false, # optional “start_date”: date, # optional “end_date”: date, “join_policy”: “auto” | “moderated” | “closed”, # default: “moderated” “leave_policy”: “auto” | “moderated” | “closed”, # default: “auto” “resources”: { “cyclades.vm”: {“project_capacity”: int, “member_capacity”: int }}}

arguments = {'project_name': <kamaki.cli.argument.ValueArgument object at 0x260e650>, 'end_date': <kamaki.cli.argument.DateArgument object at 0x260e890>, 'join_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x260e910>, 'resource_capacities': <kamaki.cli.cmds.astakos.ProjectResourceArgument object at 0x260e990>, 'max_members': <kamaki.cli.argument.IntArgument object at 0x260e790>, 'leave_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x260e950>, 'private': <kamaki.cli.argument.BooleanArgument object at 0x260e7d0>, 'specs_path': <kamaki.cli.argument.ValueArgument object at 0x260e550>, 'homepage_url': <kamaki.cli.argument.ValueArgument object at 0x260e6d0>, 'owner_uuid': <kamaki.cli.argument.ValueArgument object at 0x260e690>, 'start_date': <kamaki.cli.argument.DateArgument object at 0x260e810>, 'description': <kamaki.cli.argument.ValueArgument object at 0x260e710>}
description = 'Apply for a new project'
long_description = ' {\n "name": name,\n "owner": uuid, # if omitted, request user assumed\n "homepage": homepage, # optional\n "description": description, # optional\n "comments": comments, # optional\n "max_members": max_members, # optional\n "private": true | false, # optional\n "start_date": date, # optional\n "end_date": date,\n "join_policy": "auto" | "moderated" | "closed", # default: "moderated"\n "leave_policy": "auto" | "moderated" | "closed", # default: "auto"\n "resources": {\n "cyclades.vm": {"project_capacity": int, "member_capacity": int\n }}}'
main()[source]
required = ['specs_path', 'project_name', 'end_date']
syntax = ' '
class kamaki.cli.cmds.astakos.project_deny(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Deny an application (special privileges needed)

action = 'deny'
description = 'Deny an application (special privileges needed)'
long_description = ''
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_dismiss(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Dismiss your denied application

action = 'dismiss'
description = 'Dismiss your denied application'
long_description = ''
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_enroll(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Enroll a user to a project

arguments = {'email': <kamaki.cli.argument.ValueArgument object at 0x2612fd0>}
description = 'Enroll a user to a project'
long_description = ''
main(project_id)[source]
required = ('email',)
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get details for a project

description = 'Get details for a project'
long_description = ''
main(project_id)[source]
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_join(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Join a project

description = 'Join a project'
long_description = ''
main(project_id)[source]
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List all projects

arguments = {'owner': <kamaki.cli.argument.ValueArgument object at 0x260e3d0>, 'state': <kamaki.cli.argument.ValueArgument object at 0x260e390>, 'name': <kamaki.cli.argument.ValueArgument object at 0x260e350>, 'details': <kamaki.cli.argument.FlagArgument object at 0x260e290>}
description = 'List all projects'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.project_modify(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Modify properties of a project { “name”: name, “owner”: uuid, # if omitted, request user assumed “homepage”: homepage, # optional “description”: description, # optional “comments”: comments, # optional “max_members”: max_members, # optional “private”: true | false, # optional “start_date”: date, # optional “end_date”: date, “join_policy”: “auto” | “moderated” | “closed”, # default: “moderated” “leave_policy”: “auto” | “moderated” | “closed”, # default: “auto” “resources”: { “cyclades.vm”: {“project_capacity”: int, “member_capacity”: int }}}

arguments = {'project_name': <kamaki.cli.argument.ValueArgument object at 0x260ebd0>, 'end_date': <kamaki.cli.argument.DateArgument object at 0x260eed0>, 'join_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x260ef50>, 'resource_capacities': <kamaki.cli.cmds.astakos.ProjectResourceArgument object at 0x260efd0>, 'max_members': <kamaki.cli.argument.IntArgument object at 0x260ed10>, 'leave_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x260ef90>, 'private': <kamaki.cli.argument.FlagArgument object at 0x260ed50>, 'public': <kamaki.cli.argument.FlagArgument object at 0x260edd0>, 'specs_path': <kamaki.cli.argument.ValueArgument object at 0x260eb10>, 'homepage_url': <kamaki.cli.argument.ValueArgument object at 0x260ec50>, 'owner_uuid': <kamaki.cli.argument.ValueArgument object at 0x260ec10>, 'start_date': <kamaki.cli.argument.DateArgument object at 0x260ee50>, 'description': <kamaki.cli.argument.ValueArgument object at 0x260ec90>}
description = 'Modify properties of a project'
long_description = ' {\n "name": name,\n "owner": uuid, # if omitted, request user assumed\n "homepage": homepage, # optional\n "description": description, # optional\n "comments": comments, # optional\n "max_members": max_members, # optional\n "private": true | false, # optional\n "start_date": date, # optional\n "end_date": date,\n "join_policy": "auto" | "moderated" | "closed", # default: "moderated"\n "leave_policy": "auto" | "moderated" | "closed", # default: "auto"\n "resources": {\n "cyclades.vm": {"project_capacity": int, "member_capacity": int\n }}}'
main(project_id)[source]
required = ['specs_path', 'owner_uuid', 'homepage_url', 'description', 'public', 'private', 'project_name', 'start_date', 'end_date', 'join_policy', 'leave_policy', 'resource_capacities', 'max_members']
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_reinstate(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Reinstate a terminated project (special privileges needed)

action = 'reinstate'
description = 'Reinstate a terminated project (special privileges needed)'
long_description = ''
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_suspend(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Suspend a project (special privileges needed)

action = 'suspend'
description = 'Suspend a project (special privileges needed)'
long_description = ''
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_terminate(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Terminate a project (special privileges needed)

action = 'terminate'
description = 'Terminate a project (special privileges needed)'
long_description = ''
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_unsuspend(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Resume a suspended project (special privileges needed)

action = 'unsuspend'
description = 'Resume a suspended project (special privileges needed)'
long_description = ''
syntax = '<project id> '
class kamaki.cli.cmds.astakos.quota_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Show user quotas

arguments = {'bytes': <kamaki.cli.argument.FlagArgument object at 0x245e590>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x245e550>, 'resource': <kamaki.cli.argument.ValueArgument object at 0x245e510>}
description = 'Show user quotas'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.resource_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List user resources

description = 'List user resources'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.service_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List available services

description = 'List available services'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.service_quotas(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get service quotas

arguments = {'uuid': <kamaki.cli.argument.ValueArgument object at 0x260a710>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x260a590>}
description = 'Get service quotas'
long_description = ''
main()[source]
required = 'service_token'
syntax = ' '
class kamaki.cli.cmds.astakos.service_username2uuid(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get service uuid(s) from username(s)

arguments = {'username': <kamaki.cli.argument.RepeatableArgument object at 0x260a4d0>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x260a350>}
description = 'Get service uuid(s) from username(s)'
long_description = ''
main()[source]
required = ('service_token', 'username')
syntax = ' '
class kamaki.cli.cmds.astakos.service_uuid2username(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get service username(s) from uuid(s)

arguments = {'uuid': <kamaki.cli.argument.RepeatableArgument object at 0x260a290>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x260a190>}
description = 'Get service username(s) from uuid(s)'
long_description = ''
main()[source]
required = ('service_token', 'uuid')
syntax = ' '
class kamaki.cli.cmds.astakos.user_add(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Authenticate a user by token and add to session user list (cache)

arguments = {'token': <kamaki.cli.argument.ValueArgument object at 0x245ebd0>}
description = 'Authenticate a user by token and add to session user list (cache)'
long_description = ''
main()[source]
required = ('token',)
syntax = ' '
class kamaki.cli.cmds.astakos.user_authenticate(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Authenticate a user and get all authentication information

description = 'Authenticate a user and get all authentication information'
long_description = ''
main(token=None)[source]
syntax = ' [token]'
class kamaki.cli.cmds.astakos.user_delete(arguments={}, astakos=None, cloud=None)[source]

Delete a user (token) from the list of session users

description = 'Delete a user (token) from the list of session users'
long_description = ''
main()[source]
required = ('uuid_or_username',)
syntax = ' '
class kamaki.cli.cmds.astakos.user_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get info for (current) session user

arguments = {'name': <kamaki.cli.argument.ValueArgument object at 0x245eb90>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x245e990>}
description = 'Get info for (current) session user'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.user_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List (cached) session users

arguments = {'detail': <kamaki.cli.argument.FlagArgument object at 0x245ed10>}
description = 'List (cached) session users'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.user_name2uuid(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get user uuid(s) from name(s)

description = 'Get user uuid(s) from name(s)'
long_description = ''
main(username, *more_usernames)[source]
syntax = '<username> <more_usernames ...>'
class kamaki.cli.cmds.astakos.user_select(arguments={}, astakos=None, cloud=None)[source]

Select a user from the (cached) list as the current session user

description = 'Select a user from the (cached) list as the current session user'
long_description = ''
main()[source]
required = ('uuid_or_username',)
syntax = ' '
class kamaki.cli.cmds.astakos.user_uuid2name(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get user name(s) from uuid(s)

description = 'Get user name(s) from uuid(s)'
long_description = ''
main(uuid, *more_uuids)[source]
syntax = '<uuid> <more_uuids ...>'
kamaki.cli.cmds.astakos.with_temp_token(func)[source]

Set token to self.client.token, run func, recover old token

9.1.2. cyclades

Features server, flavor

class kamaki.cli.cmds.cyclades.ConsoleTypeArgument(help='', parsed_name=None, default=None)[source]
TRANSLATE = {'no-vnc-encrypted': 'vnc-wss', 'no-vnc': 'vnc-ws'}
value[source]
class kamaki.cli.cmds.cyclades.FirewallProfileArgument(help='', parsed_name=None, default=None)[source]
profiles = ('DISABLED', 'ENABLED', 'PROTECTED')
value[source]
class kamaki.cli.cmds.cyclades.NetworkArgument(help='', parsed_name=None, default=None)[source]

[id=]NETWORK_ID[,[ip=]IP]

value[source]
class kamaki.cli.cmds.cyclades.PersonalityArgument(help='', parsed_name=None, default=None)[source]
terms = (('local-path', 'contents'), ('server-path', 'path'), ('owner', 'owner'), ('group', 'group'), ('mode', 'mode'))
value[source]
class kamaki.cli.cmds.cyclades.flavor_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Detailed information on a hardware flavor

description = 'Detailed information on a hardware flavor'
long_description = ''
main(flavor_id)[source]
syntax = '<flavor id> '
class kamaki.cli.cmds.cyclades.flavor_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List available hardware flavors

arguments = {'ram': <kamaki.cli.argument.ValueArgument object at 0x278c490>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x278c450>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x278c250>, 'vcpus': <kamaki.cli.argument.ValueArgument object at 0x278c4d0>, 'limit': <kamaki.cli.argument.IntArgument object at 0x278c390>, 'disk_template': <kamaki.cli.argument.ValueArgument object at 0x278c5d0>, 'disk': <kamaki.cli.argument.ValueArgument object at 0x278c550>, 'more': <kamaki.cli.argument.FlagArgument object at 0x278c410>}
description = 'List available hardware flavors'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.cyclades.server_console(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Create a VNC console and show connection information

arguments = {'console_type': <kamaki.cli.cmds.cyclades.ConsoleTypeArgument object at 0x277bf10>}
description = 'Create a VNC console and show connection information'
long_description = ''
main(server_id)[source]
syntax = '<server id> '
class kamaki.cli.cmds.cyclades.server_create(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Create a server (aka Virtual Machine)

arguments = {'project_id': <kamaki.cli.argument.ValueArgument object at 0x3342050>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x3322c90>, 'network_configuration': <kamaki.cli.cmds.cyclades.NetworkArgument object at 0x232dcd0>, 'server_name': <kamaki.cli.argument.ValueArgument object at 0x30d6a50>, 'metadata': <kamaki.cli.argument.KeyValueArgument object at 0x3342f90>, 'image_id': <kamaki.cli.argument.ValueArgument object at 0x3316710>, 'flavor_id': <kamaki.cli.argument.IntArgument object at 0x3316990>, 'cluster_size': <kamaki.cli.argument.IntArgument object at 0x333a910>, 'no_network': <kamaki.cli.argument.FlagArgument object at 0x232dd10>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x333a350>, 'personality': <kamaki.cli.cmds.cyclades.PersonalityArgument object at 0x330ad50>}
description = 'Create a server (aka Virtual Machine)'
long_description = ''
main()[source]
required = ('server_name', 'flavor_id', 'image_id')
syntax = ' '
class kamaki.cli.cmds.cyclades.server_delete(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Delete a virtual server

arguments = {'cluster': <kamaki.cli.argument.FlagArgument object at 0x277b9d0>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x303b810>}
description = 'Delete a virtual server'
long_description = ''
main(server_id_or_cluster_prefix)[source]
syntax = '<server id or cluster prefix> '
class kamaki.cli.cmds.cyclades.server_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Detailed information on a Virtual Machine

arguments = {'nics': <kamaki.cli.argument.FlagArgument object at 0x26e99d0>, 'stats': <kamaki.cli.argument.FlagArgument object at 0x26e9290>, 'diagnostics': <kamaki.cli.argument.FlagArgument object at 0x26e9710>}
description = 'Detailed information on a Virtual Machine'
long_description = ''
main(server_id)[source]
syntax = '<server id> '
class kamaki.cli.cmds.cyclades.server_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List virtual servers accessible by user Use filtering arguments (e.g., –name-like) to manage long server lists

arguments = {'status': <kamaki.cli.argument.ValueArgument object at 0x2994250>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x2994190>, 'user_id': <kamaki.cli.argument.ValueArgument object at 0x2994150>, 'since': <kamaki.cli.argument.DateArgument object at 0x29944d0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x2994910>, 'image_id': <kamaki.cli.argument.ValueArgument object at 0x2994290>, 'meta': <kamaki.cli.argument.KeyValueArgument object at 0x29941d0>, 'limit': <kamaki.cli.argument.IntArgument object at 0x2994090>, 'flavor_id': <kamaki.cli.argument.ValueArgument object at 0x2994310>, 'user_name': <kamaki.cli.argument.ValueArgument object at 0x2994110>, 'meta_like': <kamaki.cli.argument.KeyValueArgument object at 0x2994050>, 'more': <kamaki.cli.argument.FlagArgument object at 0x2994210>}
description = 'List virtual servers accessible by user'
long_description = ' Use filtering arguments (e.g., --name-like) to manage long server lists\n '
main()[source]
syntax = ' '
class kamaki.cli.cmds.cyclades.server_modify(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Modify attributes of a virtual server

arguments = {'firewall_profile': <kamaki.cli.cmds.cyclades.FirewallProfileArgument object at 0x303eb90>, 'public_network_port_id': <kamaki.cli.argument.ValueArgument object at 0x303e8d0>, 'flavor_id': <kamaki.cli.argument.IntArgument object at 0x3342990>, 'server_name': <kamaki.cli.argument.ValueArgument object at 0x3342810>, 'metadata_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x303eb10>, 'metadata_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x303ec10>}
description = 'Modify attributes of a virtual server'
long_description = ''
main(server_id)[source]
required = ['server_name', 'flavor_id', 'firewall_profile', 'metadata_to_set', 'metadata_to_delete']
syntax = '<server id> '
class kamaki.cli.cmds.cyclades.server_reassign(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Assign a virtual server to a different project

arguments = {'project_id': <kamaki.cli.argument.ValueArgument object at 0x303b690>}
description = 'Assign a virtual server to a different project'
long_description = ''
main(server_id)[source]
required = ('project_id',)
syntax = '<server id> '
class kamaki.cli.cmds.cyclades.server_reboot(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Reboot a virtual server

arguments = {'type': <kamaki.cli.argument.ValueArgument object at 0x277ba50>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x277bb50>}
description = 'Reboot a virtual server'
long_description = ''
main(server_id)[source]
syntax = '<server id> '
class kamaki.cli.cmds.cyclades.server_shutdown(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Shutdown an active virtual server

arguments = {'wait': <kamaki.cli.argument.FlagArgument object at 0x277bd90>}
description = 'Shutdown an active virtual server'
long_description = ''
main(server_id)[source]
syntax = '<server id> '
class kamaki.cli.cmds.cyclades.server_start(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Start an existing virtual server

arguments = {'wait': <kamaki.cli.argument.FlagArgument object at 0x277bc10>}
description = 'Start an existing virtual server'
long_description = ''
main(server_id)[source]
syntax = '<server id> '
class kamaki.cli.cmds.cyclades.server_wait(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Wait for server to change its status (default: BUILD)

arguments = {'timeout': <kamaki.cli.argument.IntArgument object at 0x278c0d0>, 'server_status': <kamaki.cli.argument.StatusArgument object at 0x278c1d0>}
description = 'Wait for server to change its status (default: BUILD)'
long_description = ''
main(server_id)[source]
syntax = '<server id> '

9.1.3. pithos

Features file, container, sharer, group

class kamaki.cli.cmds.pithos.RangeArgument(help='', parsed_name=None, default=None)[source]
Value type:string of the form <start>-<end> where <start> and <end> are integers
Value returns:the input string, after type checking <start> and <end>
value[source]
class kamaki.cli.cmds.pithos.VersioningArgument(help='', parsed_name=None, default=None)[source]
schemes = ('auto', 'none')
value[source]
class kamaki.cli.cmds.pithos.container_create(arguments={}, astakos=None, cloud=None)[source]

Create a new container

arguments = {'meta': <kamaki.cli.argument.KeyValueArgument object at 0x3886850>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x3886890>, 'limit': <kamaki.cli.argument.IntArgument object at 0x38867d0>, 'versioning': <kamaki.cli.argument.ValueArgument object at 0x38866d0>}
description = 'Create a new container'
long_description = ''
main(new_container)[source]
syntax = '<new container> '
class kamaki.cli.cmds.pithos.container_delete(arguments={}, astakos=None, cloud=None)[source]

Delete a container

arguments = {'yes': <kamaki.cli.argument.FlagArgument object at 0x3886950>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x3886a50>}
description = 'Delete a container'
long_description = ''
main(container)[source]
syntax = '<container> '
class kamaki.cli.cmds.pithos.container_empty(arguments={}, astakos=None, cloud=None)[source]

Empty a container

arguments = {'yes': <kamaki.cli.argument.FlagArgument object at 0x3886ad0>}
description = 'Empty a container'
long_description = ''
main(container)[source]
syntax = '<container> '
class kamaki.cli.cmds.pithos.container_info(arguments={}, astakos=None, cloud=None)[source]

Get information about a container

arguments = {'sizelimit': <kamaki.cli.argument.FlagArgument object at 0x3880e50>, 'in_bytes': <kamaki.cli.argument.FlagArgument object at 0x3880e90>, 'until_date': <kamaki.cli.argument.DateArgument object at 0x3880d10>, 'metadata': <kamaki.cli.argument.FlagArgument object at 0x3880e10>}
description = 'Get information about a container'
long_description = ''
main(container)[source]
syntax = '<container> '
class kamaki.cli.cmds.pithos.container_list(arguments={}, astakos=None, cloud=None)[source]

List all containers, or their contents

arguments = {'recursive': <kamaki.cli.argument.FlagArgument object at 0x3886590>, 'modified_since_date': <kamaki.cli.argument.ValueArgument object at 0x3886390>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x3886550>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x3886190>, 'shared_by_me': <kamaki.cli.argument.FlagArgument object at 0x38865d0>, 'limit': <kamaki.cli.argument.IntArgument object at 0x38862d0>, 'shared': <kamaki.cli.argument.FlagArgument object at 0x38864d0>, 'marker': <kamaki.cli.argument.ValueArgument object at 0x3886310>, 'until_date': <kamaki.cli.argument.DateArgument object at 0x3886450>, 'unmodified_since_date': <kamaki.cli.argument.ValueArgument object at 0x38863d0>, 'public': <kamaki.cli.argument.FlagArgument object at 0x3886610>, 'more': <kamaki.cli.argument.FlagArgument object at 0x3886510>}
description = 'List all containers, or their contents'
long_description = ''
main(container=None)[source]
print_containers(container_list)[source]
syntax = ' [container]'
class kamaki.cli.cmds.pithos.container_modify(arguments={}, astakos=None, cloud=None)[source]

Modify the properties of a container

arguments = {'sizelimit': <kamaki.cli.argument.DataSizeArgument object at 0x38860d0>, 'metadata_to_add': <kamaki.cli.argument.KeyValueArgument object at 0x3880f90>, 'versioning': <kamaki.cli.cmds.pithos.VersioningArgument object at 0x3886110>, 'metadata_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x3886090>}
description = 'Modify the properties of a container'
long_description = ''
main(container)[source]
required = ['metadata_to_add', 'metadata_to_delete', 'sizelimit', 'versioning']
syntax = '<container> '
class kamaki.cli.cmds.pithos.container_reassign(arguments={}, astakos=None, cloud=None)[source]

Assign a container to a different project

arguments = {'project_id': <kamaki.cli.argument.ValueArgument object at 0x3886c10>}
description = 'Assign a container to a different project'
long_description = ''
main(container)[source]
required = ('project_id',)
syntax = '<container> '
class kamaki.cli.cmds.pithos.file_append(arguments={}, astakos=None, cloud=None)[source]

Append local file to (existing) remote object The remote object should exist. If the remote object is a directory, it is transformed into a file. In the later case, objects under the directory remain intact.

arguments = {'max_threads': <kamaki.cli.argument.IntArgument object at 0x387e710>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x387e7d0>}
description = 'Append local file to (existing) remote object'
long_description = ' The remote object should exist.\n If the remote object is a directory, it is transformed into a file.\n In the later case, objects under the directory remain intact.\n '
main(local_path, remote_path_or_url)[source]
syntax = '<local path> <remote path or url> '
class kamaki.cli.cmds.pithos.file_cat(arguments={}, astakos=None, cloud=None)[source]

Fetch remote file contents

arguments = {'object_version': <kamaki.cli.argument.ValueArgument object at 0x3880650>, 'if_none_match': <kamaki.cli.argument.ValueArgument object at 0x3880510>, 'if_modified_since': <kamaki.cli.argument.DateArgument object at 0x3880590>, 'if_match': <kamaki.cli.argument.ValueArgument object at 0x3880390>, 'if_unmodified_since': <kamaki.cli.argument.DateArgument object at 0x38805d0>, 'range': <kamaki.cli.cmds.pithos.RangeArgument object at 0x38803d0>}
description = 'Fetch remote file contents'
long_description = ''
main(path_or_url)[source]
syntax = '<path or url> '
class kamaki.cli.cmds.pithos.file_copy(arguments={}, astakos=None, cloud=None)[source]

Copy objects, even between different accounts or containers

arguments = {'source_version': <kamaki.cli.argument.ValueArgument object at 0x387e350>, 'public': <kamaki.cli.argument.ValueArgument object at 0x387e290>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x387e310>}
description = 'Copy objects, even between different accounts or containers'
long_description = ''
main(source_path_or_url, destination_path_or_url=None)[source]
syntax = '<source path or url> [destination path or url]'
class kamaki.cli.cmds.pithos.file_create(arguments={}, astakos=None, cloud=None)[source]

Create an empty object

arguments = {'content_type': <kamaki.cli.argument.ValueArgument object at 0x3873a90>}
description = 'Create an empty object'
long_description = ''
main(path_or_url)[source]
syntax = '<path or url> '
class kamaki.cli.cmds.pithos.file_delete(arguments={}, astakos=None, cloud=None)[source]

Delete a file or directory object

arguments = {'until_date': <kamaki.cli.argument.DateArgument object at 0x3873cd0>, 'delimiter': <kamaki.cli.argument.ValueArgument object at 0x3873ed0>, 'yes': <kamaki.cli.argument.FlagArgument object at 0x3873e10>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x3873e50>}
description = 'Delete a file or directory object'
long_description = ''
main(path_or_url)[source]
syntax = '<path or url> '
class kamaki.cli.cmds.pithos.file_download(arguments={}, astakos=None, cloud=None)[source]

Download a remove file or directory object to local file system

arguments = {'object_version': <kamaki.cli.argument.ValueArgument object at 0x3880a10>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x3880a50>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x3880b10>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x3880a90>, 'modified_since_date': <kamaki.cli.argument.DateArgument object at 0x3880950>, 'resume': <kamaki.cli.argument.FlagArgument object at 0x3880750>, 'range': <kamaki.cli.cmds.pithos.RangeArgument object at 0x3880850>, 'non_matching_etag': <kamaki.cli.argument.ValueArgument object at 0x3880910>, 'unmodified_since_date': <kamaki.cli.argument.DateArgument object at 0x3880990>, 'matching_etag': <kamaki.cli.argument.ValueArgument object at 0x3880890>}
description = 'Download a remove file or directory object to local file system'
long_description = ''
main(remote_path_or_url, local_path=None)[source]

Dowload remote_path_or_url to local_path.

syntax = '<remote path or url> [local path]'
class kamaki.cli.cmds.pithos.file_info(arguments={}, astakos=None, cloud=None)[source]

Get information/details about a file

arguments = {'object_version': <kamaki.cli.argument.ValueArgument object at 0x34f9b10>, 'sharing': <kamaki.cli.argument.FlagArgument object at 0x34f9d50>, 'hashmap': <kamaki.cli.argument.FlagArgument object at 0x34f9b90>, 'versions': <kamaki.cli.argument.FlagArgument object at 0x34f9e10>, 'modified_since_date': <kamaki.cli.argument.DateArgument object at 0x34f9c90>, 'non_matching_etag': <kamaki.cli.argument.ValueArgument object at 0x34f9c50>, 'unmodified_since_date': <kamaki.cli.argument.DateArgument object at 0x34f9cd0>, 'matching_etag': <kamaki.cli.argument.ValueArgument object at 0x34f9bd0>, 'metadata': <kamaki.cli.argument.FlagArgument object at 0x34f9d90>}
description = 'Get information/details about a file'
long_description = ''
main(path_or_url)[source]
syntax = '<path or url> '
version_print(versions)[source]
class kamaki.cli.cmds.pithos.file_list(arguments={}, astakos=None, cloud=None)[source]

List all objects in a container or a directory

arguments = {'recursive': <kamaki.cli.argument.FlagArgument object at 0x38734d0>, 'format': <kamaki.cli.argument.ValueArgument object at 0x3873350>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x3873490>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x34f9f90>, 'shared_by_me': <kamaki.cli.argument.FlagArgument object at 0x3873390>, 'public': <kamaki.cli.argument.FlagArgument object at 0x38733d0>, 'delimiter': <kamaki.cli.argument.ValueArgument object at 0x3873150>, 'meta': <kamaki.cli.argument.ValueArgument object at 0x38731d0>, 'if_modified_since': <kamaki.cli.argument.ValueArgument object at 0x3873210>, 'marker': <kamaki.cli.argument.ValueArgument object at 0x38730d0>, 'limit': <kamaki.cli.argument.IntArgument object at 0x3873090>, 'if_unmodified_since': <kamaki.cli.argument.ValueArgument object at 0x3873250>, 'until': <kamaki.cli.argument.DateArgument object at 0x38732d0>, 'more': <kamaki.cli.argument.FlagArgument object at 0x3873450>}
description = 'List all objects in a container or a directory'
long_description = ''
main(path_or_url='')[source]
syntax = ' [path or url]'
class kamaki.cli.cmds.pithos.file_mkdir(arguments={}, astakos=None, cloud=None)[source]

Create a directory object Equivalent to kamaki file create –content-type=’application/directory’

description = 'Create a directory object'
long_description = " Equivalent to\n kamaki file create --content-type='application/directory'\n "
main(path_or_url)[source]
syntax = '<path or url> '
class kamaki.cli.cmds.pithos.file_modify(arguments={}, astakos=None, cloud=None)[source]

Modify the attributes of a file or directory object

arguments = {'uuid_for_write_permission': <kamaki.cli.argument.RepeatableArgument object at 0x3873690>, 'no_permissions': <kamaki.cli.argument.FlagArgument object at 0x38736d0>, 'metadata_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x3873710>, 'metadata_key_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x3873750>, 'uuid_for_read_permission': <kamaki.cli.argument.RepeatableArgument object at 0x3873590>}
description = 'Modify the attributes of a file or directory object'
long_description = ''
main(path_or_url)[source]
required = ['uuid_for_read_permission', 'metadata_to_set', 'uuid_for_write_permission', 'no_permissions', 'metadata_key_to_delete']
syntax = '<path or url> '
class kamaki.cli.cmds.pithos.file_move(arguments={}, astakos=None, cloud=None)[source]

Move objects, even between different accounts or containers

arguments = {'public': <kamaki.cli.argument.ValueArgument object at 0x387e590>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x387e510>}
description = 'Move objects, even between different accounts or containers'
long_description = ''
main(source_path_or_url, destination_path_or_url=None)[source]
syntax = '<source path or url> [destination path or url]'
class kamaki.cli.cmds.pithos.file_overwrite(arguments={}, astakos=None, cloud=None)[source]

Overwrite part of a remote file

arguments = {'object_version': <kamaki.cli.argument.ValueArgument object at 0x387ecd0>, 'end_position': <kamaki.cli.argument.IntArgument object at 0x387ec50>, 'start_position': <kamaki.cli.argument.IntArgument object at 0x387ebd0>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x387ea90>}
description = 'Overwrite part of a remote file'
long_description = ''
main(local_path, path_or_url)[source]
required = ('start_position', 'end_position')
syntax = '<local path> <path or url> '
class kamaki.cli.cmds.pithos.file_publish(arguments={}, astakos=None, cloud=None)[source]

Publish an object (creates a public URL)

description = 'Publish an object (creates a public URL)'
long_description = ''
main(path_or_url)[source]
syntax = '<path or url> '
class kamaki.cli.cmds.pithos.file_truncate(arguments={}, astakos=None, cloud=None)[source]

Truncate remote file up to size

arguments = {'size_in_bytes': <kamaki.cli.argument.IntArgument object at 0x387e950>}
description = 'Truncate remote file up to size'
long_description = ''
main(path_or_url)[source]
required = ('size_in_bytes',)
syntax = '<path or url> '
class kamaki.cli.cmds.pithos.file_unpublish(arguments={}, astakos=None, cloud=None)[source]

Unpublish an object

description = 'Unpublish an object'
long_description = ''
main(path_or_url)[source]
syntax = '<path or url> '
class kamaki.cli.cmds.pithos.file_upload(arguments={}, astakos=None, cloud=None)[source]

Upload a file

The default destination is /pithos/NAME where NAME is the base name of the source path

arguments = {'unchunked': <kamaki.cli.argument.FlagArgument object at 0x3880290>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x387edd0>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x3880250>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x3880190>, 'uuid_for_write_permission': <kamaki.cli.argument.RepeatableArgument object at 0x3880110>, 'md5_checksum': <kamaki.cli.argument.ValueArgument object at 0x38802d0>, 'uuid_for_read_permission': <kamaki.cli.argument.RepeatableArgument object at 0x38800d0>, 'content_encoding': <kamaki.cli.argument.ValueArgument object at 0x387ee50>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x3880050>, 'use_hashes': <kamaki.cli.argument.FlagArgument object at 0x3880310>, 'content_disposition': <kamaki.cli.argument.ValueArgument object at 0x387ef90>, 'public': <kamaki.cli.argument.FlagArgument object at 0x3880150>, 'overwrite': <kamaki.cli.argument.FlagArgument object at 0x3880210>}
description = 'Upload a file'
long_description = '\n The default destination is /pithos/NAME\n where NAME is the base name of the source path'
main(local_path, remote_path_or_url=None)[source]
syntax = '<local path> [remote path or url]'
class kamaki.cli.cmds.pithos.group_create(arguments={}, astakos=None, cloud=None)[source]

Create a group of users

arguments = {'username': <kamaki.cli.argument.RepeatableArgument object at 0x3891390>, 'user_uuid': <kamaki.cli.argument.RepeatableArgument object at 0x3891290>}
description = 'Create a group of users'
long_description = ''
main(groupname)[source]
required = ['user_uuid', 'username']
syntax = '<groupname> '
class kamaki.cli.cmds.pithos.group_delete(arguments={}, astakos=None, cloud=None)[source]

Delete a user group

description = 'Delete a user group'
long_description = ''
main(groupname)[source]
syntax = '<groupname> '
class kamaki.cli.cmds.pithos.group_list(arguments={}, astakos=None, cloud=None)[source]

list all groups and group members

description = 'list all groups and group members'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.pithos.sharer_info(arguments={}, astakos=None, cloud=None)[source]

Details on a Pithos+ sharer account (default: current account)

description = 'Details on a Pithos+ sharer account (default: current account)'
long_description = ''
main(account_uuid_or_name=None)[source]
syntax = ' [account uuid or name]'
class kamaki.cli.cmds.pithos.sharer_list(arguments={}, astakos=None, cloud=None)[source]

List accounts who share file objects with current user

arguments = {'marker': <kamaki.cli.argument.ValueArgument object at 0x3886ed0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x3886d90>}
description = 'List accounts who share file objects with current user'
long_description = ''
main()[source]
syntax = ' '

9.1.4. image

Features (image, imagecompute)

class kamaki.cli.cmds.image.PithosLocationArgument(help=None, parsed_name=None, default=None, user_uuid=None)[source]

Resolve pithos URI, return in the form pithos://uuid/container[/path]

UPDATE: URLs without a path are also resolvable. Therefore, caller methods should check if there is a path or not

setdefault(term, value)[source]
value[source]
class kamaki.cli.cmds.image.image_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get image metadata

description = 'Get image metadata'
long_description = ''
main(image_id)[source]
syntax = '<image id> '
class kamaki.cli.cmds.image.image_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List images accessible by user

arguments = {'status': <kamaki.cli.argument.ValueArgument object at 0x4aef890>, 'image_ID_for_members': <kamaki.cli.argument.ValueArgument object at 0x4aefb10>, 'owner_name': <kamaki.cli.argument.ValueArgument object at 0x4aef910>, 'prop_like': <kamaki.cli.argument.KeyValueArgument object at 0x4aefad0>, 'size_max': <kamaki.cli.argument.IntArgument object at 0x4aef810>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x4aefa50>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x4aef710>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x4aef5d0>, 'prop': <kamaki.cli.argument.KeyValueArgument object at 0x4aefa90>, 'size_min': <kamaki.cli.argument.IntArgument object at 0x4aef790>, 'limit': <kamaki.cli.argument.IntArgument object at 0x4aef9d0>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x4aef690>, 'owner': <kamaki.cli.argument.ValueArgument object at 0x4aef8d0>, 'order': <kamaki.cli.argument.ValueArgument object at 0x4aef990>, 'more': <kamaki.cli.argument.FlagArgument object at 0x4aefa10>}
description = 'List images accessible by user'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.image.image_modify(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Add / update metadata and properties for an image Preserves values not explicitly modified

arguments = {'status': <kamaki.cli.argument.ValueArgument object at 0x4aefed0>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x4aefe50>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x4aefe10>, 'image_name': <kamaki.cli.argument.ValueArgument object at 0x4aefc90>, 'publish': <kamaki.cli.argument.FlagArgument object at 0x4aeff10>, 'unpublish': <kamaki.cli.argument.FlagArgument object at 0x4aeff90>, 'property_to_del': <kamaki.cli.argument.RepeatableArgument object at 0x49a4090>, 'member_ID_to_remove': <kamaki.cli.argument.RepeatableArgument object at 0x49a4110>, 'property_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x49a4050>, 'member_ID_to_add': <kamaki.cli.argument.RepeatableArgument object at 0x49a40d0>}
description = 'Add / update metadata and properties for an image'
long_description = ' Preserves values not explicitly modified\n '
main(image_id)[source]
required = ['image_name', 'disk_format', 'container_format', 'status', 'publish', 'unpublish', 'property_to_set', 'member_ID_to_add', 'member_ID_to_remove', 'property_to_del']
syntax = '<image id> '
class kamaki.cli.cmds.image.image_register(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

(Re)Register an image file to an Image service The image file must be stored at a pithos repository Some metadata can be set by user (e.g., disk-format) while others are set by the system (e.g., image id). Custom user metadata are termed as “properties”. A register command creates a remote meta file at /CONTAINER/IMAGE_PATH.meta Users may download and edit this file and use it to re-register. In case of a meta file, runtime arguments for metadata or properties override meta file settings.

arguments = {'owner_name': <kamaki.cli.argument.ValueArgument object at 0x49a4390>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x49a42d0>, 'no_metafile_upload': <kamaki.cli.argument.FlagArgument object at 0x49a45d0>, 'is_public': <kamaki.cli.argument.FlagArgument object at 0x49a4450>, 'force_upload': <kamaki.cli.argument.FlagArgument object at 0x49a4590>, 'properties': <kamaki.cli.argument.KeyValueArgument object at 0x49a4410>, 'size': <kamaki.cli.argument.IntArgument object at 0x49a44d0>, 'container': <kamaki.cli.argument.ValueArgument object at 0x49a4650>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x49a4690>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x49a4710>, 'metafile': <kamaki.cli.argument.ValueArgument object at 0x49a4550>, 'local_image_path': <kamaki.cli.argument.ValueArgument object at 0x49a46d0>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x49a4350>, 'name': <kamaki.cli.argument.ValueArgument object at 0x49a4790>, 'pithos_location': <kamaki.cli.cmds.image.PithosLocationArgument object at 0x49a4810>, 'checksum': <kamaki.cli.argument.ValueArgument object at 0x49a41d0>}
container_info_cache = {}
description = '(Re)Register an image file to an Image service'
long_description = ' The image file must be stored at a pithos repository\n Some metadata can be set by user (e.g., disk-format) while others are set\n by the system (e.g., image id).\n Custom user metadata are termed as "properties".\n A register command creates a remote meta file at\n /CONTAINER/IMAGE_PATH.meta\n Users may download and edit this file and use it to re-register.\n In case of a meta file, runtime arguments for metadata or properties\n override meta file settings.\n '
main()[source]
required = ('name', 'pithos_location')
syntax = ' '
class kamaki.cli.cmds.image.image_unregister(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Unregister an image (does not delete the image file)

description = 'Unregister an image (does not delete the image file)'
long_description = ''
main(image_id)[source]
syntax = '<image id> '
class kamaki.cli.cmds.image.imagecompute_delete(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Delete an image (WARNING: image file is also removed)

description = 'Delete an image (WARNING: image file is also removed)'
long_description = ''
main(image_id)[source]
syntax = '<image id> '
class kamaki.cli.cmds.image.imagecompute_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get detailed information on an image

description = 'Get detailed information on an image'
long_description = ''
main(image_id)[source]
syntax = '<image id> '
class kamaki.cli.cmds.image.imagecompute_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List images

arguments = {'user_id': <kamaki.cli.argument.ValueArgument object at 0x49a4c10>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x49a4bd0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x49a49d0>, 'meta': <kamaki.cli.argument.KeyValueArgument object at 0x49a4c90>, 'limit': <kamaki.cli.argument.IntArgument object at 0x49a4b10>, 'user_name': <kamaki.cli.argument.ValueArgument object at 0x49a4c50>, 'meta_like': <kamaki.cli.argument.KeyValueArgument object at 0x49a4cd0>, 'more': <kamaki.cli.argument.FlagArgument object at 0x49a4b90>}
description = 'List images'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.image.imagecompute_modify(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Modify image properties (metadata)

arguments = {'property_to_del': <kamaki.cli.argument.RepeatableArgument object at 0x49a80d0>, 'property_to_add': <kamaki.cli.argument.KeyValueArgument object at 0x49a4f90>}
description = 'Modify image properties (metadata)'
long_description = ''
main(image_id)[source]
required = ['property_to_add', 'property_to_del']
syntax = '<image id> '
kamaki.cli.cmds.image.load_image_meta(filepath)[source]
Parameters:

filepath – (str) the (relative) path of the metafile

Returns:

(dict) json_formated

Raises:
  • TypeError, AttributeError – Invalid json format
  • AssertionError – Valid json but invalid image properties dict

9.1.5. network

Features network, port, subnet, ip

class kamaki.cli.cmds.network.AllocationPoolArgument(help='', parsed_name=None, default=None)[source]
value[source]
class kamaki.cli.cmds.network.NetworkTypeArgument(help='', parsed_name=None, default=None)[source]
types = ('MAC_FILTERED', 'CUSTOM', 'IP_LESS_ROUTED', 'PHYSICAL_VLAN')
value[source]
class kamaki.cli.cmds.network.ip_attach(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Attach an IP on a virtual server

arguments = {'subnet_id': <kamaki.cli.argument.ValueArgument object at 0x39b3e50>, 'server_id': <kamaki.cli.argument.ValueArgument object at 0x39b3f10>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x39b3e90>, 'name': <kamaki.cli.argument.ValueArgument object at 0x39b3d10>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x39b3e10>}
description = 'Attach an IP on a virtual server'
long_description = ''
main(ip_or_ip_id)[source]
required = ('server_id',)
syntax = '<ip or ip id> '
class kamaki.cli.cmds.network.ip_create(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Reserve an IP on a network

arguments = {'network_id': <kamaki.cli.argument.ValueArgument object at 0x39b3810>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x39b3a10>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x39b3990>}
description = 'Reserve an IP on a network'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.network.ip_delete(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Unreserve an IP (also delete the port, if attached)

description = 'Unreserve an IP (also delete the port, if attached)'
long_description = ''
main(ip_id)[source]
syntax = '<ip id> '
class kamaki.cli.cmds.network.ip_detach(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Detach an IP from a virtual server

arguments = {'wait': <kamaki.cli.argument.FlagArgument object at 0x39b3fd0>}
description = 'Detach an IP from a virtual server'
long_description = ''
main(ip_or_ip_id)[source]
syntax = '<ip or ip id> '
class kamaki.cli.cmds.network.ip_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get details on a floating IP

description = 'Get details on a floating IP'
long_description = ''
main(ip_id)[source]
syntax = '<ip id> '
class kamaki.cli.cmds.network.ip_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List reserved floating IPs

description = 'List reserved floating IPs'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.network.ip_reassign(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Assign a floating IP to a different project

arguments = {'project_id': <kamaki.cli.argument.ValueArgument object at 0x39b3a90>}
description = 'Assign a floating IP to a different project'
long_description = ''
main(IP)[source]
required = ('project_id',)
syntax = '<IP> '
class kamaki.cli.cmds.network.network_connect(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Connect a network with a device (server or router)

arguments = {'name': <kamaki.cli.argument.ValueArgument object at 0x39b5150>, 'subnet_id': <kamaki.cli.argument.ValueArgument object at 0x39b5290>, 'device_id': <kamaki.cli.argument.RepeatableArgument object at 0x39b5390>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x39b52d0>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x39b5310>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x39b5250>}
description = 'Connect a network with a device (server or router)'
long_description = ''
main(network_id)[source]
required = ('device_id',)
syntax = '<network id> '
class kamaki.cli.cmds.network.network_create(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Create a new network (default type: MAC_FILTERED)

arguments = {'shared': <kamaki.cli.argument.FlagArgument object at 0x39add50>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x39add90>, 'network_type': <kamaki.cli.cmds.network.NetworkTypeArgument object at 0x39ade10>, 'name': <kamaki.cli.argument.ValueArgument object at 0x39adbd0>}
description = 'Create a new network (default type: MAC_FILTERED)'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.network.network_delete(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Delete a network

description = 'Delete a network'
long_description = ''
main(network_id)[source]
syntax = '<network id> '
class kamaki.cli.cmds.network.network_disconnect(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Disconnect a network from a device

arguments = {'device_id': <kamaki.cli.argument.RepeatableArgument object at 0x39b5550>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x39b5410>}
description = 'Disconnect a network from a device'
long_description = ''
main(network_id)[source]
required = ('device_id',)
syntax = '<network id> '
class kamaki.cli.cmds.network.network_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get details about a network

description = 'Get details about a network'
long_description = ''
main(network_id)[source]
syntax = '<network id> '
class kamaki.cli.cmds.network.network_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List networks Use filtering arguments (e.g., –name-like) to manage long lists

arguments = {'user_id': <kamaki.cli.argument.ValueArgument object at 0x39ada90>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x39ad990>, 'more': <kamaki.cli.argument.FlagArgument object at 0x39ada50>}
description = 'List networks'
long_description = ' Use filtering arguments (e.g., --name-like) to manage long lists\n '
main()[source]
syntax = ' '
class kamaki.cli.cmds.network.network_modify(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Modify network attributes

arguments = {'new_name': <kamaki.cli.argument.ValueArgument object at 0x4fc7b90>}
description = 'Modify network attributes'
long_description = ''
main(network_id)[source]
required = ['new_name']
syntax = '<network id> '
class kamaki.cli.cmds.network.network_reassign(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Assign a network to a different project

arguments = {'project_id': <kamaki.cli.argument.ValueArgument object at 0x39ade90>}
description = 'Assign a network to a different project'
long_description = ''
main(network_id)[source]
required = ('project_id',)
syntax = '<network id> '
class kamaki.cli.cmds.network.port_create(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Create a new port (== connect server to network)

arguments = {'subnet_id': <kamaki.cli.argument.ValueArgument object at 0x39b3350>, 'name': <kamaki.cli.argument.ValueArgument object at 0x39b31d0>, 'device_id': <kamaki.cli.argument.ValueArgument object at 0x39b3450>, 'network_id': <kamaki.cli.argument.ValueArgument object at 0x39b3410>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x39b3490>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x39b3390>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x39b3310>}
description = 'Create a new port (== connect server to network)'
long_description = ''
main()[source]
required = ('network_id', 'device_id')
syntax = ' '
class kamaki.cli.cmds.network.port_delete(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Delete a port (== disconnect server from network)

arguments = {'wait': <kamaki.cli.argument.FlagArgument object at 0x39aee90>}
description = 'Delete a port (== disconnect server from network)'
long_description = ''
main(port_id)[source]
syntax = '<port id> '
class kamaki.cli.cmds.network.port_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get details about a port

description = 'Get details about a port'
long_description = ''
main(port_id)[source]
syntax = '<port id> '
class kamaki.cli.cmds.network.port_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List all ports

arguments = {'user_id': <kamaki.cli.argument.ValueArgument object at 0x39aed10>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x39aeb50>, 'more': <kamaki.cli.argument.FlagArgument object at 0x39aec90>}
description = 'List all ports'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.network.port_modify(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Modify the attributes of a port

arguments = {'new_name': <kamaki.cli.argument.ValueArgument object at 0x39b3050>}
description = 'Modify the attributes of a port'
long_description = ''
main(port_id)[source]
required = ['new_name']
syntax = '<port id> '
class kamaki.cli.cmds.network.port_wait(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Wait for port to finish (default: BUILD)

arguments = {'port_status': <kamaki.cli.argument.StatusArgument object at 0x39b3590>, 'timeout': <kamaki.cli.argument.IntArgument object at 0x39b3690>}
description = 'Wait for port to finish (default: BUILD)'
long_description = ''
main(port_id)[source]
syntax = '<port id> '
class kamaki.cli.cmds.network.subnet_create(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Create a new subnet

arguments = {'no_gateway': <kamaki.cli.argument.FlagArgument object at 0x39ae710>, 'name': <kamaki.cli.argument.ValueArgument object at 0x39ae590>, 'enable_dhcp': <kamaki.cli.argument.FlagArgument object at 0x39ae850>, 'network_id': <kamaki.cli.argument.ValueArgument object at 0x39ae8d0>, 'subnet_id': <kamaki.cli.argument.ValueArgument object at 0x39ae790>, 'allocation_pools': <kamaki.cli.cmds.network.AllocationPoolArgument object at 0x39ae690>, 'ipv6': <kamaki.cli.argument.FlagArgument object at 0x39ae810>, 'cidr': <kamaki.cli.argument.ValueArgument object at 0x39ae910>, 'gateway': <kamaki.cli.argument.ValueArgument object at 0x39ae6d0>}
description = 'Create a new subnet'
long_description = ''
main()[source]
required = ('network_id', 'cidr')
syntax = ' '
class kamaki.cli.cmds.network.subnet_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get details about a subnet

description = 'Get details about a subnet'
long_description = ''
main(subnet_id)[source]
syntax = '<subnet id> '
class kamaki.cli.cmds.network.subnet_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List subnets Use filtering arguments (e.g., –name-like) to manage long server lists

arguments = {'detail': <kamaki.cli.argument.FlagArgument object at 0x39ae290>, 'more': <kamaki.cli.argument.FlagArgument object at 0x39ae3d0>}
description = 'List subnets'
long_description = ' Use filtering arguments (e.g., --name-like) to manage long server lists\n '
main()[source]
syntax = ' '
class kamaki.cli.cmds.network.subnet_modify(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Modify the attributes of a subnet

arguments = {'new_name': <kamaki.cli.argument.ValueArgument object at 0x39ae990>}
description = 'Modify the attributes of a subnet'
long_description = ''
main(subnet_id)[source]
required = ['new_name']
syntax = '<subnet id> '

9.1.6. Kamaki commands

9.1.6.1. config

class kamaki.cli.cmds.config.config_delete(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Delete a configuration option Default values are not removed by default. To alter this behavior in a session, use –default.

arguments = {'default': <kamaki.cli.argument.FlagArgument object at 0x42fbf50>}
description = 'Delete a configuration option'
long_description = ' Default values are not removed by default. To alter this behavior in a\n session, use --default.\n '
main(option)[source]
syntax = '<option> '
class kamaki.cli.cmds.config.config_get(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Show a configuration option About options: . syntax: [group.]option . example: global.log_file . special case: <option> is equivalent to global.<option> . configuration file syntax: . [group] . option=value . (more options can be set per group) . . special case: named clouds. . example: cloud.demo.url . E.g. for a cloud “demo”: . [cloud “demo”] . url = <http://single/authentication/url/for/demo/site> . token = <auth_token_from_demo_site>

description = 'Show a configuration option'
long_description = 'About options: \n. syntax: [group.]option \n. example: global.log_file \n. special case: <option> is equivalent to global.<option> \n. configuration file syntax: \n. [group] \n. option=value \n. (more options can be set per group) \n. \n. special case: named clouds. \n. example: cloud.demo.url \n. E.g. for a cloud "demo": \n. [cloud "demo"] \n. url = <http://single/authentication/url/for/demo/site> \n. token = <auth_token_from_demo_site>'
main(option)[source]
syntax = '<option> '
class kamaki.cli.cmds.config.config_list(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List all configuration options FAQ: Q: I haven’t set any options! A: Defaults are used (override with /config set ) Q: There are more options than I have set A: Default options remain if not explicitly replaced or deleted

description = 'List all configuration options'
long_description = " FAQ:\n Q: I haven't set any options!\n A: Defaults are used (override with /config set )\n Q: There are more options than I have set\n A: Default options remain if not explicitly replaced or deleted\n "
main()[source]
syntax = ' '
class kamaki.cli.cmds.config.config_set(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Set a configuration option About options: . syntax: [group.]option . example: global.log_file . special case: <option> is equivalent to global.<option> . configuration file syntax: . [group] . option=value . (more options can be set per group) . . special case: named clouds. . example: cloud.demo.url . E.g. for a cloud “demo”: . [cloud “demo”] . url = <http://single/authentication/url/for/demo/site> . token = <auth_token_from_demo_site>

description = 'Set a configuration option'
long_description = 'About options: \n. syntax: [group.]option \n. example: global.log_file \n. special case: <option> is equivalent to global.<option> \n. configuration file syntax: \n. [group] \n. option=value \n. (more options can be set per group) \n. \n. special case: named clouds. \n. example: cloud.demo.url \n. E.g. for a cloud "demo": \n. [cloud "demo"] \n. url = <http://single/authentication/url/for/demo/site> \n. token = <auth_token_from_demo_site>'
main(option, value)[source]
syntax = '<option> <value> '

9.1.7. errors

class kamaki.cli.cmds.errors.Astakos[source]

Bases: object

classmethod astakosclient(this, func)[source]
classmethod membership_id(this, func)[source]
classmethod project_id(this, func)[source]
class kamaki.cli.cmds.errors.Cyclades[source]

Bases: object

about_flavor_id = ['To get a list of flavors', ' kamaki flavor list', 'More details on a flavor', ' kamaki flavor info FLAVOR_ID']
about_ips = ['To list available IPs', ' kamaki ip list', 'To reserve a new IP', ' kamaki ip create']
about_network_id = ['To get a list of networks', ' kamaki network list', 'More details on a network', ' kamaki network info NETWORK_ID']
classmethod cluster_size(this, func)[source]
classmethod connection(this, func)[source]
classmethod date(this, func)[source]
classmethod flavor_id(this, func)[source]
classmethod ip_id(this, func)[source]
classmethod metadata(this, func)[source]
classmethod network_id(this, func)[source]
classmethod network_in_use(this, func)[source]
classmethod network_permissions(this, func)[source]
classmethod port_id(this, func)[source]
classmethod server_id(this, func)[source]
classmethod subnet_id(this, func)[source]
classmethod subnet_permissions(this, func)[source]
class kamaki.cli.cmds.errors.Generic[source]

Bases: object

classmethod all(this, func)[source]
class kamaki.cli.cmds.errors.History[source]

Bases: object

classmethod init(this, func)[source]
class kamaki.cli.cmds.errors.Image[source]

Bases: object

about_image_id = ['To list all images', ' kamaki image list', 'To get image details', ' kamaki image info IMAGE_ID']
classmethod connection(this, func)[source]
classmethod id(this, func)[source]
classmethod permissions(this, func)[source]
class kamaki.cli.cmds.errors.Pithos[source]

Bases: object

classmethod account(this, func)[source]
classmethod connection(this, func)[source]
classmethod container(this, func)[source]
container_howto = ['To list containers', ' kamaki container list', 'Hint: Use a / to refer to a container (default: /pithos) e.g.,', 'To list contents of container "images"', ' kamaki file list /images', 'To get information on file "my.img" in container "images"', ' kamaki file info /images/my.img']
classmethod local_path(this, func)[source]
classmethod local_path_download(this, func)[source]
classmethod object_path(this, func)[source]
classmethod object_size(this, func)[source]
classmethod quota(this, func)[source]

9.2. The clients API

9.2.1. compute

class kamaki.clients.compute.rest_api.ComputeRestClient(endpoint_url, token, base_url=None)[source]

Bases: kamaki.clients.Client

flavors_get(flavor_id='', detail=False, changes_since=None, minDisk=None, minRam=None, marker=None, limit=None, success=200, **kwargs)[source]

GET endpoint_url[/flavor_id][/command]

Parameters:
  • flavor_id – ignored if detail
  • detail – (bool)

— Parameters —

Parameters:
  • changes_since – when the flavor last changed
  • minDisk – minimum disk space in GB filter
  • minRam – minimum RAM filter
  • marker – UUID of the flavor at which to set a marker
  • limit – limit the number of returned values
Returns:

request response

floating_ip_pools_get(success=200, **kwargs)[source]
floating_ips_delete(ip='', success=204, **kwargs)[source]
floating_ips_get(ip='', success=200, **kwargs)[source]
floating_ips_post(json_data, ip='', success=200, **kwargs)[source]
images_delete(image_id='', success=204, **kwargs)[source]

DEL ETE endpoint_url/images/<image_id>

Returns:request response
images_get(image_id='', detail=False, changes_since=None, server_name=None, name=None, status=None, marker=None, limit=None, type=None, success=200, **kwargs)[source]

GET endpoint_url[/image_id][/command]

Parameters:
  • image_id – (str) ignored if detail
  • detail – (bool)

— Parameters — :param changes_since: when the image last changed status

Parameters:
  • server_name – Name of the server in URL format
  • name – Name of the image
  • status – Status of the image (e.g. filter on “ACTIVE”)
  • marker – UUID of the image at which you want to set a marker
  • limit – Integer value for the limit of values to return
  • type – Type of image (e.g. BASE, SERVER, or ALL)
Returns:

request response

images_metadata_delete(image_id, key, success=204, **kwargs)[source]

DEL ETE endpoint_url/images/<image_id>/metadata/key

Returns:request response
images_metadata_get(image_id, key=None, success=200, **kwargs)[source]

GET endpoint_url/<image_id>/metadata[/key]

Returns:request response
images_metadata_post(image_id, json_data=None, success=201, **kwargs)[source]

POST endpoint_url/images/<image_id>/metadata

Returns:request response
images_metadata_put(image_id, key=None, json_data=None, success=201, **kwargs)[source]

PUT endpoint_url/images/<image_id>/metadata

Returns:request response
limits_get(success=200, **kwargs)[source]

GET endpoint_url/limits

Parameters:success – success code or list or tupple of accepted success codes. if server response code is not in this list, a ClientError raises
Returns:request response
servers_action_post(server_id, json_data=None, success=202, **kwargs)[source]

POST endpoint_url/servers/<server_id>/action

Returns:request response
servers_delete(server_id, success=204, **kwargs)[source]

DEL ETE endpoint_url/servers/<server_id>

Parameters:
  • json_data – a json-formated dict that will be send as data
  • success – success code (iterable of) codes
Raises ClientError:
 

if returned code not in success list

Returns:

request response

servers_get(server_id='', detail=False, changes_since=None, image=None, flavor=None, name=None, marker=None, limit=None, status=None, host=None, success=200, **kwargs)[source]

GET endpoint_url/servers/[‘detail’ | <server_id>]

Parameters:
  • server_id – (int or int str) ignored if detail
  • detail – (boolean)
  • changes-since – A time/date stamp for when the server last changed status
  • image – Name of the image in URL format
  • flavor – Name of the flavor in URL format
  • name – Name of the server as a string
  • marker – UUID of the server at which you want to set a marker
  • limit – (int) limit of values to return
  • status – Status of the server (e.g. filter on “ACTIVE”)
  • host – Name of the host as a string
Returns:

request response

servers_ips_get(server_id, network_id=None, changes_since=None, success=(304, 200), **kwargs)[source]

GET endpoint_url/servers/<server_id>/ips[/network_id]

Parameters:changes_since – time/date stamp in UNIX/epoch time. Checks for changes since a previous request.
Returns:request response
servers_metadata_delete(server_id, key, success=204, **kwargs)[source]

DEL ETE endpoint_url/servers/<server_id>/metadata[/key]

Returns:request response
servers_metadata_get(server_id, key=None, success=200, **kwargs)[source]

GET endpoint_url/servers/<server_id>/metadata[/key]

Returns:request response
servers_metadata_post(server_id, json_data=None, success=202, **kwargs)[source]

POST endpoint_url/servers/<server_id>/metadata

Returns:request response
servers_metadata_put(server_id, key=None, json_data=None, success=204, **kwargs)[source]

PUT endpoint_url/servers/<server_id>/metadata[/key]

Returns:request response
servers_post(security_group=None, user_data=None, availability_zone=None, json_data=None, success=202, **kwargs)[source]

POST endpoint_url/servers

Parameters:
  • json_data – a json-formated dict that will be send as data
  • security_group – (str)
  • user_data – Use to pass configuration information or scripts upon launch. Must be Base64 encoded.
  • availability_zone – (str)
Returns:

request response

servers_put(server_id, server_name=None, json_data=None, success=204, **kwargs)[source]

PUT endpoint_url/servers/<server_id>

Parameters:
  • json_data – a json-formated dict that will be send as data
  • success – success code (iterable of) codes
Raises ClientError:
 

if returned code not in success list

Returns:

request response

service_type = 'compute'
class kamaki.clients.compute.ComputeClient(endpoint_url, token, base_url=None)[source]

Bases: kamaki.clients.compute.rest_api.ComputeRestClient

OpenStack Compute API 1.1 client

alloc_floating_ip(tenant_id, pool=None)[source]
Parameters:
  • tenant_id – (str)
  • pool – (str) pool of ips to allocate from
Returns:

(dict) {fixed_ip: . id: . instance_id: . ip: . pool: .}

change_admin_password(server_id, new_password)[source]
Parameters:
  • server_id – (int)
  • new_password – (str)
confirm_resize_server(server_id)[source]

OS

create_server(name, flavor_id, image_id, security_group=None, user_data=None, availability_zone=None, metadata=None, personality=None, networks=None, response_headers={'location': None})[source]

Submit request to create a new server

Parameters:
  • name – (str)
  • flavor_id – integer id denoting a preset hardware configuration
  • image_id – (str) id of the image of the virtual server
  • metadata – (dict) vm metadata
  • personality – a list of (file path, file contents) tuples, describing files to be injected into virtual server upon creation
  • networks – (list of dicts) Networks to connect to, list this: [ {“uuid”: <network_uuid>}, {“uuid”: <network_uuid>, “fixed_ip”: address}, {“port”: <port_id>}, ...] ATTENTION: Empty list is different to None.
Returns:

a dict with the new virtual server details

Raises ClientError:
 

wraps request errors

create_server_image(server_id, image_name, **metadata)[source]

OpenStack method for taking snapshots

create_server_metadata(server_id, key, val)[source]
delete_floating_ip(tenant_id, fip_id=None)[source]
Parameters:
  • tenant_id – (str)
  • fip_id – (str) floating ip id (if None, all ips are deleted)
Returns:

(dict) request headers

delete_image(image_id)[source]
Parameters:image_id – (str)
delete_image_metadata(image_id, key)[source]
Parameters:
  • image_id – (str)
  • key – (str) metadatum key
Returns:

(dict) response headers

delete_server(server_id)[source]

Submit a deletion request for a server specified by id

Parameters:server_id – integer (str or int)
Returns:(dict) response headers
delete_server_metadata(server_id, key)[source]
get_flavor_details(flavor_id)[source]
get_floating_ip(tenant_id, fip_id=None)[source]
Parameters:
  • tenant_id – (str)
  • fip_id – (str) floating ip id (if None, all ips are returned)
Returns:

(list) [ {fixed_ip: ..., id: ..., instance_id: ..., ip: ..., pool: ...}, ... ]

get_floating_ip_pools(tenant_id)[source]
Parameters:tenant_id – (str)
Returns:(dict) {floating_ip_pools:[{name: ...}, ...]}
get_floating_ips(tenant_id)[source]
Parameters:tenant_id – (str)
Returns:(dict) {floating_ips:[ {fixed_ip: ..., id: ..., instance_id: ..., ip: ..., pool: ...}, ... ]}
get_image_details(image_id, **kwargs)[source]
Returns:dict
Raises ClientError:
 404 if image not available
get_image_metadata(image_id, key='', response_headers={'next': None, 'previous': None})[source]
Parameters:
  • image_id – (str)
  • key – (str) the metadatum key

:returns (dict) metadata if key not set, specific metadatum otherwise

get_server_details(server_id, changes_since=None, image=None, flavor=None, name=None, marker=None, limit=None, status=None, host=None, response_headers={'next': None, 'previous': None}, **kwargs)[source]

Return detailed info for a server

Parameters:server_id – integer (int or str)
Returns:dict with server details
get_server_metadata(server_id, key='', response_headers={'next': None, 'previous': None})[source]
get_server_network_nics(server_id, network_id, changes_since=None)[source]
get_server_nics(server_id, changes_since=None)[source]
list_flavors(detail=False, response_headers={'next': None, 'previous': None})[source]
list_images(detail=False, response_headers={'previous': None, 'next': None})[source]
list_servers(detail=False, changes_since=None, image=None, flavor=None, name=None, marker=None, limit=None, status=None, host=None, response_headers={'next': None, 'previous': None})[source]
Parameters:
  • detail – if true, append full server details to each item
  • response_headers – (dict) use it to get previous/next responses Keep the existing dict format to actually get the server responses Use it with very long lists or with marker
Returns:

list of server ids and names

reboot_server(server_id, hard=False)[source]
Parameters:
  • server_id – integer (str or int)
  • hard – perform a hard reboot if true, soft reboot otherwise
rebuild_server(server_id, response_headers={'location': None})[source]

OS

resize_server(server_id, flavor_id)[source]
Parameters:
  • server_id – (str)
  • flavor_id – (int)
Returns:

(dict) request headers

revert_resize_server(server_id)[source]

OS

shutdown_server(server_id)[source]

OS Extentions

start_server(server_id)[source]

OS Extentions

update_image_metadata(image_id, response_headers={'next': None, 'previous': None}, **metadata)[source]
Parameters:
  • image_id – (str)
  • metadata – dict
Returns:

updated metadata

update_server_metadata(server_id, response_headers={'next': None, 'previous': None}, **metadata)[source]
update_server_name(server_id, new_name)[source]

Update the name of the server as reported by the API (does not modify the hostname used inside the virtual server)

Parameters:
  • server_id – integer (str or int)
  • new_name – (str)
Returns:

(dict) response headers

9.2.2. cyclades

class kamaki.clients.cyclades.rest_api.CycladesBlockStorageRestClient(endpoint_url, token, base_url=None)[source]

Bases: kamaki.clients.blockstorage.BlockStorageClient

Synnefo Cyclades Block Storage REST API Client

volumes_action_post(volume_id, json_data, success=200, **kwargs)[source]
volumes_post(size, server_id, display_name, display_description=None, snapshot_id=None, imageRef=None, volume_type=None, metadata=None, project=None, success=202, **kwargs)[source]
class kamaki.clients.cyclades.rest_api.CycladesComputeRestClient(endpoint_url, token, base_url=None)[source]

Bases: kamaki.clients.compute.ComputeClient

Synnefo Cyclades REST API Client

servers_diagnostics_get(server_id, **kwargs)[source]

GET endpoint_url/servers/<server_id>/diagnostics

servers_stats_get(server_id, **kwargs)[source]

GET endpoint_url/servers/<server_id>/stats

kamaki.clients.cyclades.rest_api.CycladesRestClient

alias of CycladesComputeRestClient

class kamaki.clients.cyclades.CycladesBlockStorageClient(endpoint_url, token, base_url=None)[source]

Bases: kamaki.clients.cyclades.rest_api.CycladesBlockStorageRestClient

Cyclades Block Storage REST API Client

create_snapshot(volume_id, display_name, force=None, display_description=None)[source]
create_volume(size, server_id, display_name, display_description=None, snapshot_id=None, imageRef=None, volume_type=None, metadata=None, project=None)[source]
Returns:(dict) new volumes’ details
reassign_volume(volume_id, project)[source]
kamaki.clients.cyclades.CycladesClient

alias of CycladesComputeClient

class kamaki.clients.cyclades.CycladesComputeClient(endpoint_url, token, base_url=None)[source]

Bases: kamaki.clients.cyclades.rest_api.CycladesComputeRestClient, kamaki.clients.Waiter

Synnefo Cyclades Compute API client

CONSOLE_TYPES = ('vnc', 'vnc-ws', 'vnc-wss')
create_server(name, flavor_id, image_id, metadata=None, personality=None, networks=None, project_id=None, response_headers={'location': None})[source]

Submit request to create a new server

Parameters:
  • name – (str)
  • flavor_id – integer id denoting a preset hardware configuration
  • image_id – (str) id denoting the OS image to run on virt. server
  • metadata – (dict) vm metadata updated by os/users image metadata
  • personality – a list of (file path, file contents) tuples, describing files to be injected into virtual server upon creation
  • networks – (list of dicts) Networks to connect to, list this: “networks”: [ {“uuid”: <network_uuid>}, {“uuid”: <network_uuid>, “fixed_ip”: address}, {“port”: <port_id>}, ...] ATTENTION: Empty list is different to None. None means ‘ do not mention it’, empty list means ‘automatically get an ip’
  • project_id – the project where to assign the server
Returns:

a dict with the new virtual server details

Raises ClientError:
 

wraps request errors

get_server_console(server_id, console_type='vnc')[source]
Parameters:
  • server_id – integer (str or int)
  • console_type – str (vnc, vnc-ws, vnc-wss, default: vnc)
Returns:

(dict) info to set a VNC connection to virtual server

get_server_diagnostics(server_id)[source]
Parameters:server_id – integer (str or int)
Returns:(list)
get_server_stats(server_id)[source]
Parameters:server_id – integer (str or int)
Returns:(dict) auto-generated graphs of statistics (urls)
reassign_server(server_id, project)[source]
set_firewall_profile(server_id, profile, port_id)[source]

Set the firewall profile for the public interface of a server :param server_id: integer (str or int) :param profile: (str) ENABLED | DISABLED | PROTECTED :param port_id: (str) This port must connect to a public network :returns: (dict) response headers

shutdown_server(server_id)[source]

Submit a shutdown request

Parameters:server_id – integer (str or int)
Returns:(dict) response headers
start_server(server_id)[source]

Submit a startup request

Parameters:server_id – integer (str or int)
Returns:(dict) response headers
wait_server(server_id, current_status='BUILD', delay=1, max_wait=100, wait_cb=None)[source]

Wait for server while its status is current_status

Parameters:
  • server_id – integer (str or int)
  • current_status – (str) BUILD|ACTIVE|STOPPED|DELETED|REBOOT
  • delay – time interval between retries
  • wait_cb – if set a progressbar is used to show progress
Max_wait :

(int) timeout in secconds

Returns:

(str) the new mode if succesfull, (bool) False if timed out

class kamaki.clients.cyclades.CycladesNetworkClient(endpoint_url, token, base_url=None)[source]

Bases: kamaki.clients.network.NetworkClient

Cyclades Network API extentions

create_floatingip(floating_network_id=None, floating_ip_address='', project_id=None)[source]
Parameters:
  • floating_network_id – if not provided, it is assigned automatically by the service
  • floating_ip_address – only if the IP is availabel in network pool
  • project_id – specific project to get resource quotas from
create_network(type, name=None, shared=None, project_id=None)[source]
create_port(network_id, device_id=None, security_groups=None, name=None, fixed_ips=None)[source]
Parameters:fixed_ips – (list of dicts) [{“ip_address”: IPv4}, ...]
list_networks(detail=None)[source]
list_ports(detail=None)[source]
network_types = ('CUSTOM', 'MAC_FILTERED', 'IP_LESS_ROUTED', 'PHYSICAL_VLAN')
reassign_floating_ip(floating_network_id, project_id)[source]

Change the project where this ip is charged

reassign_network(network_id, project_id, **kwargs)[source]

POST endpoint_url/networks/<network_id>/action

Returns:request response

9.2.3. storage

class kamaki.clients.storage.StorageClient(endpoint_url, token, account=None, container=None)[source]

Bases: kamaki.clients.Client

OpenStack Object Storage API 1.0 client

copy_object(src_container, src_object, dst_container, dst_object=False)[source]

Copy an objects from src_contaier:src_object to dst_container[:dst_object]

Parameters:
  • src_container – (str)
  • src_object – (str)
  • dst_container – (str)
  • dst_object – (str)
create_container(container)[source]
Parameters:container – (str)
Raises ClientError:
 202 Container already exists
create_directory(obj)[source]
Parameters:obj – (str) directory-object name
Returns:(dict) request headers
create_object(obj, content_type='application/octet-stream', content_length=0)[source]
Parameters:
  • obj – (str) directory-object name
  • content_type – (str) explicitly set content_type
  • content_length – (int) explicitly set content length
Returns:

(dict) object creation headers

del_account_meta(metakey)[source]
Parameters:metakey – (str) metadatum key
del_object_meta(obj, metakey)[source]
Parameters:
  • obj – (str)
  • metakey – (str) the metadatum key
delete_container(container)[source]
Parameters:

container – (str)

Raises:
  • ClientError – 404 Container does not exist
  • ClientError – 409 Container not empty
delete_object(obj)[source]
Parameters:obj – (str)
Raises ClientError:
 404 Object not found
get_account_info()[source]
Returns:(dict)
get_container_info(container)[source]
Parameters:container – (str)
Returns:(dict)
Raises ClientError:
 404 Container does not exist
get_object_info(obj)[source]
Parameters:obj – (str)
Returns:(dict)
get_object_meta(obj)[source]
Parameters:obj – (str)
Returns:(dict)
list_containers()[source]
Returns:(dict)
list_objects(limit=None, marker=None, prefix=None, format=None, delimiter=None, path=None)[source]
Parameters:
  • limit – (integer) The amount of results requested
  • marker – (string) Return containers with name lexicographically after marker
  • prefix – (string) Return objects starting with prefix
  • format – (string) reply format can be json or xml (default:json)
  • delimiter – (string) Return objects up to the delimiter
  • path – (string) assume prefix = path and delimiter = / (overwrites prefix and delimiter)
Returns:

(dict)

Raises ClientError:
 

404 Invalid account

list_objects_in_path(path_prefix)[source]
Parameters:path_prefix – (str)
Raises ClientError:
 404 Invalid account
Returns:(dict)
move_object(src_container, src_object, dst_container, dst_object=False)[source]

Move an objects from src_contaier:src_object to dst_container[:dst_object]

Parameters:
  • src_container – (str)
  • src_object – (str)
  • dst_container – (str)
  • dst_object – (str)
replace_account_meta(metapairs)[source]
Parameters:metapais – (dict) key:val metadata pairs
replace_object_meta(metapairs)[source]
Parameters:metapairs – (dict) key:val metadata
upload_object(obj, f, size=None)[source]

A simple (naive) implementation.

Parameters:
  • obj – (str)
  • f – an open for reading file descriptor
  • size – (int) number of bytes to upload

9.2.4. pithos

class kamaki.clients.pithos.rest_api.PithosRestClient(endpoint_url, token, account=None, container=None)[source]

Bases: kamaki.clients.storage.StorageClient

account_get(limit=None, marker=None, format='json', show_only_shared=False, public=False, until=None, if_modified_since=None, if_unmodified_since=None, *args, **kwargs)[source]

Full Pithos+ GET at account level

— request parameters —

Parameters:
  • limit – (integer) The amount of results requested (server will use default value if None)
  • marker – string Return containers with name lexicographically after marker
  • format – (string) reply format can be json or xml (default: json)
  • shared – (bool) If true, only shared containers will be included in results
  • until – (string) optional timestamp

— request headers —

Parameters:
  • if_modified_since – (string) Retrieve if account has changed since provided timestamp
  • if_unmodified_since – (string) Retrieve if account has not changed since provided timestamp
Returns:

ConnectionResponse

account_head(until=None, if_modified_since=None, if_unmodified_since=None, *args, **kwargs)[source]

Full Pithos+ HEAD at account level

— request parameters —

Parameters:until – (string) optional timestamp

— request headers —

Parameters:
  • if_modified_since – (string) Retrieve if account has changed since provided timestamp
  • if_unmodified_since – (string) Retrieve if account has not change since provided timestamp
Returns:

ConnectionResponse

account_post(update=True, groups={}, metadata=None, quota=None, versioning=None, *args, **kwargs)[source]

Full Pithos+ POST at account level

— request parameters —

Parameters:update – (bool) if True, Do not replace metadata/groups

— request headers —

Parameters:
  • groups – (dict) Optional user defined groups in the form { ‘group1’:[‘user1’, ‘user2’, ...], ‘group2’:[‘userA’, ‘userB’, ...], }
  • metadata – (dict) Optional user defined metadata in the form { ‘name1’: ‘value1’, ‘name2’: ‘value2’, ... }
  • quota – (integer) If supported, sets the Account quota
  • versioning – (string) If supported, sets the Account versioning to ‘auto’ or some other supported versioning string
Returns:

ConnectionResponse

container_delete(until=None, delimiter=None, *args, **kwargs)[source]

Full Pithos+ DELETE at container level

— request parameters —

Parameters:until – (timestamp string) if defined, container is purged up to that time
Returns:ConnectionResponse
container_get(limit=None, marker=None, prefix=None, delimiter=None, path=None, format='json', meta=[], show_only_shared=False, public=False, until=None, if_modified_since=None, if_unmodified_since=None, *args, **kwargs)[source]

Full Pithos+ GET at container level

— request parameters —

Parameters:
  • limit – (integer) The amount of results requested (server will use default value if None)
  • marker – (string) Return containers with name lexicographically after marker
  • prefix – (string) Return objects starting with prefix
  • delimiter – (string) Return objects up to the delimiter
  • path – (string) assume prefix = path and delimiter = / (overwrites prefix and delimiter)
  • format – (string) reply format can be json or xml (default:json)
  • meta – (list) Return objects that satisfy the key queries in the specified comma separated list (use <key>, !<key> for existence queries, <key><op><value> for value queries, where <op> can be one of =, !=, <=, >=, <, >)
  • show_only_shared – (bool) If true, only shared containers will be included in results
  • until – (string) optional timestamp

— request headers —

Parameters:
  • if_modified_since – (string) Retrieve if account has changed since provided timestamp
  • if_unmodified_since – (string) Retrieve if account has not changed since provided timestamp
Returns:

ConnectionResponse

container_head(until=None, if_modified_since=None, if_unmodified_since=None, *args, **kwargs)[source]

Full Pithos+ HEAD at container level

— request params —

Parameters:until – (string) optional timestamp

— request headers —

Parameters:
  • if_modified_since – (string) Retrieve if account has changed since provided timestamp
  • if_unmodified_since – (string) Retrieve if account has not changed since provided timestamp
Returns:

ConnectionResponse

container_post(update=True, format='json', quota=None, versioning=None, project_id=None, metadata=None, content_type=None, content_length=None, transfer_encoding=None, *args, **kwargs)[source]

Full Pithos+ POST at container level

— request params —

Parameters:
  • update – (bool) if True, Do not replace metadata/groups
  • format – (string) json (default) or xml

— request headers —

Parameters:
  • quota – (integer) Size limit in KB
  • versioning – (string) ‘auto’ or other string supported by server
  • metadata – (dict) Optional user defined metadata in the form { ‘name1’: ‘value1’, ‘name2’: ‘value2’, ... }
  • content_type – (string) set a custom content type
  • content_length – (string) set a custrom content length
  • transfer_encoding – (string) set a custom transfer encoding
Returns:

ConnectionResponse

container_put(quota=None, versioning=None, project_id=None, metadata=None, *args, **kwargs)[source]

Full Pithos+ PUT at container level

— request headers —

Parameters:
  • quota – (integer) Size limit in KB
  • versioning – (string) ‘auto’ or other string supported by server
  • metadata – (dict) Optional user defined metadata in the form { ‘name1’: ‘value1’, ‘name2’: ‘value2’, ... }
Returns:

ConnectionResponse

object_copy(obj, destination, format='json', ignore_content_type=False, if_etag_match=None, if_etag_not_match=None, destination_account=None, content_type=None, content_encoding=None, content_disposition=None, source_version=None, permissions=None, public=None, metadata=None, *args, **kwargs)[source]

Full Pithos+ COPY at object level

— request parameters —

Parameters:
  • format – (string) json (default) or xml
  • ignore_content_type – (bool) Ignore the supplied Content-Type

— request headers —

Parameters:
  • if_etag_match – (string) if provided, copy only results with etag matching with this
  • if_etag_not_match – (string) if provided, copy only results with etag not matching with this
  • destination – (string) The destination path in the form /<container>/<object>
  • destination_account – (string) The destination account to copy to
  • content_type – (string) The MIME content type of the object
  • content_encoding – (string) The encoding of the object
  • content_disposition – (string) Object resentation style
  • source_version – (string) The source version to copy from
  • permissions – (dict) Object permissions in the form (all fields are optional) { ‘read’:[user1, group1, user2, ...], ‘write’:[‘user3, group2, group3, ...] }
  • public – (bool) If true, Object is published, False, unpublished
  • metadata – (dict) Optional user defined metadata in the form {‘meta-key-1’:’meta-value-1’, ‘meta-key-2’:’meta-value-2’, ...} Metadata are appended to the source metadata. In case of same keys, they replace the old metadata
Returns:

ConnectionResponse

object_delete(object, until=None, delimiter=None, *args, **kwargs)[source]

Full Pithos+ DELETE at object level

— request parameters —

Parameters:until – (string) Optional timestamp
Returns:ConnectionResponse
object_get(obj, format='json', hashmap=False, version=None, data_range=None, if_range=False, if_etag_match=None, if_etag_not_match=None, if_modified_since=None, if_unmodified_since=None, *args, **kwargs)[source]

Full Pithos+ GET at object level

— request parameters —

Parameters:
  • format – (string) json (default) or xml
  • hashmap – (bool) Optional request for hashmap
  • version – (string) optional version identified

— request headers —

Parameters:
  • data_range – (string) Optional range of data to retrieve
  • if_range – (bool)
  • if_etag_match – (string) if provided, return only results with etag matching with this
  • if_etag_not_match – (string) if provided, return only results with etag not matching with this
  • if_modified_since – (string) Retrieve if account has changed since provided timestamp
  • if_unmodified_since – (string) Retrieve if account has not changed since provided timestamp
Returns:

ConnectionResponse

object_head(obj, version=None, if_etag_match=None, if_etag_not_match=None, if_modified_since=None, if_unmodified_since=None, *args, **kwargs)[source]

Full Pithos+ HEAD at object level

— request parameters —

Parameters:version – (string) optional version identified

— request headers —

Parameters:
  • if_etag_match – (string) if provided, return only results with etag matching with this
  • if_etag_not_match – (string) if provided, return only results with etag not matching with this
  • if_modified_since – (string) Retrieve if account has changed since provided timestamp
  • if_unmodified_since – (string) Retrieve if account has not changed since provided timestamp
Returns:

ConnectionResponse

object_move(object, format='json', ignore_content_type=False, if_etag_match=None, if_etag_not_match=None, destination=None, destination_account=None, content_type=None, content_encoding=None, content_disposition=None, permissions={}, public=None, metadata={}, *args, **kwargs)[source]

Full Pithos+ COPY at object level

— request parameters —

Parameters:
  • format – (string) json (default) or xml
  • ignore_content_type – (bool) Ignore the supplied Content-Type

— request headers —

Parameters:
  • if_etag_match – (string) if provided, return only results with etag matching with this
  • if_etag_not_match – (string) if provided, return only results with etag not matching with this
  • destination – (string) The destination path in the form /<container>/<object>
  • destination_account – (string) The destination account to copy to
  • content_type – (string) The MIME content type of the object
  • content_encoding – (string) The encoding of the object
  • content_disposition – (string) Object presentation style
  • source_version – (string) The source version to copy from
  • permissions – (dict) Object permissions in the form (all fields are optional) { ‘read’:[user1, group1, user2, ...], ‘write’:[‘user3, group2, group3, ...] }
  • public – (bool) If true, Object is published, False, unpublished
  • metadata – (dict) Optional user defined metadata in the form {‘meta-key-1’:’meta-value-1’, ‘meta-key-2’:’meta-value-2’, ...}
Returns:

ConnectionResponse

object_post(obj, format='json', update=True, if_etag_match=None, if_etag_not_match=None, content_length=None, content_type=None, content_range=None, transfer_encoding=None, content_encoding=None, content_disposition=None, source_object=None, source_account=None, source_version=None, object_bytes=None, manifest=None, permissions={}, public=None, metadata={}, *args, **kwargs)[source]

Full Pithos+ POST at object level

— request parameters —

Parameters:
  • format – (string) json (default) or xml
  • update – (bool) Do not replace metadata

— request headers —

Parameters:
  • if_etag_match – (string) if provided, return only results with etag matching with this
  • if_etag_not_match – (string) if provided, return only results with etag not matching with this
  • content_length – (string) The size of the data written
  • content_type – (string) The MIME content type of the object
  • content_range – (string) The range of data supplied
  • transfer_encoding – (string) Set to chunked to specify incremental uploading (if used, Content-Length is ignored)
  • content_encoding – (string) The encoding of the object
  • content_disposition – (string) Object presentation style
  • source_object – (string) Update with data from the object at path /<container>/<object>
  • source_account – (string) The source account to update from
  • source_version – (string) The source version to copy from
  • object_bytes – (integer) The updated objects final size
  • manifest – (string) Object parts prefix as /<container>/<object>
  • permissions – (dict) Object permissions in the form (all fields are optional) { ‘read’:[user1, group1, user2, ...], ‘write’:[‘user3, group2, group3, ...] }
  • public – (bool) If true, Object is published, False, unpublished
  • metadata – (dict) Optional user defined metadata in the form {‘meta-key-1’:’meta-value-1’, ‘meta-key-2’:’meta-value-2’, ...}
Returns:

ConnectionResponse

object_put(obj, format='json', hashmap=False, delimiter=None, if_etag_match=None, if_etag_not_match=None, etag=None, content_length=None, content_type=None, transfer_encoding=None, copy_from=None, move_from=None, source_account=None, source_version=None, content_encoding=None, content_disposition=None, manifest=None, permissions=None, public=None, metadata=None, *args, **kwargs)[source]

Full Pithos+ PUT at object level

— request parameters —

Parameters:
  • format – (string) json (default) or xml
  • hashmap – (bool) Optional hashmap provided instead of data

— request headers —

Parameters:
  • if_etag_match – (string) if provided, return only results with etag matching with this
  • if_etag_not_match – (string) if provided, return only results with etag not matching with this
  • etag – (string) The MD5 hash of the object (optional to check written data)
  • content_length – (integer) The size of the data written
  • content_type – (string) The MIME content type of the object
  • transfer_encoding – (string) Set to chunked to specify incremental uploading (if used, Content-Length is ignored)
  • copy_from – (string) The source path in the form /<container>/<object>
  • move_from – (string) The source path in the form /<container>/<object>
  • source_account – (string) The source account to copy/move from
  • source_version – (string) The source version to copy from
  • conent_encoding – (string) The encoding of the object
  • content_disposition – (string) Presentation style of the object
  • manifest – (string) Object parts prefix in /<container>/<object> form
  • permissions – (dict) Object permissions in the form (all fields are optional) { ‘read’:[user1, group1, user2, ...], ‘write’:[‘user3, group2, group3, ...] }
  • public – (bool) If true, Object is published, False, unpublished
  • metadata – (dict) Optional user defined metadata in the form {‘meta-key-1’:’meta-value-1’, ‘meta-key-2’:’meta-value-2’, ...}
Returns:

ConnectionResponse

service_type = 'object-store'
class kamaki.clients.pithos.PithosClient(endpoint_url, token, account=None, container=None)[source]

Bases: kamaki.clients.pithos.rest_api.PithosRestClient

Synnefo Pithos+ API client

append_object(obj, source_file, upload_cb=None)[source]
Parameters:
  • obj – (str) remote object path
  • source_file – open file descriptor
  • upload_db – progress.bar for uploading
copy_object(src_container, src_object, dst_container, dst_object=None, source_version=None, source_account=None, public=False, content_type=None, delimiter=None)[source]
Parameters:
  • src_container – (str) source container
  • src_object – (str) source object path
  • dst_container – (str) destination container
  • dst_object – (str) destination object path
  • source_version – (str) source object version
  • source_account – (str) account to copy from
  • public – (bool)
  • content_type – (str)
  • delimiter – (str)
Returns:

(dict) response headers

create_container(container=None, sizelimit=None, versioning=None, metadata=None, project_id=None, **kwargs)[source]
Parameters:
  • container – (str) if not given, self.container is used instead
  • sizelimit – (int) container total size limit in bytes
  • versioning – (str) can be auto or whatever supported by server
  • metadata – (dict) Custom user-defined metadata of the form { ‘name1’: ‘value1’, ‘name2’: ‘value2’, ... }
Returns:

(dict) response headers

create_object_by_manifestation(obj, etag=None, content_encoding=None, content_disposition=None, content_type=None, sharing=None, public=None)[source]
Parameters:
  • obj – (str) remote object path
  • etag – (str)
  • content_encoding – (str)
  • content_disposition – (str)
  • content_type – (str)
  • sharing – {‘read’:[user and/or grp names], ‘write’:[usr and/or grp names]}
  • public – (bool)
Returns:

(dict) created object metadata

del_account_group(group)[source]
Parameters:group – (str)
del_account_meta(metakey)[source]
Parameters:metakey – (str) metadatum key
del_container(until=None, delimiter=None)[source]
Parameters:
  • until – (str) formated date
  • delimiter – (str) with / empty container
Raises:
  • ClientError – 404 Container does not exist
  • ClientError – 409 Container is not empty
del_container_meta(metakey)[source]
Parameters:metakey – (str) metadatum key
Returns:(dict) response headers
del_object(obj, until=None, delimiter=None)[source]
Parameters:
  • obj – (str) remote object path
  • until – (str) formated date
  • delimiter – (str)
del_object_meta(obj, metakey)[source]
Parameters:
  • obj – (str) remote object path
  • metakey – (str) metadatum key
del_object_sharing(obj)[source]
Parameters:obj – (str) remote object path
download_object(obj, dst, download_cb=None, version=None, resume=False, range_str=None, if_match=None, if_none_match=None, if_modified_since=None, if_unmodified_since=None)[source]

Download an object (multiple connections, random blocks)

Parameters:
  • obj – (str) remote object path
  • dst – open file descriptor (wb+)
  • download_cb – optional progress.bar object for downloading
  • version – (str) file version
  • resume – (bool) if set, preserve already downloaded file parts
  • range_str – (str) from, to are file positions (int) in bytes
  • if_match – (str)
  • if_none_match – (str)
  • if_modified_since – (str) formated date
  • if_unmodified_since – (str) formated date
download_to_string(obj, download_cb=None, version=None, range_str=None, if_match=None, if_none_match=None, if_modified_since=None, if_unmodified_since=None)[source]

Download an object to a string (multiple connections). This method uses threads for http requests, but stores all content in memory.

Parameters:
  • obj – (str) remote object path
  • download_cb – optional progress.bar object for downloading
  • version – (str) file version
  • range_str – (str) from, to are file positions (int) in bytes
  • if_match – (str)
  • if_none_match – (str)
  • if_modified_since – (str) formated date
  • if_unmodified_since – (str) formated date
Returns:

(str) the whole object contents

get_account_group()[source]
Returns:(dict)
get_account_info(until=None)[source]
Parameters:until – (str) formated date
Returns:(dict)
get_account_meta(until=None)[source]
Parameters:until – (str) formated date
Returns:(dict)
get_account_quota()[source]
Returns:(dict)
get_container_info(container=None, until=None)[source]
Parameters:until – (str) formated date
Returns:(dict)
Raises ClientError:
 404 Container not found
get_container_limit(container=None)[source]
Parameters:container – (str)
Returns:(dict)
get_container_meta(until=None)[source]
Parameters:until – (str) formated date
Returns:(dict)
get_container_object_meta(until=None)[source]
Parameters:until – (str) formated date
Returns:(dict)
get_container_versioning(container=None)[source]
Parameters:container – (str)
Returns:(dict)
get_object_hashmap(obj, version=None, if_match=None, if_none_match=None, if_modified_since=None, if_unmodified_since=None)[source]
Parameters:
  • obj – (str) remote object path
  • if_match – (str)
  • if_none_match – (str)
  • if_modified_since – (str) formated date
  • if_unmodified_since – (str) formated date
Returns:

(list)

get_object_info(obj, version=None)[source]
Parameters:
  • obj – (str) remote object path
  • version – (str)
Returns:

(dict)

get_object_meta(obj, version=None)[source]
Parameters:
  • obj – (str) remote object path
  • version – (str)
Returns:

(dict)

get_object_sharing(obj)[source]
Parameters:obj – (str) remote object path
Returns:(dict)
get_object_versionlist(obj)[source]
Parameters:obj – (str) remote object path
Returns:(list)
get_sharing_accounts(limit=None, marker=None, *args, **kwargs)[source]

Get accounts that share with self.account

Parameters:
  • limit – (str)
  • marker – (str)
Returns:

(dict)

list_containers()[source]
Returns:(dict)
move_object(src_container, src_object, dst_container, dst_object=False, source_account=None, source_version=None, public=False, content_type=None, delimiter=None)[source]
Parameters:
  • src_container – (str) source container
  • src_object – (str) source object path
  • dst_container – (str) destination container
  • dst_object – (str) destination object path
  • source_account – (str) account to move from
  • source_version – (str) source object version
  • public – (bool)
  • content_type – (str)
  • delimiter – (str)
Returns:

(dict) response headers

overwrite_object(obj, start, end, source_file, source_version=None, upload_cb=None)[source]

Overwrite a part of an object from local source file ATTENTION: content_type must always be application/octet-stream

Parameters:
  • obj – (str) remote object path
  • start – (int) position in bytes to start overwriting from
  • end – (int) position in bytes to stop overwriting at
  • source_file – open file descriptor
  • upload_db – progress.bar for uploading
publish_object(obj)[source]
Parameters:obj – (str) remote object path
Returns:(str) access url
purge_container(container=None)[source]

Delete an empty container and destroy associated blocks

reassign_container(project_id)[source]
set_account_group(group, usernames)[source]
Parameters:
  • group – (str)
  • usernames – (list)
set_account_meta(metapairs)[source]
Parameters:metapairs – (dict) {key1:val1, key2:val2, ...}
set_container_limit(limit)[source]
Parameters:limit – (int)
set_container_meta(metapairs)[source]
Parameters:metapairs – (dict) {key1:val1, key2:val2, ...}
set_container_versioning(versioning)[source]
Parameters:versioning – (str)
set_object_meta(obj, metapairs)[source]
Parameters:
  • obj – (str) remote object path
  • metapairs – (dict) {key1:val1, key2:val2, ...}
set_object_sharing(obj, read_permission=False, write_permission=False)[source]

Give read/write permisions to an object.

Parameters:
  • obj – (str) remote object path
  • read_permission – (list - bool) users and user groups that get read permission for this object - False means all previous read permissions will be removed
  • write_permission – (list - bool) of users and user groups to get write permission for this object - False means all previous write permissions will be removed
Returns:

(dict) response headers

truncate_object(obj, upto_bytes)[source]
Parameters:
  • obj – (str) remote object path
  • upto_bytes – max number of bytes to leave on file
Returns:

(dict) response headers

unpublish_object(obj)[source]
Parameters:obj – (str) remote object path
upload_from_string(obj, input_str, hash_cb=None, upload_cb=None, etag=None, if_etag_match=None, if_not_exist=None, content_encoding=None, content_disposition=None, content_type=None, sharing=None, public=None, container_info_cache=None)[source]

Upload an object using multiple connections (threads)

Parameters:
  • obj – (str) remote object path
  • input_str – (str) upload content
  • hash_cb – optional progress.bar object for calculating hashes
  • upload_cb – optional progress.bar object for uploading
  • etag – (str)
  • if_etag_match – (str) Push that value to if-match header at file creation
  • if_not_exist – (bool) If true, the file will be uploaded ONLY if it does not exist remotely, otherwise the operation will fail. Involves the case of an object with the same path is created while the object is being uploaded.
  • content_encoding – (str)
  • content_disposition – (str)
  • content_type – (str)
  • sharing – {‘read’:[user and/or grp names], ‘write’:[usr and/or grp names]}
  • public – (bool)
  • container_info_cache – (dict) if given, avoid redundant calls to server for container info (block size and hash information)
upload_object(obj, f, size=None, hash_cb=None, upload_cb=None, etag=None, if_etag_match=None, if_not_exist=None, content_encoding=None, content_disposition=None, content_type=None, sharing=None, public=None, container_info_cache=None)[source]

Upload an object using multiple connections (threads)

Parameters:
  • obj – (str) remote object path
  • f – open file descriptor (rb)
  • hash_cb – optional progress.bar object for calculating hashes
  • upload_cb – optional progress.bar object for uploading
  • etag – (str)
  • if_etag_match – (str) Push that value to if-match header at file creation
  • if_not_exist – (bool) If true, the file will be uploaded ONLY if it does not exist remotely, otherwise the operation will fail. Involves the case of an object with the same path is created while the object is being uploaded.
  • content_encoding – (str)
  • content_disposition – (str)
  • content_type – (str)
  • sharing – {‘read’:[user and/or grp names], ‘write’:[usr and/or grp names]}
  • public – (bool)
  • container_info_cache – (dict) if given, avoid redundant calls to server for container info (block size and hash information)
upload_object_unchunked(obj, f, withHashFile=False, size=None, etag=None, content_encoding=None, content_disposition=None, content_type=None, sharing=None, public=None)[source]
Parameters:
  • obj – (str) remote object path
  • f – open file descriptor
  • withHashFile – (bool)
  • size – (int) size of data to upload
  • etag – (str)
  • content_encoding – (str)
  • content_disposition – (str)
  • content_type – (str)
  • sharing – {‘read’:[user and/or grp names], ‘write’:[usr and/or grp names]}
  • public – (bool)
Returns:

(dict) created object metadata

9.2.5. image

class kamaki.clients.image.ImageClient(endpoint_url, token)[source]

Bases: kamaki.clients.Client

Synnefo Plankton API client

add_member(image_id, member)[source]
Parameters:
  • image_id – (str)
  • member – (str) user to allow access to current user’s images
get_meta(image_id)[source]
Parameters:image_id – (string)
Returns:(list) image metadata (key:val)
list_members(image_id)[source]
Parameters:image_id – (str)
Returns:(list) users who can use current user’s images
list_public(detail=False, filters={}, order='')[source]
Parameters:
  • detail – (bool)
  • filters – (dict) request filters
  • order – (str) order listing by field (default is ascending, - for descending)
Returns:

(list) id,name + full image info if detail

list_shared(member)[source]
Parameters:member – (str) sharers account
Returns:(list) images shared by member
register(name, location, params={}, properties={})[source]

Register an image that is uploaded at location

Parameters:
  • name – (str)
  • location – (str or iterable) if iterable, then (user_uuid, container, image_path) else if string pithos://<user_uuid>/<container>/<image object>
  • params – (dict) image metadata (X-Image-Meta) can be id, store, disc_format, container_format, size, checksum, is_public, owner
  • properties – (dict) image properties (X-Image-Meta-Property)
Returns:

(dict) metadata of the created image

remove_member(image_id, member)[source]
Parameters:
  • image_id – (str)
  • member – (str) user to deprive from current user’s images
service_type = 'image'
set_members(image_id, members)[source]
Parameters:
  • image_id – (str)
  • members – (list) user to deprive from current user’s images
unregister(image_id)[source]

Unregister an image

Parameters:image_id – (str)
Returns:(dict) response headers
update_image(image_id, name=None, disk_format=None, container_format=None, status=None, public=None, owner_id=None, **properties)[source]

9.2.6. network

Warning

For synnefo, the suggested network implementation is in kamaki.clients.cyclades.CycladesNetworkClient extension

class kamaki.clients.network.NetworkClient(endpoint_url, token, base_url=None)[source]

Bases: kamaki.clients.network.rest_api.NetworkRestClient, kamaki.clients.Waiter

OpenStack Network API 2.0 client

create_floatingip(floating_network_id, floating_ip_address='', port_id='', fixed_ip_address='')[source]
create_network(name, admin_state_up=None, shared=None)[source]
create_networks(networks)[source]

Atomic operation for batch network creation (all or nothing)

Parameters:

networks – (list) [ {name: ..(str).., admin_state_up: ..(bool).., shared: ..(bool)..}, {name: ..(str).., admin_state_up: ..(bool).., shared: ..(bool)..}] name is mandatory, the rest is optional e.g., create_networks([ {name: ‘net1’, admin_state_up: True}, {name: ‘net2’}])

Returns:

(list of dicts) created networks details

Raises:
  • ValueError – if networks is misformated
  • ClientError – if the request failed or didn’t return 201
create_port(network_id, name=None, status=None, admin_state_up=None, mac_address=None, fixed_ips=None, security_groups=None)[source]
Parameters:
  • network_id – (str)
  • name – (str)
  • status – (str)
  • admin_state_up – (bool) Router administrative status (UP / DOWN)
  • mac_address – (str)
  • fixed_ips – (str)
  • security_groups – (list)
create_ports(ports)[source]

Atomic operation for batch port creation (all or nothing)

Parameters:

ports – (list of dicts) {key: ...} with all parameters in the method create_port, where method mandatory / optional paramteres respond to mandatory / optional paramters in ports items

Returns:

(list of dicts) created portss details

Raises:
  • ValueError – if ports parameter is incorrectly formated
  • ClientError – if the request failed or didn’t return 201
create_subnet(network_id, cidr, name=None, allocation_pools=None, gateway_ip=None, subnet_id=None, ipv6=None, enable_dhcp=None)[source]
Parameters:
  • network_id – (str)
  • cidr – (str)
  • name – (str) The subnet name
  • allocation_pools – (list of dicts) start/end addresses of allocation pools: [{‘start’: ..., ‘end’: ...}, ...]
  • gateway_ip – (str) Special cases: None: server applies the default policy empty iterable: no gateway IP on this subnet
  • ipv6 – (bool) ip_version == 6 if true else 4 (default)
  • enable_dhcp – (bool)
create_subnets(subnets)[source]

Atomic operation for batch subnet creation (all or nothing)

Parameters:

subnets – (list of dicts) {key: ...} with all parameters in the method create_subnet, where method mandatory / optional paramteres respond to mandatory / optional paramters in subnets items

Returns:

(list of dicts) created subnetss details

Raises:
  • ValueError – if subnets parameter is incorrectly formated
  • ClientError – if the request failed or didn’t return 201
delete_floatingip(floatingip_id)[source]
delete_network(network_id)[source]
delete_port(port_id)[source]
delete_subnet(subnet_id)[source]
get_floatingip_details(floatingip_id)[source]
get_network_details(network_id)[source]
get_port_details(port_id)[source]
get_subnet_details(subnet_id)[source]
list_floatingips()[source]
list_networks()[source]
list_ports()[source]
list_subnets()[source]
update_floatingip(floatingip_id, floating_ip_address='', port_id='', fixed_ip_address='')[source]

To nullify something optional, use None

update_network(network_id, name=None, admin_state_up=None, shared=None)[source]
update_port(port_id, network_id, name=None, status=None, admin_state_up=None, mac_address=None, fixed_ips=None, security_groups=None)[source]
Parameters:
  • network_id – (str)
  • name – (str)
  • status – (str)
  • admin_state_up – (bool) Router administrative status (UP / DOWN)
  • mac_address – (str)
  • fixed_ips – (str)
  • security_groups – (list)
update_subnet(subnet_id, name=None, allocation_pools=None, gateway_ip=None, ipv6=None, enable_dhcp=None)[source]
Parameters:
  • subnet_id – (str)
  • name – (str) The subnet name
  • allocation_pools – (list of dicts) start/end addresses of allocation pools: [{‘start’: ..., ‘end’: ...}, ...]
  • gateway_ip – (str)
  • ipv6 – (bool) ip_version == 6 if true, 4 if false, used as filter
  • enable_dhcp – (bool)
wait_port(port_id, current_status='BUILD', delay=1, max_wait=100, wait_cb=None)[source]

9.2.7. astakos

class kamaki.clients.astakos.AstakosClient(*args, **kwargs)[source]

Bases: astakosclient.AstakosClient

Wrap Original AstakosClient to ensure compatibility in kamaki clients

accept_commission(*args, **kwargs)
application_action(*args, **kwargs)
authenticate(*args, **kwargs)
commission_action(*args, **kwargs)
create_project(*args, **kwargs)
enroll_member(*args, **kwargs)
get_commission_info(*args, **kwargs)
get_endpoint_url(*args, **kwargs)[source]
get_endpoints(*args, **kwargs)
get_membership(*args, **kwargs)
get_memberships(*args, **kwargs)
get_pending_commissions(*args, **kwargs)
get_project(*args, **kwargs)
get_projects(*args, **kwargs)
get_quotas(*args, **kwargs)
get_resources(*args, **kwargs)
get_service_endpoints(*args, **kwargs)[source]
get_services(*args, **kwargs)
get_token(*args, **kwargs)
get_username(*args, **kwargs)
get_usernames(*args, **kwargs)
get_uuid(*args, **kwargs)
get_uuids(*args, **kwargs)
issue_commission_generic(*args, **kwargs)
issue_one_commission(*args, **kwargs)
issue_resource_reassignment(*args, **kwargs)
join_project(*args, **kwargs)
membership_action(*args, **kwargs)
mk_provisions(*args, **kwargs)
modify_project(*args, **kwargs)
project_action(*args, **kwargs)
reject_commission(*args, **kwargs)
resolve_commissions(*args, **kwargs)
send_feedback(*args, **kwargs)
service_get_project_quotas(*args, **kwargs)
service_get_quotas(*args, **kwargs)
service_get_username(*args, **kwargs)
service_get_usernames(*args, **kwargs)
service_get_uuid(*args, **kwargs)
service_get_uuids(*args, **kwargs)
user_info[source]
user_term(*args, **kwargs)[source]
validate_token(*args, **kwargs)
exception kamaki.clients.astakos.AstakosClientError(message='Astakos Client Error', details='', status=0)[source]

Bases: kamaki.clients.ClientError, astakosclient.errors.AstakosClientException

Join AstakosClientException as ClientError in one class

class kamaki.clients.astakos.CachedAstakosClient(*args, **kwargs)[source]

Bases: kamaki.clients.Client

Synnefo Astakos cached client wraper

authenticate(*args, **kwargs)[source]
get_client(token=None)[source]

Get the Synnefo AstakosClient instance used by client

get_endpoint_url(service_type, version=None, token=None)[source]
get_service_details(service_type, token=None)[source]
Parameters:service_type – (str) compute, object-store, image, account, etc.
Returns:(dict) {name:..., type:..., endpoints:[...]}
Raises AstakosClientError:
 if service_type not in service catalog
get_service_endpoints(service_type, version=None, token=None)[source]
Parameters:
  • service_type – (str) can be compute, object-store, etc.
  • version – (str) the version id of the service
Returns:

(dict) {SNF:uiURL, adminURL, internalURL, publicURL, ...}

Raises AstakosClientError:
 

if service_type not in service catalog, or if #matching endpoints != 1

get_services(token=None)[source]
Returns:(list) [{name:..., type:..., endpoints:[...]}, ...]
get_token(uuid)[source]
list_users()[source]

list cached users information

post_user_catalogs(uuids=None, displaynames=None, token=None)[source]

POST endpoint_url/user_catalogs

Parameters:
  • uuids – (list or tuple) user uuids
  • displaynames – (list or tuple) usernames (mut. excl. to uuids)
Returns:

(dict) {uuid1: name1, uuid2: name2, ...} or oposite

remove_user(uuid)[source]
service_type = 'identity'
term(key, token=None)[source]

Get (cached) term, from user credentials

user_info(token=None)[source]

Get (cached) user information

user_term(key, token=None)[source]

Get (cached) term, from user credentials

usernames2uuids(*args, **kwargs)[source]
uuids2usernames(*args, **kwargs)[source]
class kamaki.clients.astakos.LoggedAstakosClient(*args, **kwargs)[source]

Bases: kamaki.clients.astakos.AstakosClient

An AstakosClient wrapper with modified logging

Logs are adjusted to appear similar to the ones of kamaki clients. No other changes are made to the parent class.

LOG_DATA = False
LOG_TOKEN = False