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 0x7f8f58070a10>, 'force': <kamaki.cli.argument.FlagArgument object at 0x7f8f58070b10>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x7f8f58070910>, 'file_path': <kamaki.cli.argument.ValueArgument object at 0x7f8f58070a50>, 'accept': <kamaki.cli.argument.FlagArgument object at 0x7f8f58070b50>, 'description': <kamaki.cli.argument.ValueArgument object at 0x7f8f58070a90>}
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 0x7f8f58070790>, 'reject': <kamaki.cli.argument.CommaSeparatedListArgument object at 0x7f8f58070890>}
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 0x7f8f58070cd0>}
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 0x7f8f5807a490>}
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.in.domainlike.format, “owner”: user-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 - in ISO8601 format “end_date”: date, # in ISO8601 format e.g., YYYY-MM-DDThh:mm:ssZ “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 0x7f8f5807c210>, 'end_date': <kamaki.cli.argument.DateArgument object at 0x7f8f5807c450>, 'join_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7f8f5807c4d0>, 'resource_capacities': <kamaki.cli.cmds.astakos.ProjectResourceArgument object at 0x7f8f5807c550>, 'max_members': <kamaki.cli.argument.IntArgument object at 0x7f8f5807c350>, 'leave_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7f8f5807c510>, 'private': <kamaki.cli.argument.BooleanArgument object at 0x7f8f5807c390>, 'specs_path': <kamaki.cli.argument.ValueArgument object at 0x7f8f5807c110>, 'homepage_url': <kamaki.cli.argument.ValueArgument object at 0x7f8f5807c290>, 'owner_uuid': <kamaki.cli.argument.ValueArgument object at 0x7f8f5807c250>, 'start_date': <kamaki.cli.argument.DateArgument object at 0x7f8f5807c3d0>, 'description': <kamaki.cli.argument.ValueArgument object at 0x7f8f5807c2d0>}
description = 'Apply for a new project'
long_description = ' {\n "name": name.in.domainlike.format,\n "owner": user-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 - in ISO8601 format\n "end_date": date, # in ISO8601 format e.g., YYYY-MM-DDThh:mm:ssZ\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 0x7f8f5807ab90>}
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 0x7f8f58070f50>, 'state': <kamaki.cli.argument.ValueArgument object at 0x7f8f58070f10>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f8f58070ed0>, 'details': <kamaki.cli.argument.FlagArgument object at 0x7f8f58070e10>}
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.in.domainlike.format, “owner”: user-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 - in ISO8601 format “end_date”: date, # in ISO8601 format e.g., YYYY-MM-DDThh:mm:ssZ “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 0x7f8f5807c790>, 'end_date': <kamaki.cli.argument.DateArgument object at 0x7f8f5807ca90>, 'join_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7f8f5807cb10>, 'resource_capacities': <kamaki.cli.cmds.astakos.ProjectResourceArgument object at 0x7f8f5807cb90>, 'max_members': <kamaki.cli.argument.IntArgument object at 0x7f8f5807c8d0>, 'leave_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7f8f5807cb50>, 'private': <kamaki.cli.argument.FlagArgument object at 0x7f8f5807c910>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7f8f5807c990>, 'specs_path': <kamaki.cli.argument.ValueArgument object at 0x7f8f5807c6d0>, 'homepage_url': <kamaki.cli.argument.ValueArgument object at 0x7f8f5807c810>, 'owner_uuid': <kamaki.cli.argument.ValueArgument object at 0x7f8f5807c7d0>, 'start_date': <kamaki.cli.argument.DateArgument object at 0x7f8f5807ca10>, 'description': <kamaki.cli.argument.ValueArgument object at 0x7f8f5807c850>}
description = 'Modify properties of a project'
long_description = ' {\n "name": name.in.domainlike.format,\n "owner": user-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 - in ISO8601 format\n "end_date": date, # in ISO8601 format e.g., YYYY-MM-DDThh:mm:ssZ\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 0x7f8f58069150>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f58069110>, 'resource': <kamaki.cli.argument.ValueArgument object at 0x7f8f580690d0>}
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 0x7f8f580702d0>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x7f8f58070150>}
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 0x7f8f58070090>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x7f8f58069ed0>}
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 0x7f8f58069e10>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x7f8f58069d10>}
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 0x7f8f58069790>}
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 0x7f8f58069750>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x7f8f58069550>}
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 0x7f8f580698d0>}
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 0x7f8f54312910>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f8f543128d0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f8f541254d0>, 'vcpus': <kamaki.cli.argument.ValueArgument object at 0x7f8f54312950>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f8f54312810>, 'disk_template': <kamaki.cli.argument.ValueArgument object at 0x7f8f54312a50>, 'disk': <kamaki.cli.argument.ValueArgument object at 0x7f8f543129d0>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f8f54312890>}
description = 'List available hardware flavors'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.cyclades.server_attach(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Attach a volume on a VM

arguments = {'volume_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f54312ed0>}
description = 'Attach a volume on a VM'
long_description = ''
main(server_id)[source]
required = ('volume_id',)
syntax = '<server id> '
class kamaki.cli.cmds.cyclades.server_attachment(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Details on the attachment of a volume This is not information about the volume. To see volume information:

$ kamaki volume info VOLUME_ID
arguments = {'attachment_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f54312b50>}
description = 'Details on the attachment of a volume'
long_description = ' This is not information about the volume. To see volume information:\n $ kamaki volume info VOLUME_ID\n '
main(server_id)[source]
required = ('attachment_id',)
syntax = '<server id> '
class kamaki.cli.cmds.cyclades.server_attachments(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

List the volume attachments of a VM

description = 'List the volume attachments of a VM'
long_description = ''
main(server_id)[source]
syntax = '<server id> '
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 0x7f8f54238910>}
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 0x7f8f54171190>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x7f8f54171950>, 'network_configuration': <kamaki.cli.cmds.cyclades.NetworkArgument object at 0x7f8f541711d0>, 'server_name': <kamaki.cli.argument.ValueArgument object at 0x7f8f54171bd0>, 'metadata': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f54171110>, 'image_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f54171b90>, 'flavor_id': <kamaki.cli.argument.IntArgument object at 0x7f8f54171ad0>, 'cluster_size': <kamaki.cli.argument.IntArgument object at 0x7f8f54171990>, 'no_network': <kamaki.cli.argument.FlagArgument object at 0x7f8f54171210>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f8f541719d0>, 'personality': <kamaki.cli.cmds.cyclades.PersonalityArgument object at 0x7f8f54171350>}
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 0x7f8f54aef690>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f8f54069e90>}
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_detach(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Detach a volume from a VM

arguments = {'attachment_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f53f360d0>, 'volume_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f53f361d0>}
description = 'Detach a volume from a VM'
long_description = ''
main(server_id)[source]
required = ['attachment_id', 'volume_id']
syntax = '<server id> '
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 0x7f8f54171f90>, 'stats': <kamaki.cli.argument.FlagArgument object at 0x7f8f54171f10>, 'diagnostics': <kamaki.cli.argument.FlagArgument object at 0x7f8f54171ed0>}
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 0x7f8f54312590>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f8f54312450>, 'user_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f54312510>, 'since': <kamaki.cli.argument.DateArgument object at 0x7f8f54312390>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f8f543122d0>, 'image_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f543124d0>, 'meta': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f543125d0>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f8f543123d0>, 'flavor_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f54312490>, 'user_name': <kamaki.cli.argument.ValueArgument object at 0x7f8f54312550>, 'meta_like': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f54312610>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f8f54312410>}
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 0x7f8f545c58d0>, 'public_network_port_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f545c5890>, 'flavor_id': <kamaki.cli.argument.IntArgument object at 0x7f8f545c5050>, 'server_name': <kamaki.cli.argument.ValueArgument object at 0x7f8f545c5e10>, 'metadata_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f545c5110>, 'metadata_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f545c5090>}
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 0x7f8f54b3e050>}
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 0x7f8f54aef9d0>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f8f540df110>}
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 0x7f8f53f94810>}
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 0x7f8f540df290>}
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: –while BUILD)

