The Image v2 Class

The image high-level interface is available through the image member of a Connection object. The image member will only be added if the service is detected.

Image Operations

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

create_image

create_image(name, filename, data, container, md5, sha256, disk_format, container_format, tags, disable_vendor_agent, allow_duplicates, meta, wait, timeout, validate_checksum, use_import, stores, all_stores, all_stores_must_succeed, **kwargs)

이미지 생성 및 선택적으로 데이터 업로드

Parameters:

name (str) Name of the image to create. If it is a pathnameof an image, the name will be constructed from the extensionlessbasename of the path.filename (str) The path to the file to upload, if needed.(optional, defaults to None)data Image data (string or file-like object). It is mutuallyexclusive with filenamecontainer (str) Name of the container in swift where imagesshould be uploaded for import if the cloud requires such a thing.(optional, defaults to images)md5 (str) md5 sum of the image file. If not given, an md5 willbe calculated.sha256 (str) sha256 sum of the image file. If not given, an md5will be calculated.disk_format (str) The disk format the image is in. (optional,defaults to the os-client-config config value for this cloud)container_format (str) The container format the image is in.(optional, defaults to the os-client-config config value for thiscloud)tags (list) List of tags for this image. Each tag is a stringof at most 255 chars.disable_vendor_agent (bool) Whether or not to append metadataflags to the image to inform the cloud in question to not expect avendor agent to be runing. (optional, defaults to True)allow_duplicates If true, skips checks that enforce uniqueimage name. (optional, defaults to False)meta A dict of key/value pairs to use for metadata thatbypasses automatic type conversion.wait (bool) If true, waits for image to be created. Defaults totrue - however, be aware that one of the upload methods is alwayssynchronous.timeout Seconds to wait for image creation. None is forever.validate_checksum (bool) If true and cloud returns checksum,compares return value with the one calculated or passed into thiscall. If value does not match - raises exception. Default isfalseuse_import (bool) Use the glance-direct method of theinteroperable image import mechanism to import the image. Thisdefaults to false because it is harder on the target cloud soshould only be used when needed, such as when the user needs thecloud to transform image format. If the cloud has disabled directuploads, this will default to true. If you wish to use other importmethods, use the import_image method instead.stores List of stores to be used when enabled_backends isactivated in glance. List values can be the id of a store or aStore instance.Implies use_import equals True.all_stores Upload to all available stores. Mutually exclusivewith store and stores.Implies use_import equals True.all_stores_must_succeed When set to True, if an error occursduring the upload in at least one store, the worfklow fails, thedata is deleted from stores where copying is done (not staging),and the state of the image is unchanged. When set to False, theworkflow will fail (data deleted from stores, ) only if the importfails on all stores specified by the user. In case of a partialsuccess, the locations added to the image will be the stores wherethe data has been correctly uploaded.Default is True.Implies use_import equals True.

Returns:

The results of image creation

Return type:

Image

Raises:

SDKException if there are problems uploading

import_image

import_image(image, method, uri, remote_region, remote_image_id, remote_service_interface, store, stores, all_stores, all_stores_must_succeed)

기존 이미지로 데이터 가져오기

Parameters:

image The value can be the ID of a image or aImage instance.method Method to use for importing the image. Not alldeployments support all methods. One of: glance-direct(default), web-download, glance-download, orcopy-image. Use of glance-direct requires the image befirst staged.uri Required only if using the web-download import method.This url is where the data is made available to the Imageservice.remote_region The remote glance region to download the imagefrom when using glance-download.remote_image_id The ID of the image to import from theremote glance when using glance-download.remote_service_interface The remote glance service interface touse when using glance-download.store Used when enabled_backends is activated in glance. Thevalue can be the id of a store or a.Store instance.stores List of stores to be used when enabled_backends isactivated in glance. List values can be the id of a store or aStore instance.all_stores Upload to all available stores. Mutually exclusivewith store and stores.all_stores_must_succeed When set to True, if an error occursduring the upload in at least one store, the worfklow fails, thedata is deleted from stores where copying is done (not staging),and the state of the image is unchanged. When set to False, theworkflow will fail (data deleted from stores, ) only if theimport fails on all stores specified by the user. In case ofa partial success, the locations added to the image will bethe stores where the data has been correctly uploaded.Default is True.

