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 0x7f3ed5350950>, 'force': <kamaki.cli.argument.FlagArgument object at 0x7f3ed5350a50>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5350850>, 'file_path': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5350990>, 'accept': <kamaki.cli.argument.FlagArgument object at 0x7f3ed5350a90>, 'description': <kamaki.cli.argument.ValueArgument object at 0x7f3ed53509d0>}
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 0x7f3ed53506d0>, 'reject': <kamaki.cli.argument.CommaSeparatedListArgument object at 0x7f3ed53507d0>}
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 0x7f3ed5350c10>}
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 0x7f3ed535b3d0>}
description = 'List all memberships'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.membership_reject(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Reject a membership for a project you manage

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

Remove a membership for a project you manage

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

Approve an application (special privileges needed)

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

Cancel your application

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

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

arguments = {'project_name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5355150>, 'end_date': <kamaki.cli.argument.DateArgument object at 0x7f3ed5355390>, 'join_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7f3ed5355410>, 'resource_capacities': <kamaki.cli.cmds.astakos.ProjectResourceArgument object at 0x7f3ed5355490>, 'max_members': <kamaki.cli.argument.IntArgument object at 0x7f3ed5355290>, 'leave_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7f3ed5355450>, 'private': <kamaki.cli.argument.BooleanArgument object at 0x7f3ed53552d0>, 'specs_path': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5355050>, 'homepage_url': <kamaki.cli.argument.ValueArgument object at 0x7f3ed53551d0>, 'owner_uuid': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5355190>, 'start_date': <kamaki.cli.argument.DateArgument object at 0x7f3ed5355310>, 'description': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5355210>}
description = 'Apply for a new project'
long_description = ' {\n "name": name,\n "owner": uuid, # if omitted, request user assumed\n "homepage": homepage, # optional\n "description": description, # optional\n "comments": comments, # optional\n "max_members": max_members, # optional\n "private": true | false, # optional\n "start_date": date, # optional\n "end_date": date,\n "join_policy": "auto" | "moderated" | "closed", # default: "moderated"\n "leave_policy": "auto" | "moderated" | "closed", # default: "auto"\n "resources": {\n "cyclades.vm": {"project_capacity": int, "member_capacity": int\n }}}'
main()[source]
required = ['specs_path', 'project_name', 'end_date']
syntax = ' '
class kamaki.cli.cmds.astakos.project_deny(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Deny an application (special privileges needed)

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

Dismiss your denied application

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

Enroll a user to a project

arguments = {'email': <kamaki.cli.argument.ValueArgument object at 0x7f3ed535bad0>}
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 0x7f3ed5350e90>, 'state': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5350e50>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5350e10>, 'details': <kamaki.cli.argument.FlagArgument object at 0x7f3ed5350d50>}
description = 'List all projects'
long_description = ''
main()[source]
syntax = ' '
class kamaki.cli.cmds.astakos.project_modify(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

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

arguments = {'project_name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed53556d0>, 'end_date': <kamaki.cli.argument.DateArgument object at 0x7f3ed53559d0>, 'join_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7f3ed5355a50>, 'resource_capacities': <kamaki.cli.cmds.astakos.ProjectResourceArgument object at 0x7f3ed5355ad0>, 'max_members': <kamaki.cli.argument.IntArgument object at 0x7f3ed5355810>, 'leave_policy': <kamaki.cli.cmds.astakos.PolicyArgument object at 0x7f3ed5355a90>, 'private': <kamaki.cli.argument.FlagArgument object at 0x7f3ed5355850>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7f3ed53558d0>, 'specs_path': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5355610>, 'homepage_url': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5355750>, 'owner_uuid': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5355710>, 'start_date': <kamaki.cli.argument.DateArgument object at 0x7f3ed5355950>, 'description': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5355790>}
description = 'Modify properties of a project'
long_description = ' {\n "name": name,\n "owner": uuid, # if omitted, request user assumed\n "homepage": homepage, # optional\n "description": description, # optional\n "comments": comments, # optional\n "max_members": max_members, # optional\n "private": true | false, # optional\n "start_date": date, # optional\n "end_date": date,\n "join_policy": "auto" | "moderated" | "closed", # default: "moderated"\n "leave_policy": "auto" | "moderated" | "closed", # default: "auto"\n "resources": {\n "cyclades.vm": {"project_capacity": int, "member_capacity": int\n }}}'
main(project_id)[source]
required = ['specs_path', 'owner_uuid', 'homepage_url', 'description', 'public', 'private', 'project_name', 'start_date', 'end_date', 'join_policy', 'leave_policy', 'resource_capacities', 'max_members']
syntax = '<project id> '
class kamaki.cli.cmds.astakos.project_reinstate(arguments={}, astakos=None, cloud=None, _in=None, _out=None, _err=None)[source]

Reinstate a terminated project (special privileges needed)

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

Suspend a project (special privileges needed)

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

Terminate a project (special privileges needed)

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

Resume a suspended project (special privileges needed)

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

Show user quotas

arguments = {'bytes': <kamaki.cli.argument.FlagArgument object at 0x7f3ed5346090>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5346050>, 'resource': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5338fd0>}
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 0x7f3ed5350210>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5350090>}
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 0x7f3ed5346f90>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5346e10>}
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 0x7f3ed5346d50>, 'service_token': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5346c50>}
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 0x7f3ed53466d0>}
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 0x7f3ed5346690>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x7f3ed5346490>}
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 0x7f3ed5346810>}
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 0x7f3ed1656e10>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1656dd0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1656bd0>, 'vcpus': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1656e50>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f3ed1656d10>, 'disk_template': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1656f50>, 'disk': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1656ed0>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1656d90>}
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 0x7f3ed1657410>}
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 0x7f3ed1657090>}
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 0x7f3ed1656810>}
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 0x7f3ed167ab10>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x7f3ed167aa50>, 'network_configuration': <kamaki.cli.cmds.cyclades.NetworkArgument object at 0x7f3ed167aa90>, 'server_name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed167a750>, 'metadata': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed167ab90>, 'image_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed167a910>, 'flavor_id': <kamaki.cli.argument.IntArgument object at 0x7f3ed167a890>, 'cluster_size': <kamaki.cli.argument.IntArgument object at 0x7f3ed167aa10>, 'no_network': <kamaki.cli.argument.FlagArgument object at 0x7f3ed167aad0>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f3ed167a990>, 'personality': <kamaki.cli.cmds.cyclades.PersonalityArgument object at 0x7f3ed167a950>}
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 0x7f3ed16562d0>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1656190>}
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 0x7f3ed16575d0>, 'volume_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed16576d0>}
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 0x7f3ed167a590>, 'stats': <kamaki.cli.argument.FlagArgument object at 0x7f3ed167a650>, 'diagnostics': <kamaki.cli.argument.FlagArgument object at 0x7f3ed167a690>}
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 0x7f3ed167a390>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f3ed167a250>, 'user_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed167a310>, 'since': <kamaki.cli.argument.DateArgument object at 0x7f3ed167a190>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f3ed167a0d0>, 'image_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed167a2d0>, 'meta': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed167a3d0>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f3ed167a1d0>, 'flavor_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed167a290>, 'user_name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed167a350>, 'meta_like': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed167a410>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f3ed167a210>}
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 0x7f3ed167ae10>, 'public_network_port_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed167aed0>, 'flavor_id': <kamaki.cli.argument.IntArgument object at 0x7f3ed167ad90>, 'server_name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed167ac90>, 'metadata_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed167ae90>, 'metadata_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed167ae50>}
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 0x7f3ed167afd0>}
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 0x7f3ed1656350>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1656450>}
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 0x7f3ed1656690>}
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 0x7f3ed1656510>}
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 0x7f3ed1656ad0>, 'status': <kamaki.cli.argument.StatusArgument object at 0x7f3ed1656a90>, 'status_u': <kamaki.cli.argument.StatusArgument object at 0x7f3ed1656b10>, 'timeout': <kamaki.cli.argument.IntArgument object at 0x7f3ed1656990>}
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 0x7f3ed1196050>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1196090>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f3ed1190f90>, 'versioning': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1190e90>}
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 0x7f3ed1196150>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1196250>}
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 0x7f3ed11962d0>}
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 0x7f3ed1190650>, 'in_bytes': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1190690>, 'until_date': <kamaki.cli.argument.DateArgument object at 0x7f3ed1190510>, 'metadata': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1190610>}
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 0x7f3ed1190d50>, 'modified_since_date': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1190b50>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1190d10>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1190950>, 'shared_by_me': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1190d90>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f3ed1190a90>, 'shared': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1190c90>, 'marker': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1190ad0>, 'until_date': <kamaki.cli.argument.DateArgument object at 0x7f3ed1190c10>, 'unmodified_since_date': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1190b90>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1190dd0>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1190cd0>}
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 0x7f3ed1190890>, 'metadata_to_add': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed1190790>, 'versioning': <kamaki.cli.cmds.pithos.VersioningArgument object at 0x7f3ed11908d0>, 'metadata_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed1190850>}
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 0x7f3ed1196410>}
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 0x7f3ed1185e50>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7f3ed1185f10>}
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 0x7f3ed1189dd0>, 'if_none_match': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1189c90>, 'if_modified_since': <kamaki.cli.argument.DateArgument object at 0x7f3ed1189d10>, 'if_match': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1189b10>, 'if_unmodified_since': <kamaki.cli.argument.DateArgument object at 0x7f3ed1189d50>, 'range': <kamaki.cli.cmds.pithos.RangeArgument object at 0x7f3ed1189b50>, 'buffer_blocks': <kamaki.cli.argument.IntArgument object at 0x7f3ed1189e10>}
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 0x7f3ed1185a90>, 'public': <kamaki.cli.argument.ValueArgument object at 0x7f3ed11859d0>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1185a50>}
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 0x7f3ed11851d0>}
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 0x7f3ed1185450>, 'delimiter': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1185650>, 'yes': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1185590>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7f3ed11855d0>}
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 0x7f3ed1190210>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x7f3ed1190250>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1190310>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7f3ed1190290>, 'modified_since_date': <kamaki.cli.argument.DateArgument object at 0x7f3ed1190150>, 'resume': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1189f10>, 'range': <kamaki.cli.cmds.pithos.RangeArgument object at 0x7f3ed1190050>, 'non_matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1190110>, 'unmodified_since_date': <kamaki.cli.argument.DateArgument object at 0x7f3ed1190190>, 'matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1190090>}
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 0x7f3ed0e2d610>, 'sharing': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1182510>, 'hashmap': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1182350>, 'versions': <kamaki.cli.argument.FlagArgument object at 0x7f3ed11825d0>, 'modified_since_date': <kamaki.cli.argument.DateArgument object at 0x7f3ed1182450>, 'non_matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1182410>, 'unmodified_since_date': <kamaki.cli.argument.DateArgument object at 0x7f3ed1182490>, 'matching_etag': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1182390>, 'metadata': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1182550>}
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 0x7f3ed1182c50>, 'format': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1182ad0>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1182c10>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1182750>, 'shared_by_me': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1182b10>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1182b50>, 'delimiter': <kamaki.cli.argument.ValueArgument object at 0x7f3ed11828d0>, 'meta': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1182950>, 'if_modified_since': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1182990>, 'marker': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1182850>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f3ed1182810>, 'if_unmodified_since': <kamaki.cli.argument.ValueArgument object at 0x7f3ed11829d0>, 'until': <kamaki.cli.argument.DateArgument object at 0x7f3ed1182a50>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1182bd0>}
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 0x7f3ed1182e10>, 'no_permissions': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1182e50>, 'metadata_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed1182e90>, 'metadata_key_to_delete': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed1182ed0>, 'uuid_for_read_permission': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed1182d10>}
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 0x7f3ed1185cd0>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1185c50>}
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 0x7f3ed1189490>, 'end_position': <kamaki.cli.argument.IntArgument object at 0x7f3ed1189410>, 'start_position': <kamaki.cli.argument.IntArgument object at 0x7f3ed1189390>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7f3ed1189250>}
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 0x7f3ed11890d0>}
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 0x7f3ed1189a10>, 'max_threads': <kamaki.cli.argument.IntArgument object at 0x7f3ed1189590>, 'recursive': <kamaki.cli.argument.FlagArgument object at 0x7f3ed11899d0>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7f3ed1189910>, 'uuid_for_write_permission': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed1189890>, 'md5_checksum': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1189a50>, 'uuid_for_read_permission': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed1189850>, 'content_encoding': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1189610>, 'content_type': <kamaki.cli.argument.ValueArgument object at 0x7f3ed11897d0>, 'use_hashes': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1189a90>, 'content_disposition': <kamaki.cli.argument.ValueArgument object at 0x7f3ed1189750>, 'public': <kamaki.cli.argument.FlagArgument object at 0x7f3ed11898d0>, 'overwrite': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1189990>}
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 0x7f3ed1196b50>, 'user_uuid': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed1196a50>}
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 0x7f3ed11966d0>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f3ed1196590>}
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 0x7f3ed0360bd0>}
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 0x7f3ed0360a10>, 'image_ID_for_members': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0360110>, 'owner_name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0360610>, 'prop_like': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed0360150>, 'size_max': <kamaki.cli.argument.IntArgument object at 0x7f3ed03607d0>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0360510>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x7f3ed03d8e90>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f3ed03d8910>, 'prop': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed0360090>, 'size_min': <kamaki.cli.argument.IntArgument object at 0x7f3ed0360190>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f3ed0360550>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x7f3ed03d8e10>, 'owner': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0360a90>, 'order': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0360050>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0360210>}
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 0x7f3ed0360e50>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0360dd0>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0360d90>, 'image_name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0360c90>, 'publish': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0360e90>, 'unpublish': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0360f10>, 'property_to_del': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed0360fd0>, 'member_ID_to_remove': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed0377090>, 'property_to_set': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed0360f90>, 'member_ID_to_add': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed0377050>}
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 0x7f3ed0377310>, 'container_format': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0377250>, 'no_metafile_upload': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0377550>, 'is_public': <kamaki.cli.argument.FlagArgument object at 0x7f3ed03773d0>, 'force_upload': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0377510>, 'properties': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed0377390>, 'size': <kamaki.cli.argument.IntArgument object at 0x7f3ed0377450>, 'container': <kamaki.cli.argument.ValueArgument object at 0x7f3ed03775d0>, 'uuid': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0377610>, 'progress_bar': <kamaki.cli.argument.ProgressBarArgument object at 0x7f3ed0377690>, 'metafile': <kamaki.cli.argument.ValueArgument object at 0x7f3ed03774d0>, 'local_image_path': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0377650>, 'disk_format': <kamaki.cli.argument.ValueArgument object at 0x7f3ed03772d0>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0377710>, 'pithos_location': <kamaki.cli.argument.PithosLocationArgument object at 0x7f3ed0377790>, 'checksum': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0377150>}
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 0x7f3ed0377b50>, 'enum': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0377b10>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0377910>, 'meta': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed0377bd0>, 'limit': <kamaki.cli.argument.IntArgument object at 0x7f3ed0377a50>, 'user_name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0377b90>, 'meta_like': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed0377c10>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0377ad0>}
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 0x7f3ed0377fd0>, 'property_to_add': <kamaki.cli.argument.KeyValueArgument object at 0x7f3ed0377ed0>}
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 0x7f3ed0725bd0>, 'server_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0725c90>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0725c10>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0725a90>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed0725b90>}
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 0x7f3ed0725590>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0725790>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0725710>}
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 0x7f3ed0725d50>}
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 0x7f3ed0725810>}
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 0x7f3ed0725e90>, 'subnet_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0725fd0>, 'device_id': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed073e110>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x7f3ed073e050>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f3ed073e090>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed0725f90>}
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 0x7f3ed0739890>, 'project_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0739a10>, 'network_type': <kamaki.cli.cmds.network.NetworkTypeArgument object at 0x7f3ed0739a90>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed05c0cd0>}
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 0x7f3ed073e2d0>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f3ed073e190>}
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 0x7f3ed0739750>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0739650>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0739710>}
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 0x7f3ed0739e10>}
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 0x7f3ed0739b10>}
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 0x7f3ed0725050>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0724e90>, 'device_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0725150>, 'network_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0725110>, 'wait': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0725190>, 'ip_address': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0725090>, 'security_group_id': <kamaki.cli.argument.RepeatableArgument object at 0x7f3ed0724fd0>}
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 0x7f3ed0724b90>}
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 0x7f3ed0724a10>, 'detail': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0724850>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0724990>}
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 0x7f3ed0724d10>}
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 0x7f3ed07253d0>, 'status': <kamaki.cli.argument.StatusArgument object at 0x7f3ed0725390>, 'status_u': <kamaki.cli.argument.StatusArgument object at 0x7f3ed0725410>, 'timeout': <kamaki.cli.argument.IntArgument object at 0x7f3ed0725290>}
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 0x7f3ed0724410>, 'name': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0724290>, 'enable_dhcp': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0724550>, 'network_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed07245d0>, 'subnet_id': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0724490>, 'allocation_pools': <kamaki.cli.cmds.network.AllocationPoolArgument object at 0x7f3ed0724390>, 'ipv6': <kamaki.cli.argument.FlagArgument object at 0x7f3ed0724510>, 'cidr': <kamaki.cli.argument.ValueArgument object at 0x7f3ed0724610>, 'gateway': <kamaki.cli.argument.ValueArgument object at 0x7f3ed07243d0>}
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 0x7f3ed0739f50>, 'more': <kamaki.cli.argument.FlagArgument object at 0x7f3ed07240d0>}
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 0x7f3ed0724690>}
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 0x7f3ed05bf250>}
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 0x7f3ed036c210>, 'describe_options': <kamaki.cli.argument.FlagArgument object at 0x7f3ed036c110>}
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)
application_action(*args, **kwargs)
authenticate(*args, **kwargs)
commission_action(*args, **kwargs)
create_project(*args, **kwargs)
enroll_member(*args, **kwargs)
get_commission_info(*args, **kwargs)
get_endpoint_url(*args, **kwargs)[source]
get_endpoints(*args, **kwargs)
get_membership(*args, **kwargs)
get_memberships(*args, **kwargs)
get_pending_commissions(*args, **kwargs)
get_project(*args, **kwargs)
get_projects(*args, **kwargs)
get_quotas(*args, **kwargs)
get_resources(*args, **kwargs)
get_service_endpoints(*args, **kwargs)[source]
get_services(*args, **kwargs)
get_token(*args, **kwargs)
get_username(*args, **kwargs)
get_usernames(*args, **kwargs)
get_uuid(*args, **kwargs)
get_uuids(*args, **kwargs)
issue_commission_generic(*args, **kwargs)
issue_one_commission(*args, **kwargs)
issue_resource_reassignment(*args, **kwargs)
join_project(*args, **kwargs)
membership_action(*args, **kwargs)
mk_provisions(*args, **kwargs)
modify_project(*args, **kwargs)
project_action(*args, **kwargs)
reject_commission(*args, **kwargs)
resolve_commissions(*args, **kwargs)
send_feedback(*args, **kwargs)
service_get_project_quotas(*args, **kwargs)
service_get_quotas(*args, **kwargs)
service_get_username(*args, **kwargs)
service_get_usernames(*args, **kwargs)
service_get_uuid(*args, **kwargs)
service_get_uuids(*args, **kwargs)
user_info[source]
user_term(*args, **kwargs)[source]
validate_token(*args, **kwargs)
exception kamaki.clients.astakos.AstakosClientError(message='Astakos Client Error', details='', status=0)[source]

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

Join AstakosClientException as ClientError in one class

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

Bases: kamaki.clients.Client

Synnefo Astakos cached client wraper

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

Get the Synnefo AstakosClient instance used by client

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

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

Raises AstakosClientError:
 

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

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

list cached users information

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

POST endpoint_url/user_catalogs

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

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

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

Get (cached) term, from user credentials

user_info(token=None)[source]

Get (cached) user information

user_term(key, token=None)[source]

Get (cached) term, from user credentials

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

Bases: kamaki.clients.astakos.AstakosClient

An AstakosClient wrapper with modified logging

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

LOG_DATA = False
LOG_TOKEN = False