arguments = {'status_w': <kamaki.cli.argument.StatusArgument object at 0x7f8f54125150>, 'status': <kamaki.cli.argument.StatusArgument object at 0x7f8f541250d0>, 'status_u': <kamaki.cli.argument.StatusArgument object at 0x7f8f541251d0>, 'timeout': <kamaki.cli.argument.IntArgument object at 0x7f8f54125850>}
description = 'Wait for server to change its status (default: --while 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 0x7f8f53e3a1d0>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e3a210>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f8f53e3a150>, 'versioning': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e3a050>}
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 0x7f8f53e3a2d0>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e3a3d0>}
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 0x7f8f53e3a450>}
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 0x7f8f53e357d0>, 'in_bytes': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e35810>, 'until_date': <kamaki.cli.argument.DateArgument object at 0x7f8f53e35690>, 'metadata': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e35790>}
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 0x7f8f53e35ed0>, 'modified_since_date': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e35cd0>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e35e90>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e35ad0>, 'shared_by_me': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e35f10>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f8f53e35c10>, 'shared': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e35e10>, 'marker': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e35c50>, 'until_date': <kamaki.cli.argument.DateArgument object at 0x7f8f53e35d90>, 'unmodified_since_date': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e35d10>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e35f50>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e35e50>}
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 0x7f8f53e35a10>, 'metadata_to_add': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f53e35910>, 'versioning': <kamaki.cli.cmds.pithos.VersioningArgument object at 0x7f8f53e35a50>, 'metadata_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f53e359d0>}
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 0x7f8f53e3a590>}
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 0x7f8f53e34050>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7f8f53e2bfd0>}
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 0x7f8f53e34f50>, 'if_none_match': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e34e10>, 'if_modified_since': <kamaki.cli.argument.DateArgument object at 0x7f8f53e34e90>, 'if_match': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e34c90>, 'if_unmodified_since': <kamaki.cli.argument.DateArgument object at 0x7f8f53e34ed0>, 'range': <kamaki.cli.cmds.pithos.RangeArgument object at 0x7f8f53e34cd0>, 'buffer_blocks': <kamaki.cli.argument.IntArgument object at 0x7f8f53e34f90>}
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 0x7f8f53e2bc10>, 'public': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e2bb50>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e2bbd0>}
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 0x7f8f53e2b350>}
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 0x7f8f53e2b5d0>, 'delimiter': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e2b7d0>, 'yes': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e2b710>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e2b750>}
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 remote file or directory object to local file system