Returns:

The raw response from the request.

stage_image

stage_image(image, filename, data)

스테이지 바이너리 영상 데이터

Parameters:

image The value can be the ID of a image or aImage instance.filename Optional name of the file to read data from.data Optional data to be uploaded as an image.

Returns:

The results of image creation

Return type:

Image

upload_image

upload_image(container_format, disk_format, data, **attrs)

속성에서 새 이미지 생성 및 업로드

Parameters:

container_format Format of the container.A valid value is ami, ari, aki, bare, ovf, ova, or docker.disk_format The format of the disk. A valid value is ami,ari, aki, vhd, vmdk, raw, qcow2, vdi, or iso.data The data to be uploaded as an image.attrs (dict) Keyword arguments which will be used to createa Image, comprised of theproperties on the Image class.

Returns:

The results of image creation

Return type:

Image

download_image

download_image(image, stream, output, chunk_size)

이미지 다운로드

Parameters:

image The value can be either the ID of an image or aImage instance.stream (bool) When True, return a requests.Responseinstance allowing you to iterate over the response data streaminstead of storing its entire contents in memory. Seerequests.Response.iter_content() for more details.NOTE: If you do not consume the entirety of the response you mustexplicitly call requests.Response.close() or otherwise riskinefficiencies with the requests librarys handling ofconnections.When False, return the entire contents of the response.output Either a file object or a path to store data into.chunk_size (int) size in bytes to read from the wire and bufferat one time. Defaults to 1024 * 1024 = 1 MiB

Returns:

When output is not given - the bytes comprising the givenImage when stream is False, otherwise a requests.Responseinstance. When output is given - aImage instance.

delete_image

delete_image(image, store, ignore_missing)

이미지 삭제

Parameters:

image The value can be either the ID of an image or aImage instance.store The value can be either the ID of a store or aStore instance that theimage is associated with. If specified, the image will only bedeleted from the specified store.ignore_missing (bool) When set to FalseResourceNotFound will beraised when the image does not exist.When set to True, no exception will be set whenattempting to delete a nonexistent image.

Returns:

None

find_image

find_image(name_or_id, ignore_missing)

단일 이미지 찾기

Parameters:

name_or_id The name or ID of a image.ignore_missing (bool) When set to FalseResourceNotFound will beraised when the resource does not exist.When set to True, None will be returned whenattempting to find a nonexistent resource.

Returns:

One Image or None

get_image

get_image(image)

단일 이미지 가져오기

Parameters:

image The value can be the ID of a image or aImage instance.

Returns:

One Image

Raises:

ResourceNotFoundwhen no resource can be found.

images

images(**query)

이미지 생성기 반환

Parameters:

query (kwargs) Optional query parameters to be sent to limitthe resources being returned.

Returns:

A generator of image objects

Return type:

Image

update_image

update_image(image, **attrs)

이미지 업데이트

Parameters:

image Either the ID of a image or aImage instance.attrs The attributes to update on the image representedby image.

Returns:

The updated image

Return type:

Image

deactivate_image

deactivate_image(image)

이미지 비활성화

Parameters:

image Either the ID of a image or aImage instance.

Returns:

None

reactivate_image

reactivate_image(image)

이미지 재활성화

Parameters:

image Either the ID of a image or aImage instance.

Returns:

None

add_tag

add_tag(image, tag)

이미지에 태그 추가

Parameters:

image The value can be the ID of a image or aImage instancethat the member will be created for.tag (str) The tag to be added

Returns:

None

remove_tag

