github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/imageservice/v2/images/types.go (about)

     1  package images
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  // ImageStatus image statuses
     8  // http://docs.openstack.org/developer/glance/statuses.html
     9  type ImageStatus string
    10  
    11  const (
    12  	// ImageStatusQueued is a status for an image which identifier has
    13  	// been reserved for an image in the image registry.
    14  	ImageStatusQueued ImageStatus = "queued"
    15  
    16  	// ImageStatusSaving denotes that an image’s raw data is currently being
    17  	// uploaded to Glance
    18  	ImageStatusSaving ImageStatus = "saving"
    19  
    20  	// ImageStatusActive denotes an image that is fully available in Glance.
    21  	ImageStatusActive ImageStatus = "active"
    22  
    23  	// ImageStatusKilled denotes that an error occurred during the uploading
    24  	// of an image’s data, and that the image is not readable.
    25  	ImageStatusKilled ImageStatus = "killed"
    26  
    27  	// ImageStatusDeleted is used for an image that is no longer available to use.
    28  	// The image information is retained in the image registry.
    29  	ImageStatusDeleted ImageStatus = "deleted"
    30  
    31  	// ImageStatusPendingDelete is similar to Delete, but the image is not yet
    32  	// deleted.
    33  	ImageStatusPendingDelete ImageStatus = "pending_delete"
    34  
    35  	// ImageStatusDeactivated denotes that access to image data is not allowed to
    36  	// any non-admin user.
    37  	ImageStatusDeactivated ImageStatus = "deactivated"
    38  )
    39  
    40  // ImageVisibility denotes an image that is fully available in Glance.
    41  // This occurs when the image data is uploaded, or the image size is explicitly
    42  // set to zero on creation.
    43  // According to design
    44  // https://wiki.openstack.org/wiki/Glance-v2-community-image-visibility-design
    45  type ImageVisibility string
    46  
    47  const (
    48  	// ImageVisibilityPublic all users
    49  	ImageVisibilityPublic ImageVisibility = "public"
    50  
    51  	// ImageVisibilityPrivate users with tenantId == tenantId(owner)
    52  	ImageVisibilityPrivate ImageVisibility = "private"
    53  
    54  	// ImageVisibilityShared images are visible to:
    55  	// - users with tenantId == tenantId(owner)
    56  	// - users with tenantId in the member-list of the image
    57  	// - users with tenantId in the member-list with member_status == 'accepted'
    58  	ImageVisibilityShared ImageVisibility = "shared"
    59  
    60  	// ImageVisibilityCommunity images:
    61  	// - all users can see and boot it
    62  	// - users with tenantId in the member-list of the image with
    63  	//	 member_status == 'accepted' have this image in their default image-list.
    64  	ImageVisibilityCommunity ImageVisibility = "community"
    65  )
    66  
    67  // MemberStatus is a status for adding a new member (tenant) to an image
    68  // member list.
    69  type ImageMemberStatus string
    70  
    71  const (
    72  	// ImageMemberStatusAccepted is the status for an accepted image member.
    73  	ImageMemberStatusAccepted ImageMemberStatus = "accepted"
    74  
    75  	// ImageMemberStatusPending shows that the member addition is pending
    76  	ImageMemberStatusPending ImageMemberStatus = "pending"
    77  
    78  	// ImageMemberStatusAccepted is the status for a rejected image member
    79  	ImageMemberStatusRejected ImageMemberStatus = "rejected"
    80  
    81  	// ImageMemberStatusAll
    82  	ImageMemberStatusAll ImageMemberStatus = "all"
    83  )
    84  
    85  // ImageDateFilter represents a valid filter to use for filtering
    86  // images by their date during a List.
    87  type ImageDateFilter string
    88  
    89  const (
    90  	FilterGT  ImageDateFilter = "gt"
    91  	FilterGTE ImageDateFilter = "gte"
    92  	FilterLT  ImageDateFilter = "lt"
    93  	FilterLTE ImageDateFilter = "lte"
    94  	FilterNEQ ImageDateFilter = "neq"
    95  	FilterEQ  ImageDateFilter = "eq"
    96  )
    97  
    98  // ImageDateQuery represents a date field to be used for listing images.
    99  // If no filter is specified, the query will act as though FilterEQ was
   100  // set.
   101  type ImageDateQuery struct {
   102  	Date   time.Time
   103  	Filter ImageDateFilter
   104  }