arguments = {'object_version': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e35390>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x7f8f53e353d0>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e35490>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7f8f53e35410>, 'modified_since_date': <kamaki.cli.argument.DateArgument object at 0x7f8f53e352d0>, 'resume': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e350d0>, 'range': <kamaki.cli.cmds.pithos.RangeArgument object at 0x7f8f53e351d0>, 'non_matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e35290>, 'unmodified_since_date': <kamaki.cli.argument.DateArgument object at 0x7f8f53e35310>, 'matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e35210>}
description = 'Download a remote 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 0x7f8f53b1f5d0>, 'sharing': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e25690>, 'hashmap': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e254d0>, 'versions': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e25750>, 'modified_since_date': <kamaki.cli.argument.DateArgument object at 0x7f8f53e255d0>, 'non_matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e25590>, 'unmodified_since_date': <kamaki.cli.argument.DateArgument object at 0x7f8f53e25610>, 'matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e25510>, 'metadata': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e256d0>}
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 0x7f8f53e25dd0>, 'format': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e25c50>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e25d90>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e258d0>, 'shared_by_me': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e25c90>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e25cd0>, 'delimiter': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e25a50>, 'meta': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e25ad0>, 'if_modified_since': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e25b10>, 'marker': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e259d0>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f8f53e25990>, 'if_unmodified_since': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e25b50>, 'until': <kamaki.cli.argument.DateArgument object at 0x7f8f53e25bd0>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e25d50>}
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 0x7f8f53e25f90>, 'no_permissions': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e25fd0>, 'metadata_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f53e2b050>, 'metadata_key_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f53e2b090>, 'uuid_for_read_permission': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f53e25e90>}
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 0x7f8f53e2be50>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e2bdd0>}
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 0x7f8f53e34610>, 'end_position': <kamaki.cli.argument.IntArgument object at 0x7f8f53e34590>, 'start_position': <kamaki.cli.argument.IntArgument object at 0x7f8f53e34510>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7f8f53e343d0>}
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 0x7f8f53e34250>}
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 0x7f8f53e34b90>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x7f8f53e34710>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e34b50>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7f8f53e34a90>, 'uuid_for_write_permission': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f53e34a10>, 'md5_checksum': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e34bd0>, 'uuid_for_read_permission': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f53e349d0>, 'content_encoding': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e34790>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e34950>, 'use_hashes': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e34c10>, 'content_disposition': <kamaki.cli.argument.ValueArgument object at 0x7f8f53e348d0>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e34a50>, 'overwrite': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e34b10>}
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 0x7f8f53e3acd0>, 'user_uuid': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f53e3abd0>}
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 0x7f8f53e3a850>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f8f53e3a710>}
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.image_info(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Get image metadata

arguments = {'hashmap': <kamaki.cli.argument.FlagArgument object at 0x7f8f530a8650>}
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 0x7f8f530a8250>, 'image_ID_for_members': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a84d0>, 'owner_name': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a82d0>, 'prop_like': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f530a8490>, 'size_max': <kamaki.cli.argument.IntArgument object at 0x7f8f530a81d0>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f8f530a8410>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a80d0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f8f530c1f50>, 'prop': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f530a8450>, 'size_min': <kamaki.cli.argument.IntArgument object at 0x7f8f530a8150>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f8f530a8390>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a8050>, 'owner': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a8290>, 'order': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a8350>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f8f530a83d0>}
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 0x7f8f530a88d0>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a8850>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a8810>, 'image_name': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a8710>, 'publish': <kamaki.cli.argument.FlagArgument object at 0x7f8f530a8910>, 'unpublish': <kamaki.cli.argument.FlagArgument object at 0x7f8f530a8990>, 'property_to_del': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f530a8a50>, 'member_ID_to_remove': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f530a8ad0>, 'property_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f530a8a10>, 'member_ID_to_add': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f530a8a90>}
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 0x7f8f530a8d50>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a8c90>, 'no_metafile_upload': <kamaki.cli.argument.FlagArgument object at 0x7f8f530a8f90>, 'is_public': <kamaki.cli.argument.FlagArgument object at 0x7f8f530a8e10>, 'force_upload': <kamaki.cli.argument.FlagArgument object at 0x7f8f530a8f50>, 'properties': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f530a8dd0>, 'size': <kamaki.cli.argument.IntArgument object at 0x7f8f530a8e90>, 'container': <kamaki.cli.argument.ValueArgument object at 0x7f8f52f58050>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x7f8f52f58090>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7f8f52f58110>, 'metafile': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a8f10>, 'local_image_path': <kamaki.cli.argument.ValueArgument object at 0x7f8f52f580d0>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a8d10>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f8f52f58190>, 'pithos_location': <kamaki.cli.argument.PithosLocationArgument object at 0x7f8f52f58210>, 'checksum': <kamaki.cli.argument.ValueArgument object at 0x7f8f530a8b90>}
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 0x7f8f52f585d0>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f8f52f58590>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f8f52f58390>, 'meta': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f52f58650>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f8f52f584d0>, 'user_name': <kamaki.cli.argument.ValueArgument object at 0x7f8f52f58610>, 'meta_like': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f52f58690>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f8f52f58550>}
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 0x7f8f52f58a50>, 'property_to_add': <kamaki.cli.argument.KeyValueArgument object at 0x7f8f52f58950>}
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 0x7f8f53593e90>, 'server_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f53593f50>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f8f53593ed0>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f8f53593d50>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f53593e50>}
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 0x7f8f53593850>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f53593a50>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x7f8f535939d0>}
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 0x7f8f536f4050>}
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 0x7f8f53593ad0>}
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 0x7f8f536f4190>, 'subnet_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f536f42d0>, 'device_id': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f536f43d0>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x7f8f536f4310>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f8f536f4350>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f536f4290>}
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 0x7f8f53753490>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f536f9d10>, 'network_type': <kamaki.cli.cmds.network.NetworkTypeArgument object at 0x7f8f536f9110>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f8f5331ed90>}
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 0x7f8f536f4590>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f8f536f4450>}
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 0x7f8f53753910>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f8f537535d0>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f8f53753f10>}
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 0x7f8f53575110>}
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 0x7f8f536f9050>}
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 0x7f8f53593310>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f8f53593190>, 'device_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f53593410>, 'network_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f535933d0>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f8f53593450>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x7f8f53593350>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x7f8f535932d0>}
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 0x7f8f53575e50>}
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 0x7f8f53575cd0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f8f53575b10>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f8f53575c50>}
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 0x7f8f53575fd0>}
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: –while BUILD)