remove_tag(image, tag)

이미지에 태그 제거

Parameters:

image The value can be the ID of a image or aImage instancethat the member will be created for.tag (str) The tag to be removed

Returns:

None

Member Operations

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

add_member

add_member(image, **attrs)

특성에서 새 구성원 만들기

Parameters:

image The value can be the ID of a image or aImage instancethat the member will be created for.attrs (dict) Keyword arguments which will be used to createa Member,comprised of the properties on the Member class.

Returns:

The results of member creation

Return type:

Member

remove_member

remove_member(member, image, ignore_missing)

구성원 삭제

Parameters:

member The value can be either the ID of a member or aMember instance.image The value can be either the ID of an image or aImage instance that the memberis part of. This is required if member is an ID.ignore_missing (bool) When set to FalseResourceNotFound will be raised whenthe member does not exist. When set to True, no exception willbe set when attempting to delete a nonexistent member.

Returns:

None

find_member

find_member(name_or_id, image, ignore_missing)

단일 멤버 찾기

Parameters:

name_or_id The name or ID of a member.image This is the image that the member belongs to,the value can be the ID of a image or aImage instance.ignore_missing (bool) When set to FalseResourceNotFound will beraised when the resource does not exist.When set to True, None will be returned whenattempting to find a nonexistent resource.

Returns:

One Member or None

get_member

get_member(member, image)

이미지에서 단일 멤버 가져오기

Parameters:

member The value can be the ID of a member or aMember instance.image This is the image that the member belongs to.The value can be the ID of a image or aImage instance.

Returns:

One Member

Raises:

ResourceNotFoundwhen no resource can be found.

members

members(image, **query)

구성원 생성기 반환

Parameters:

image This is the image that the member belongs to,the value can be the ID of a image or aImage instance.query (kwargs) Optional query parameters to be sent to limitthe resources being returned.

Returns:

A generator of member objects

Return type:

Member

update_member

update_member(member, image, **attrs)

이미지의 구성원 업데이트

Parameters:

member Either the ID of a member or aMember instance.image This is the image that the member belongs to.The value can be the ID of a image or aImage instance.attrs The attributes to update on the member representedby member.

Returns:

The updated member

Return type:

Member

Task Operations

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

tasks

tasks(**query)

작업 생성기 반환

Parameters:

query (kwargs) Optional query parameters to be sent to limitthe resources being returned.

Returns:

A generator of task objects

Return type:

Task

get_task

get_task(task)

작업 세부 정보 가져오기

Parameters:

task The value can be the ID of a task or aTask instance.

Returns:

One Task

Raises:

ResourceNotFoundwhen no resource can be found.

create_task

create_task(**attrs)

속성에서 새 태스크 생성

Parameters:

attrs (dict) Keyword arguments which will be used to createa Task,comprised of the properties on the Task class.

Returns:

The results of task creation

Return type:

Task

wait_for_task

wait_for_task(task, status, failures, interval, wait)

작업이 특정 상태가 될 때까지 기다립니다.

Parameters:

task The resource to wait on to reach the specified status.The resource must have a status attribute.status Desired status.failures (list) Statuses that would be interpreted as failures.interval Number of seconds to wait before to consecutivechecks. Default to 2.wait Maximum number of seconds to wait before the change.Default to 120.

Returns:

The resource is returned on success.

Raises:

ResourceTimeout if transitionto the desired status failed to occur in specified seconds.

Raises:

ResourceFailure if the resourcehas transited to one of the failure statuses.

Raises:

AttributeError if the resource does not have astatus attribute.

Schema Operations

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

get_images_schema

get_images_schema()

이미지 스키마 가져오기

Returns:

One Schema

Raises:

ResourceNotFoundwhen no resource can be found.

get_image_schema

get_image_schema()

단일 이미지 스키마 가져오기

Returns:

One Schema

Raises:

ResourceNotFoundwhen no resource can be found.

