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 0x7fd62262ca10>, 'force': <kamaki.cli.argument.FlagArgument object at 0x7fd62262cb10>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x7fd62262c910>, 'file_path': <kamaki.cli.argument.ValueArgument object at 0x7fd62262ca50>, 'accept': <kamaki.cli.argument.FlagArgument object at 0x7fd62262cb50>, 'description': <kamaki.cli.argument.ValueArgument object at 0x7fd62262ca90>}
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 0x7fd62262c790>, 'reject': <kamaki.cli.argument.CommaSeparatedListArgument object at 0x7fd62262c890>}
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 0x7fd62262ccd0>}
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 0x7fd622635490>}
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 0x7fd622630210>, 'end_date': <kamaki.cli.argument.DateArgument object at 0x7fd622630450>, 'join_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7fd6226304d0>, 'resource_capacities': <kamaki.cli.cmds.astakos.ProjectResourceArgument object at 0x7fd622630550>, 'max_members': <kamaki.cli.argument.IntArgument object at 0x7fd622630350>, 'leave_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7fd622630510>, 'private': <kamaki.cli.argument.BooleanArgument object at 0x7fd622630390>, 'specs_path': <kamaki.cli.argument.ValueArgument object at 0x7fd622630110>, 'homepage_url': <kamaki.cli.argument.ValueArgument object at 0x7fd622630290>, 'owner_uuid': <kamaki.cli.argument.ValueArgument object at 0x7fd622630250>, 'start_date': <kamaki.cli.argument.DateArgument object at 0x7fd6226303d0>, 'description': <kamaki.cli.argument.ValueArgument object at 0x7fd6226302d0>}
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 0x7fd622635b90>}
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 0x7fd62262cf50>, 'state': <kamaki.cli.argument.ValueArgument object at 0x7fd62262cf10>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7fd62262ced0>, 'details': <kamaki.cli.argument.FlagArgument object at 0x7fd62262ce10>}
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 0x7fd622630790>, 'end_date': <kamaki.cli.argument.DateArgument object at 0x7fd622630a90>, 'join_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7fd622630b10>, 'resource_capacities': <kamaki.cli.cmds.astakos.ProjectResourceArgument object at 0x7fd622630b90>, 'max_members': <kamaki.cli.argument.IntArgument object at 0x7fd6226308d0>, 'leave_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7fd622630b50>, 'private': <kamaki.cli.argument.FlagArgument object at 0x7fd622630910>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7fd622630990>, 'specs_path': <kamaki.cli.argument.ValueArgument object at 0x7fd6226306d0>, 'homepage_url': <kamaki.cli.argument.ValueArgument object at 0x7fd622630810>, 'owner_uuid': <kamaki.cli.argument.ValueArgument object at 0x7fd6226307d0>, 'start_date': <kamaki.cli.argument.DateArgument object at 0x7fd622630a10>, 'description': <kamaki.cli.argument.ValueArgument object at 0x7fd622630850>}
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 0x7fd622622150>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7fd622622110>, 'resource': <kamaki.cli.argument.ValueArgument object at 0x7fd6226220d0>}
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 0x7fd62262c2d0>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x7fd62262c150>}
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 0x7fd62262c090>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x7fd622622ed0>}
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 0x7fd622622e10>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x7fd622622d10>}
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 0x7fd622622790>}
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 0x7fd622622750>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x7fd622622550>}
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 0x7fd6226228d0>}
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 0x7fd61e88f910>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7fd61e88f8d0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7fd61e6bd4d0>, 'vcpus': <kamaki.cli.argument.ValueArgument object at 0x7fd61e88f950>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7fd61e88f810>, 'disk_template': <kamaki.cli.argument.ValueArgument object at 0x7fd61e88fa50>, 'disk': <kamaki.cli.argument.ValueArgument object at 0x7fd61e88f9d0>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7fd61e88f890>}
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 0x7fd61e88fed0>}
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 0x7fd61e88fb50>}
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 0x7fd61e7b4910>}
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 0x7fd61e79f190>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x7fd61e79f950>, 'network_configuration': <kamaki.cli.cmds.cyclades.NetworkArgument object at 0x7fd61e79f1d0>, 'server_name': <kamaki.cli.argument.ValueArgument object at 0x7fd61e79fbd0>, 'metadata': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61e79f110>, 'image_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61e79fb90>, 'flavor_id': <kamaki.cli.argument.IntArgument object at 0x7fd61e79fad0>, 'cluster_size': <kamaki.cli.argument.IntArgument object at 0x7fd61e79f990>, 'no_network': <kamaki.cli.argument.FlagArgument object at 0x7fd61e79f210>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7fd61e79f9d0>, 'personality': <kamaki.cli.cmds.cyclades.PersonalityArgument object at 0x7fd61e79f350>}
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 0x7fd61f06b690>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7fd61e5e5e90>}
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 0x7fd61e8620d0>, 'volume_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61e8621d0>}
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 0x7fd61e79ff90>, 'stats': <kamaki.cli.argument.FlagArgument object at 0x7fd61e79ff10>, 'diagnostics': <kamaki.cli.argument.FlagArgument object at 0x7fd61e79fed0>}
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 0x7fd61e88f590>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7fd61e88f450>, 'user_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61e88f510>, 'since': <kamaki.cli.argument.DateArgument object at 0x7fd61e88f390>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7fd61e88f2d0>, 'image_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61e88f4d0>, 'meta': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61e88f5d0>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7fd61e88f3d0>, 'flavor_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61e88f490>, 'user_name': <kamaki.cli.argument.ValueArgument object at 0x7fd61e88f550>, 'meta_like': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61e88f610>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7fd61e88f410>}
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 0x7fd61eb448d0>, 'public_network_port_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61eb44890>, 'flavor_id': <kamaki.cli.argument.IntArgument object at 0x7fd61eb44050>, 'server_name': <kamaki.cli.argument.ValueArgument object at 0x7fd61eb44e10>, 'metadata_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61eb44110>, 'metadata_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61eb44090>}
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 0x7fd61f0ba050>}
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 0x7fd61f06b9d0>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7fd61e65e110>}
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 0x7fd61e511810>}
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 0x7fd61e65e290>}
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 0x7fd61e6bd150>, 'status': <kamaki.cli.argument.StatusArgument object at 0x7fd61e6bd0d0>, 'status_u': <kamaki.cli.argument.StatusArgument object at 0x7fd61e6bd1d0>, 'timeout': <kamaki.cli.argument.IntArgument object at 0x7fd61e6bd850>}
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 0x7fd61e4361d0>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61e436210>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7fd61e436150>, 'versioning': <kamaki.cli.argument.ValueArgument object at 0x7fd61e436050>}
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 0x7fd61e4362d0>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7fd61e4363d0>}
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 0x7fd61e436450>}
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 0x7fd61e4327d0>, 'in_bytes': <kamaki.cli.argument.FlagArgument object at 0x7fd61e432810>, 'until_date': <kamaki.cli.argument.DateArgument object at 0x7fd61e432690>, 'metadata': <kamaki.cli.argument.FlagArgument object at 0x7fd61e432790>}
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 0x7fd61e432ed0>, 'modified_since_date': <kamaki.cli.argument.ValueArgument object at 0x7fd61e432cd0>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7fd61e432e90>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7fd61e432ad0>, 'shared_by_me': <kamaki.cli.argument.FlagArgument object at 0x7fd61e432f10>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7fd61e432c10>, 'shared': <kamaki.cli.argument.FlagArgument object at 0x7fd61e432e10>, 'marker': <kamaki.cli.argument.ValueArgument object at 0x7fd61e432c50>, 'until_date': <kamaki.cli.argument.DateArgument object at 0x7fd61e432d90>, 'unmodified_since_date': <kamaki.cli.argument.ValueArgument object at 0x7fd61e432d10>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7fd61e432f50>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7fd61e432e50>}
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 0x7fd61e432a10>, 'metadata_to_add': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61e432910>, 'versioning': <kamaki.cli.cmds.pithos.VersioningArgument object at 0x7fd61e432a50>, 'metadata_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61e4329d0>}
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 0x7fd61e436590>}
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 0x7fd61e431050>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7fd61e427fd0>}
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 0x7fd61e431f50>, 'if_none_match': <kamaki.cli.argument.ValueArgument object at 0x7fd61e431e10>, 'if_modified_since': <kamaki.cli.argument.DateArgument object at 0x7fd61e431e90>, 'if_match': <kamaki.cli.argument.ValueArgument object at 0x7fd61e431c90>, 'if_unmodified_since': <kamaki.cli.argument.DateArgument object at 0x7fd61e431ed0>, 'range': <kamaki.cli.cmds.pithos.RangeArgument object at 0x7fd61e431cd0>, 'buffer_blocks': <kamaki.cli.argument.IntArgument object at 0x7fd61e431f90>}
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 0x7fd61e427c10>, 'public': <kamaki.cli.argument.ValueArgument object at 0x7fd61e427b50>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x7fd61e427bd0>}
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 0x7fd61e427350>}
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 0x7fd61e4275d0>, 'delimiter': <kamaki.cli.argument.ValueArgument object at 0x7fd61e4277d0>, 'yes': <kamaki.cli.argument.FlagArgument object at 0x7fd61e427710>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7fd61e427750>}
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 0x7fd61e432390>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x7fd61e4323d0>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7fd61e432490>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7fd61e432410>, 'modified_since_date': <kamaki.cli.argument.DateArgument object at 0x7fd61e4322d0>, 'resume': <kamaki.cli.argument.FlagArgument object at 0x7fd61e4320d0>, 'range': <kamaki.cli.cmds.pithos.RangeArgument object at 0x7fd61e4321d0>, 'non_matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7fd61e432290>, 'unmodified_since_date': <kamaki.cli.argument.DateArgument object at 0x7fd61e432310>, 'matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7fd61e432210>}
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 0x7fd61e09b5d0>, 'sharing': <kamaki.cli.argument.FlagArgument object at 0x7fd61e422690>, 'hashmap': <kamaki.cli.argument.FlagArgument object at 0x7fd61e4224d0>, 'versions': <kamaki.cli.argument.FlagArgument object at 0x7fd61e422750>, 'modified_since_date': <kamaki.cli.argument.DateArgument object at 0x7fd61e4225d0>, 'non_matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7fd61e422590>, 'unmodified_since_date': <kamaki.cli.argument.DateArgument object at 0x7fd61e422610>, 'matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7fd61e422510>, 'metadata': <kamaki.cli.argument.FlagArgument object at 0x7fd61e4226d0>}
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 0x7fd61e422dd0>, 'format': <kamaki.cli.argument.ValueArgument object at 0x7fd61e422c50>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7fd61e422d90>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7fd61e4228d0>, 'shared_by_me': <kamaki.cli.argument.FlagArgument object at 0x7fd61e422c90>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7fd61e422cd0>, 'delimiter': <kamaki.cli.argument.ValueArgument object at 0x7fd61e422a50>, 'meta': <kamaki.cli.argument.ValueArgument object at 0x7fd61e422ad0>, 'if_modified_since': <kamaki.cli.argument.ValueArgument object at 0x7fd61e422b10>, 'marker': <kamaki.cli.argument.ValueArgument object at 0x7fd61e4229d0>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7fd61e422990>, 'if_unmodified_since': <kamaki.cli.argument.ValueArgument object at 0x7fd61e422b50>, 'until': <kamaki.cli.argument.DateArgument object at 0x7fd61e422bd0>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7fd61e422d50>}
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 0x7fd61e422f90>, 'no_permissions': <kamaki.cli.argument.FlagArgument object at 0x7fd61e422fd0>, 'metadata_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61e427050>, 'metadata_key_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61e427090>, 'uuid_for_read_permission': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61e422e90>}
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 0x7fd61e427e50>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x7fd61e427dd0>}
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 0x7fd61e431610>, 'end_position': <kamaki.cli.argument.IntArgument object at 0x7fd61e431590>, 'start_position': <kamaki.cli.argument.IntArgument object at 0x7fd61e431510>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7fd61e4313d0>}
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 0x7fd61e431250>}
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 0x7fd61e431b90>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x7fd61e431710>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7fd61e431b50>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7fd61e431a90>, 'uuid_for_write_permission': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61e431a10>, 'md5_checksum': <kamaki.cli.argument.ValueArgument object at 0x7fd61e431bd0>, 'uuid_for_read_permission': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61e4319d0>, 'content_encoding': <kamaki.cli.argument.ValueArgument object at 0x7fd61e431790>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x7fd61e431950>, 'use_hashes': <kamaki.cli.argument.FlagArgument object at 0x7fd61e431c10>, 'content_disposition': <kamaki.cli.argument.ValueArgument object at 0x7fd61e4318d0>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7fd61e431a50>, 'overwrite': <kamaki.cli.argument.FlagArgument object at 0x7fd61e431b10>}
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 0x7fd61e436cd0>, 'user_uuid': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61e436bd0>}
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 0x7fd61e436850>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7fd61e436710>}
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 0x7fd61d61c650>}
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 0x7fd61d61c250>, 'image_ID_for_members': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61c4d0>, 'owner_name': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61c2d0>, 'prop_like': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61d61c490>, 'size_max': <kamaki.cli.argument.IntArgument object at 0x7fd61d61c1d0>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7fd61d61c410>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61c0d0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7fd61d63df50>, 'prop': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61d61c450>, 'size_min': <kamaki.cli.argument.IntArgument object at 0x7fd61d61c150>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7fd61d61c390>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61c050>, 'owner': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61c290>, 'order': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61c350>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7fd61d61c3d0>}
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 0x7fd61d61c8d0>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61c850>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61c810>, 'image_name': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61c710>, 'publish': <kamaki.cli.argument.FlagArgument object at 0x7fd61d61c910>, 'unpublish': <kamaki.cli.argument.FlagArgument object at 0x7fd61d61c990>, 'property_to_del': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61d61ca50>, 'member_ID_to_remove': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61d61cad0>, 'property_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61d61ca10>, 'member_ID_to_add': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61d61ca90>}
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 0x7fd61d61cd50>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61cc90>, 'no_metafile_upload': <kamaki.cli.argument.FlagArgument object at 0x7fd61d61cf90>, 'is_public': <kamaki.cli.argument.FlagArgument object at 0x7fd61d61ce10>, 'force_upload': <kamaki.cli.argument.FlagArgument object at 0x7fd61d61cf50>, 'properties': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61d61cdd0>, 'size': <kamaki.cli.argument.IntArgument object at 0x7fd61d61ce90>, 'container': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61a050>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61a090>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7fd61d61a110>, 'metafile': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61cf10>, 'local_image_path': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61a0d0>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61cd10>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61a190>, 'pithos_location': <kamaki.cli.argument.PithosLocationArgument object at 0x7fd61d61a210>, 'checksum': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61cb90>}
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 0x7fd61d61a5d0>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7fd61d61a590>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7fd61d61a390>, 'meta': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61d61a650>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7fd61d61a4d0>, 'user_name': <kamaki.cli.argument.ValueArgument object at 0x7fd61d61a610>, 'meta_like': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61d61a690>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7fd61d61a550>}
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 0x7fd61d61aa50>, 'property_to_add': <kamaki.cli.argument.KeyValueArgument object at 0x7fd61d61a950>}
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 0x7fd61ddc4e90>, 'server_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddc4f50>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7fd61ddc4ed0>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddc4d50>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61ddc4e50>}
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 0x7fd61ddc4850>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddc4a50>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddc49d0>}
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 0x7fd61dd69050>}
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 0x7fd61ddc4ad0>}
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 0x7fd61dd69190>, 'subnet_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61dd692d0>, 'device_id': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61dd693d0>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x7fd61dd69310>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7fd61dd69350>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61dd69290>}
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 0x7fd61dc79550>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61dd5bd10>, 'network_type': <kamaki.cli.cmds.network.NetworkTypeArgument object at 0x7fd61dd5b110>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7fd61d89ad90>}
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 0x7fd61dd69590>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7fd61dd69450>}
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 0x7fd61dc79950>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7fd61dc798d0>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7fd61dc79bd0>}
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 0x7fd61ddcb110>}
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 0x7fd61dd5b050>}
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 0x7fd61ddc4310>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddc4190>, 'device_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddc4410>, 'network_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddc43d0>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7fd61ddc4450>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddc4350>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x7fd61ddc42d0>}
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 0x7fd61ddcbe50>}
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 0x7fd61ddcbcd0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7fd61ddcbb10>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7fd61ddcbc50>}
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 0x7fd61ddcbfd0>}
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 0x7fd61ddc4690>, 'status': <kamaki.cli.argument.StatusArgument object at 0x7fd61ddc4650>, 'status_u': <kamaki.cli.argument.StatusArgument object at 0x7fd61ddc46d0>, 'timeout': <kamaki.cli.argument.IntArgument object at 0x7fd61ddc4550>}
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 0x7fd61ddcb6d0>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddcb550>, 'enable_dhcp': <kamaki.cli.argument.FlagArgument object at 0x7fd61ddcb810>, 'network_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddcb890>, 'subnet_id': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddcb750>, 'allocation_pools': <kamaki.cli.cmds.network.AllocationPoolArgument object at 0x7fd61ddcb650>, 'ipv6': <kamaki.cli.argument.FlagArgument object at 0x7fd61ddcb7d0>, 'cidr': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddcb8d0>, 'gateway': <kamaki.cli.argument.ValueArgument object at 0x7fd61ddcb690>}
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 0x7fd61ddcb250>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7fd61ddcb390>}
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 0x7fd61ddcb950>}
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 0x7fd61d2c3650>}
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 0x7fd61d2c3390>, 'describe_options': <kamaki.cli.argument.FlagArgument object at 0x7fd61d2c32d0>}
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