arguments = {'status_w': <kamaki.cli.argument.StatusArgument object at 0x7f8f53593690>, 'status': <kamaki.cli.argument.StatusArgument object at 0x7f8f53593650>, 'status_u': <kamaki.cli.argument.StatusArgument object at 0x7f8f535936d0>, 'timeout': <kamaki.cli.argument.IntArgument object at 0x7f8f53593550>}
description = 'Wait for port to finish (default: --while 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 0x7f8f535756d0>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f8f53575550>, 'enable_dhcp': <kamaki.cli.argument.FlagArgument object at 0x7f8f53575810>, 'network_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f53575890>, 'subnet_id': <kamaki.cli.argument.ValueArgument object at 0x7f8f53575750>, 'allocation_pools': <kamaki.cli.cmds.network.AllocationPoolArgument object at 0x7f8f53575650>, 'ipv6': <kamaki.cli.argument.FlagArgument object at 0x7f8f535757d0>, 'cidr': <kamaki.cli.argument.ValueArgument object at 0x7f8f535758d0>, 'gateway': <kamaki.cli.argument.ValueArgument object at 0x7f8f53575690>}
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 0x7f8f53575250>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f8f53575390>}
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 0x7f8f53575950>}
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 0x7f8f52d55650>}
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

arguments = {'with_description': <kamaki.cli.argument.FlagArgument object at 0x7f8f52d55390>, 'describe_options': <kamaki.cli.argument.FlagArgument object at 0x7f8f52d552d0>}
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 endpoint(this, func)[source]