get_members_schema

get_members_schema()

이미지 구성원 스키마 가져오기

Returns:

One Schema

Raises:

ResourceNotFoundwhen no resource can be found.

get_member_schema

get_member_schema()

이미지 멤버 스키마 가져오기

Returns:

One Schema

Raises:

ResourceNotFoundwhen no resource can be found.

get_tasks_schema

get_tasks_schema()

이미지 작업 스키마 가져오기

Returns:

One Schema

Raises:

ResourceNotFoundwhen no resource can be found.

get_task_schema

get_task_schema()

이미지 작업 스키마 가져오기

Returns:

One Schema

Raises:

ResourceNotFoundwhen no resource can be found.

get_metadef_namespace_schema

get_metadef_namespace_schema()

메타데이터 정의 네임스페이스 스키마 가져오기

Returns:

One MetadefSchema

Raises:

ResourceNotFoundwhen no resource can be found.

get_metadef_namespaces_schema

get_metadef_namespaces_schema()

메타데이터 정의 네임스페이스 스키마 가져오기

Returns:

One MetadefSchema

Raises:

ResourceNotFoundwhen no resource can be found.

get_metadef_resource_type_schema

get_metadef_resource_type_schema()

메타데이터 정의 리소스 유형 연결 스키마 가져오기

Returns:

One MetadefSchema

Raises:

ResourceNotFoundwhen no resource can be found.

get_metadef_resource_types_schema

get_metadef_resource_types_schema()

메타데이터 정의 리소스 유형 연결 스키마 가져오기

Returns:

One MetadefSchema

Raises:

ResourceNotFoundwhen no resource can be found.

get_metadef_object_schema

get_metadef_object_schema()

메타데이터 정의 개체 스키마 가져오기

Returns:

One MetadefSchema

Raises:

ResourceNotFoundwhen no resource can be found.

get_metadef_objects_schema

get_metadef_objects_schema()

메타데이터 정의 개체 스키마 가져오기

Returns:

One MetadefSchema

Raises:

ResourceNotFoundwhen no resource can be found.

get_metadef_property_schema

get_metadef_property_schema()

메타데이터 정의 속성 스키마 가져오기

Returns:

One MetadefSchema

Raises:

ResourceNotFoundwhen no resource can be found.

get_metadef_properties_schema

get_metadef_properties_schema()

메타데이터 정의 속성 스키마 가져오기

Returns:

One MetadefSchema

Raises:

ResourceNotFoundwhen no resource can be found.

get_metadef_tag_schema

get_metadef_tag_schema()

메타데이터 정의 태그 스키마 가져오기

Returns:

One MetadefSchema

Raises:

ResourceNotFoundwhen no resource can be found.

get_metadef_tags_schema

get_metadef_tags_schema()

메타데이터 정의 태그 스키마 가져오기

Returns:

One MetadefSchema

Raises:

ResourceNotFoundwhen no resource can be found.

Service Info Discovery Operations

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

stores

stores(details, **query)

지원되는 이미지 저장소의 생성기 반환

Returns:

A generator of store objects

Return type:

Store

get_import_info

get_import_info()

이미지 제약 조건에 대한 정보 가져오기

Returns:

One Import

Raises:

ResourceNotFoundwhen no resource can be found.

Metadef Namespace Operations

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

create_metadef_namespace

create_metadef_namespace(**attrs)

속성에서 새 메타데프 네임스페이스 생성

Parameters:

attrs (dict) Keyword arguments which will be used to createa MetadefNamespacecomprised of the properties on the MetadefNamespace class.

Returns:

The results of metadef namespace creation

Return type:

MetadefNamespace

delete_metadef_namespace

delete_metadef_namespace(metadef_namespace, ignore_missing)

메타데프 네임스페이스 삭제

Parameters:

metadef_namespace The value can be either the name of a metadefnamespace or aMetadefNamespaceinstance.ignore_missing (bool) When set to False,ResourceNotFound will be raised whenthe metadef namespace does not exist.

Returns:

None

get_metadef_namespace

get_metadef_namespace(metadef_namespace)

단일 메타데프 네임스페이스 가져오기

Parameters:

metadef_namespace Either the name of a metadef namespace or anMetadefNamespaceinstance.

Returns:

OneMetadefNamespace

Raises:

ResourceNotFound when noresource can be found.

metadef_namespaces

metadef_namespaces(**query)

메타데프 이름 공간의 생성기 반환

Returns:

A generator object of metadef namespaces

Return type:

MetadefNamespace

Raises:

ResourceNotFoundwhen no resource can be found.

update_metadef_namespace

update_metadef_namespace(metadef_namespace, **attrs)

서버 업데이트

Parameters:

metadef_namespace Either the name of a metadef namespace or anMetadefNamespaceinstance.attrs The attributes to update on the metadef namespacerepresented by metadef_namespace.

Returns:

The updated metadef namespace

Return type:

MetadefNamespace

Metadef Object Operations

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

create_metadef_object

create_metadef_object(namespace, **attrs)

네임스페이스에서 새 개체 생성

Parameters:

namespace The value can be either the name of a metadefnamespace or aMetadefNamespaceinstance.attrs (dict) Keyword arguments which will be used to createa MetadefObject,comprised of the properties on the Metadef object class.

Returns:

A metadef namespace

Return type:

MetadefObject

get_metadef_object

get_metadef_object(metadef_object, namespace)

단일 메타디프 개체 가져오기

Parameters:

metadef_object The value can be the ID of a metadef_objector aMetadefObjectinstance.namespace The value can be either the name of a metadefnamespace or aMetadefNamespaceinstance.

Returns:

One MetadefObject

Raises:

ResourceNotFound when noresource can be found.

metadef_objects

metadef_objects(namespace)

네임스페이스의 metadef 개체 목록 가져오기

Parameters:

namespace The value can be either the name of a metadefnamespace or aMetadefNamespaceinstance.

Returns:

One MetadefObject

Raises:

ResourceNotFound when noresource can be found.

update_metadef_object

update_metadef_object(metadef_object, namespace, **attrs)

단일 메타디프 개체 업데이트

Parameters:

metadef_object The value can be the ID of a metadef_object or aMetadefObject instance.namespace The value can be either the name of a metadefnamespace or aMetadefNamespaceinstance.attrs (dict) Keyword arguments which will be used to updatea MetadefObject

Returns:

One MetadefObject

Raises:

ResourceNotFound when noresource can be found.

delete_metadef_object

delete_metadef_object(metadef_object, namespace, **attrs)

단일 메타디프 개체를 제거합니다

Parameters:

metadef_object The value can be the ID of a metadef_object or aMetadefObject instance.namespace The value can be either the name of a metadefnamespace or aMetadefNamespaceinstance.attrs (dict) Keyword arguments which will be used to updatea MetadefObject

Returns:

None

Raises:

ResourceNotFound when noresource can be found.

Metadef Resource Type Operations

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

metadef_resource_types

metadef_resource_types(**query)

메타디프 리소스 유형의 생성기를 반환합니다

Returns:

A generator object of metadef resource types

Return type:

MetadefResourceType

Raises:

ResourceNotFoundwhen no resource can be found.

create_metadef_resource_type_association

create_metadef_resource_type_association(metadef_namespace, **attrs)

요청 본문에 지정된 리소스 유형입니다.

Creates a resource type association between a namespace:

and the resource type specified in the body of the request.

Parameters:

attrs (dict) Keyword arguments which will be used to create aMetadefResourceTypeAssociationcomprised of the properties on theMetadefResourceTypeAssociation class.

Returns:

The results of metadef resource type association creation

Return type:

MetadefResourceTypeAssociation

delete_metadef_resource_type_association