If the endpoint contains server_id, check if the id exists

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, display_name, server_id=None, 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

volume_attachment_delete(server_id, attachment_id, **kwargs)[source]
volume_attachment_get(server_id, attachment_id=None, **kwargs)[source]
volume_attachment_post(server_id, volume_id, **kwargs)[source]
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=None, display_description=None)[source]
Returns:(dict) new snapshots’ details
create_volume(size, display_name, server_id=None, 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')
attach_volume(server_id, volume_id)[source]

Attach volume on server :param server_id: (str) :volume_id: (str) :returns: (dict) information on attachment (contains volumeId)

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 ‘apply the default server policy’, empty list means ‘do not attach a network’
  • project_id – the project where to assign the server
Returns:

a dict with the new virtual server details

Raises ClientError:
 

wraps request errors

delete_volume_attachment(server_id, attachment_id)[source]

Delete a volume attachment. The volume will not be deleted. :param server_id: (str) :param attachment_id: (str) :returns: (dict) HTTP response headers

detach_volume(server_id, volume_id)[source]

Remove volume attachment(s) for this volume and server This is not an atomic operation. Use “delete_volume_attachment” for an atomic operation with similar semantics. :param server_id: (str) :param volume_id: (str) :returns: (list) the deleted attachments

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)
get_server_status(server_id)[source]

Deprecated - will be removed in version 0.15 :returns: (current status, progress percentile if available)

get_volume_attachment(server_id, attachment_id)[source]
Parameters:
  • server_id – (str)
  • attachment_id – (str)
Returns:

(dict) details on the volume attachment

list_volume_attachments(server_id)[source]
Parameters:server_id – (str)
Returns:(list) all volume attachments for this server
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)

Wait for server WHILE its status is current_status :param server_id: integer (str or int) :param current_status: (str) BUILD|ACTIVE|STOPPED|DELETED|REBOOT :param delay: time interval between retries :max_wait: (int) timeout in secconds :param wait_cb: if set a progressbar is used to show progress :returns: (str) the new mode if succesfull, (bool) False if timed out

wait_server_until(server_id, target_status='ACTIVE', delay=1, max_wait=100, wait_cb=None)[source]

Wait for server WHILE its status is target_status :param server_id: integer (str or int) :param target_status: (str) BUILD|ACTIVE|STOPPED|DELETED|REBOOT :param delay: time interval between retries :max_wait: (int) timeout in secconds :param wait_cb: if set a progressbar is used to show progress :returns: (str) the new mode if succesfull, (bool) False if timed out

wait_server_while(server_id, current_status='BUILD', delay=1, max_wait=100, wait_cb=None)[source]

Wait for server WHILE its status is current_status :param server_id: integer (str or int) :param current_status: (str) BUILD|ACTIVE|STOPPED|DELETED|REBOOT :param delay: time interval between retries :max_wait: (int) timeout in secconds :param wait_cb: if set a progressbar is used to show progress :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, headers={})[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
  • headers – (dict) placeholder to gather object headers
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, remote_block_info=None, hashmap=None, headers={})[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
  • remote_block_info – (tuple) blocksize, blockhas, total_size and hash_list
  • hashmap – (dict) the remote object hashmap, if it is available e.g., from another call. Used for minimizing HEAD container requests
  • headers – (dict) a placeholder dict to gather object headers
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, headers={})[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

stream_down(obj, dst, buffer_blocks=4, **kwargs)[source]
Download obj to dst as a stream. Buffer-sized chunks are downloaded
sequentially, but the blocks of each chunk are downloaded asynchronously, using the download_to_string method
Parameters:
  • obj – (str) the remote object
  • dst – a file descriptor allowing sequential writing
  • buffer_blocks – (int) the size of the buffer in blocks. If it is 1, all blocks will be downloaded sequentially
  • kwargs – (dict) keyword arguments for download_to_string method
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, target_account=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)
  • target_account – (str) the UUID of the account the object will be allocated at, if different to the client account (e.g., when user A uploads something to a location owned by user B)
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

use_alternative_account(func, *args, **kwargs)[source]

Run method with an alternative account UUID, as long as kwargs contain a non-None “alternative_account” argument

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_port_status(port_id)[source]

Deprecated, will be removed in version 0.15

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)

Wait for port while in current_status

wait_port_until(port_id, target_status='BUILD', delay=1, max_wait=100, wait_cb=None)[source]

Wait for port while in current_status