delete_metadef_resource_type_association(metadef_resource_type, metadef_namespace, ignore_missing)

네임스페이스의 리소스 유형 연결을 제거합니다.

Parameters:

metadef_resource_type The value can be either the name ofa metadef resource type association or anMetadefResourceTypeAssociationinstance.metadef_namespace The value can be either the name of metadefnamespace or anMetadefNamespaceinstanceignore_missing (bool) When set to False,ResourceNotFound will be raised whenthe metadef resource type association does not exist.

Returns:

None

metadef_resource_type_associations

metadef_resource_type_associations(metadef_namespace, **query)

메타디프 리소스 유형 연결의 생성기를 반환합니다

Parameters:

metadef_namespace The value can be either the name of metadefnamespace or anMetadefNamespaceinstance

Returns:

A generator object of metadef resource type associations

Return type:

MetadefResourceTypeAssociation

Raises:

ResourceNotFoundwhen no resource can be found.

Metadef Property Operations

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

create_metadef_property

create_metadef_property(metadef_namespace, **attrs)

메타디프 속성 생성

Parameters:

metadef_namespace The value can be either the name of metadefnamespace or anMetadefNamespaceinstanceattrs The attributes to create on the metadef propertyrepresented by metadef_property.

Returns:

The created metadef property

Return type:

MetadefProperty

update_metadef_property

update_metadef_property(metadef_property, metadef_namespace, **attrs)

메타디프 속성 업데이트

Parameters:

metadef_property The value can be either the name of metadefproperty or anMetadefPropertyinstance.metadef_namespace The value can be either the name of metadefnamespace or anMetadefNamespaceinstanceattrs The attributes to update on the metadef propertyrepresented by metadef_property.

Returns:

The updated metadef property

Return type:

MetadefProperty

delete_metadef_property

delete_metadef_property(metadef_property, metadef_namespace, ignore_missing)

메타디프 속성 삭제

Parameters:

metadef_property The value can be either the name of metadefproperty or anMetadefPropertyinstancemetadef_namespace The value can be either the name of metadefnamespace or anMetadefNamespaceinstanceignore_missing (bool) When set toFalse ResourceNotFound will beraised when the instance does not exist. When set to True,no exception will be set when attempting to delete a nonexistentinstance.

Returns:

None

get_metadef_property

get_metadef_property(metadef_property, metadef_namespace, **query)

단일 메타데프 속성 가져오기

Parameters:

metadef_property The value can be either the name of metadefproperty or anMetadefPropertyinstance.metadef_namespace The value can be either the name of metadefnamespace or anMetadefNamespaceinstance

Returns:

OneMetadefProperty

Raises:

ResourceNotFound when noresource can be found.

Helpers

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

wait_for_delete

wait_for_delete(res, interval, wait)

리소스가 삭제될 때까지 기다립니다.

Parameters:

res The resource to wait on to be deleted.interval Number of seconds to wait before to consecutivechecks. Default to 2.wait Maximum number of seconds to wait before the change.Default to 120.

Returns:

The resource is returned on success.

Raises:

ResourceTimeout if transitionto delete failed to occur in the specified seconds.

Cache Operations

openstack.image.v2._proxy.Proxy(session, statsd_client, statsd_prefix, prometheus_counter, prometheus_histogram, influxdb_config, influxdb_client, *args, **kwargs)

cache_delete_image

cache_delete_image(image, ignore_missing)

캐시에서 이미지를 삭제합니다.

Parameters:

image The value can be either the name of an image or aImageinstance.ignore_missing (bool) When set to False,ResourceNotFound will be raised whenthe metadef namespace does not exist.

Returns:

None

queue_image

queue_image(image_id)

캐싱을 위한 대기열 이미지입니다.

clear_cache

clear_cache(target)

캐시, 대기열 또는 둘 다에서 모든 이미지 지우기

Parameters:

target Specify which target you want to clearOne of: both``(default), ``cache, queue.