wait_port_while(port_id, current_status='BUILD', delay=1, max_wait=100, wait_cb=None)[source]

Wait for port while in current_status

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)

Accept a commission (see commission_action)

application_action(*args, **kwargs)

Perform action on a project application

Arguments: project_id – project identifier app_id – application identifier action – action to perform, one of “approve”, “deny”,

“dismiss”, “cancel”

reason – reason of performing the action

In case of success, return nothing.

authenticate(*args, **kwargs)

Authenticate and get services’ endpoints

Keyword arguments: tenant_name – user’s uniq id (optional)

It returns back the token as well as information about the token holder and the services he/she can access (in json format).

The tenant_name is optional and if it is given it must match the user’s uuid.

In case of error raise an AstakosClientException.

commission_action(*args, **kwargs)

Perform a commission action

Keyword arguments: serial – commission’s id (int) action – action to perform, currently accept/reject (string)

In case of success return nothing.

create_project(*args, **kwargs)

Submit application to create a new project

Arguments: specs – dict describing a project

In case of success, return project and application identifiers.

enroll_member(*args, **kwargs)

Enroll a user in a project

Arguments: project_id – project identifier email – user identified by email

In case of success, return membership identifier.

get_commission_info(*args, **kwargs)

Get Description of a Commission

Keyword arguments: serial – commission’s id (int)

In case of success return a dict of dicts containing informations (details) about the requested commission

get_endpoint_url(*args, **kwargs)[source]
get_endpoints(*args, **kwargs)

Get services’ endpoints

The extra parameter is to be used by _fill_endpoints. In case of error raise an AstakosClientException.

get_membership(*args, **kwargs)

Retrieve membership description, if accessible

Arguments: memb_id – membership identifier

In case of success, return membership description.

get_memberships(*args, **kwargs)

Retrieve all accessible memberships

Arguments: project_id – filter by project (optional) project – backwards compatibility

In case of success, return a list of membership descriptions.

get_pending_commissions(*args, **kwargs)

Get Pending Commissions

In case of success return a list of pending commissions’ ids (list of integers)

get_project(*args, **kwargs)

Retrieve project description, if accessible

Arguments: project_id – project identifier

In case of success, return project description.

get_projects(*args, **kwargs)

Retrieve all accessible projects

Arguments: name – filter by name (optional) state – filter by state (optional) owner – filter by owner (optional) mode – if value is ‘member’, return only active projects in which

the request user is an active member

In case of success, return a list of project descriptions.

get_quotas(*args, **kwargs)

Get user’s quotas

In case of success return a dict of dicts with user’s current quotas. Otherwise raise an AstakosClientException

get_resources(*args, **kwargs)

Return a dict of dicts with the available resources

get_service_endpoints(*args, **kwargs)[source]
get_services(*args, **kwargs)

Return a list of dicts with the registered services

get_token(*args, **kwargs)
get_username(*args, **kwargs)

Return the user name of a uuid (see get_usernames)

get_usernames(*args, **kwargs)

Return a uuid_catalog dictionary for the given uuids

Keyword arguments: uuids – list of user ids (list of strings)

The returned uuid_catalog is a dictionary with uuids as keys and the corresponding user names as values

get_uuid(*args, **kwargs)

Return the uuid of a name (see getUUIDs)

get_uuids(*args, **kwargs)

Return a displayname_catalog for the given names

Keyword arguments: display_names – list of user names (list of strings)

The returned displayname_catalog is a dictionary with the names as keys and the corresponding uuids as values

issue_commission_generic(*args, **kwargs)

Issue commission (for multiple holder/source pairs)

keyword arguments: user_provisions – dict mapping user holdings

(user, project, resource) to integer quantities
project_provisions – dict mapping project holdings
(project, resource) to integer quantities

name – description of the commission (string) force – force this commission (boolean) auto_accept – auto accept this commission (boolean)

In case of success return commission’s id (int). Otherwise raise an AstakosClientException.

issue_one_commission(*args, **kwargs)

Issue one commission (with specific holder and source)

keyword arguments: holder – user’s id (string) provisions – (source, resource) mapping to quantity name – description of the commission (string) force – force this commission (boolean) auto_accept – auto accept this commission (boolean)

In case of success return commission’s id (int). Otherwise raise an AstakosClientException.

issue_resource_reassignment(*args, **kwargs)

Change resource assignment to another project

join_project(*args, **kwargs)

Join a project

Arguments: project_id – project identifier

In case of success, return membership identifier.

membership_action(*args, **kwargs)

Perform action on a membership

Arguments: memb_id – membership identifier action – action to perform, one of “leave”, “cancel”, “accept”,

“reject”, “remove”

reason – reason of performing the action

In case of success, return nothing.

mk_provisions(*args, **kwargs)
modify_project(*args, **kwargs)

Submit application to modify an existing project

Arguments: project_id – project identifier specs – dict describing a project

In case of success, return project and application identifiers.

project_action(*args, **kwargs)

Perform action on a project

Arguments: project_id – project identifier action – action to perform, one of “suspend”, “unsuspend”,

“terminate”, “reinstate”

reason – reason of performing the action

In case of success, return nothing.

reject_commission(*args, **kwargs)

Reject a commission (see commission_action)

resolve_commissions(*args, **kwargs)

Resolve multiple commissions at once

Keyword arguments: accept_serials – commissions to accept (list of ints) reject_serials – commissions to reject (list of ints)

In case of success return a dict of dicts describing which commissions accepted, which rejected and which failed to resolved.

send_feedback(*args, **kwargs)

Send feedback to astakos service

keyword arguments: message – Feedback message data – Additional information about service client status

In case of success return nothing. Otherwise raise an AstakosClientException

service_get_project_quotas(*args, **kwargs)

Get all project quotas for resources associated with the service

Keyword arguments: project – optionally, the uuid of a specific project, or a list

thereof

In case of success return a dict of dicts with current quotas for all projects, or of a specified project, if project argument is set. Otherwise raise an AstakosClientException

service_get_quotas(*args, **kwargs)

Get all quotas for resources associated with the service

Keyword arguments: user – optionally, the uuid of a specific user, or a list thereof project_id – optionally, the uuid of a specific project, or a list

thereof

project – backwards compatibility (replaced by “project_id”)

In case of success return a dict of dicts of dicts with current quotas for all users, or of a specified user, if user argument is set. Otherwise raise an AstakosClientException

service_get_username(*args, **kwargs)

Return the displayName of a uuid using a service’s token

service_get_usernames(*args, **kwargs)

Return a uuid_catalog dict using a service’s token

service_get_uuid(*args, **kwargs)

Return the uuid of a name using a service’s token

service_get_uuids(*args, **kwargs)

Return a display_name catalog using a service’s token

user_info[source]
user_term(*args, **kwargs)[source]
validate_token(*args, **kwargs)

Validate a temporary access token (oath2)

Keyword arguments: belongsTo – confirm that token belongs to tenant

It returns back the token as well as information about the token holder.

The belongs_to is optional and if it is given it must be inside the token’s scope.

In case of error raise an AstakosClientException.

exception kamaki.clients.astakos.AstakosClientError(message, status=0, details=None)[source]

Bases: kamaki.clients.ClientError

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

Bases: kamaki.clients.Client

Synnefo Astakos cached client wraper

authenticate(*args, **kwargs)[source]

Get authentication information and store it in this client As long as the CachedAstakosClient instance is alive, the latest authentication information for this token will be available

Parameters:token – (str) custom token to authenticate
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, kamaki.clients.Logged

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.

kamaki.clients.astakos.mk_astakosclienterror(sace)[source]

Make an AstakosClientError from an AstakosClientException