github.com/vmware/govmomi@v0.43.0/vslm/types/enum.go (about)

     1  /*
     2  Copyright (c) 2014-2024 VMware, Inc. All Rights Reserved.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package types
    18  
    19  import (
    20  	"reflect"
    21  
    22  	"github.com/vmware/govmomi/vim25/types"
    23  )
    24  
    25  type VslmEventType string
    26  
    27  const (
    28  	// Event type used to notify that FCD is going to be relocated.
    29  	VslmEventTypePreFcdMigrateEvent = VslmEventType("preFcdMigrateEvent")
    30  	// Event type used to notify FCD has been relocated.
    31  	VslmEventTypePostFcdMigrateEvent = VslmEventType("postFcdMigrateEvent")
    32  )
    33  
    34  func (e VslmEventType) Values() []VslmEventType {
    35  	return []VslmEventType{
    36  		VslmEventTypePreFcdMigrateEvent,
    37  		VslmEventTypePostFcdMigrateEvent,
    38  	}
    39  }
    40  
    41  func (e VslmEventType) Strings() []string {
    42  	return types.EnumValuesAsStrings(e.Values())
    43  }
    44  
    45  func init() {
    46  	types.Add("vslm:VslmEventType", reflect.TypeOf((*VslmEventType)(nil)).Elem())
    47  }
    48  
    49  // The possible states of the vlsm event processing.
    50  type VslmEventVslmEventInfoState string
    51  
    52  const (
    53  	// When the event has been successfully processed.
    54  	VslmEventVslmEventInfoStateSuccess = VslmEventVslmEventInfoState("success")
    55  	// When there is error while processing the event.
    56  	VslmEventVslmEventInfoStateError = VslmEventVslmEventInfoState("error")
    57  )
    58  
    59  func (e VslmEventVslmEventInfoState) Values() []VslmEventVslmEventInfoState {
    60  	return []VslmEventVslmEventInfoState{
    61  		VslmEventVslmEventInfoStateSuccess,
    62  		VslmEventVslmEventInfoStateError,
    63  	}
    64  }
    65  
    66  func (e VslmEventVslmEventInfoState) Strings() []string {
    67  	return types.EnumValuesAsStrings(e.Values())
    68  }
    69  
    70  func init() {
    71  	types.Add("vslm:VslmEventVslmEventInfoState", reflect.TypeOf((*VslmEventVslmEventInfoState)(nil)).Elem())
    72  }
    73  
    74  // List of possible states of a task.
    75  type VslmTaskInfoState string
    76  
    77  const (
    78  	// When there are too many tasks for threads to handle.
    79  	VslmTaskInfoStateQueued = VslmTaskInfoState("queued")
    80  	// When the busy thread is freed from its current task by
    81  	// finishing the task, it picks a queued task to run.
    82  	//
    83  	// Then the queued tasks are marked as running.
    84  	VslmTaskInfoStateRunning = VslmTaskInfoState("running")
    85  	// When a running task has completed.
    86  	VslmTaskInfoStateSuccess = VslmTaskInfoState("success")
    87  	// When a running task has encountered an error.
    88  	VslmTaskInfoStateError = VslmTaskInfoState("error")
    89  )
    90  
    91  func (e VslmTaskInfoState) Values() []VslmTaskInfoState {
    92  	return []VslmTaskInfoState{
    93  		VslmTaskInfoStateQueued,
    94  		VslmTaskInfoStateRunning,
    95  		VslmTaskInfoStateSuccess,
    96  		VslmTaskInfoStateError,
    97  	}
    98  }
    99  
   100  func (e VslmTaskInfoState) Strings() []string {
   101  	return types.EnumValuesAsStrings(e.Values())
   102  }
   103  
   104  func init() {
   105  	types.Add("vslm:VslmTaskInfoState", reflect.TypeOf((*VslmTaskInfoState)(nil)).Elem())
   106  }
   107  
   108  // The `VslmVsoVStorageObjectQuerySpecQueryFieldEnum_enum` enumerated
   109  // type defines the searchable fields.
   110  type VslmVsoVStorageObjectQuerySpecQueryFieldEnum string
   111  
   112  const (
   113  	// Indicates `BaseConfigInfo.id` as the searchable field.
   114  	VslmVsoVStorageObjectQuerySpecQueryFieldEnumId = VslmVsoVStorageObjectQuerySpecQueryFieldEnum("id")
   115  	// Indicates `BaseConfigInfo.name` as the searchable
   116  	// field.
   117  	VslmVsoVStorageObjectQuerySpecQueryFieldEnumName = VslmVsoVStorageObjectQuerySpecQueryFieldEnum("name")
   118  	// Indicates `VStorageObjectConfigInfo.capacityInMB` as the
   119  	// searchable field.
   120  	VslmVsoVStorageObjectQuerySpecQueryFieldEnumCapacity = VslmVsoVStorageObjectQuerySpecQueryFieldEnum("capacity")
   121  	// Indicates `BaseConfigInfo.createTime` as the searchable
   122  	// field.
   123  	VslmVsoVStorageObjectQuerySpecQueryFieldEnumCreateTime = VslmVsoVStorageObjectQuerySpecQueryFieldEnum("createTime")
   124  	// Indicates
   125  	// `BaseConfigInfoFileBackingInfo.backingObjectId` as the
   126  	// searchable field.
   127  	VslmVsoVStorageObjectQuerySpecQueryFieldEnumBackingObjectId = VslmVsoVStorageObjectQuerySpecQueryFieldEnum("backingObjectId")
   128  	// Indicates `BaseConfigInfoBackingInfo.datastore` as the
   129  	// searchable field.
   130  	VslmVsoVStorageObjectQuerySpecQueryFieldEnumDatastoreMoId = VslmVsoVStorageObjectQuerySpecQueryFieldEnum("datastoreMoId")
   131  	// Indicates it as the searchable field.
   132  	VslmVsoVStorageObjectQuerySpecQueryFieldEnumMetadataKey = VslmVsoVStorageObjectQuerySpecQueryFieldEnum("metadataKey")
   133  	// Indicates it as the searchable field.
   134  	VslmVsoVStorageObjectQuerySpecQueryFieldEnumMetadataValue = VslmVsoVStorageObjectQuerySpecQueryFieldEnum("metadataValue")
   135  )
   136  
   137  func (e VslmVsoVStorageObjectQuerySpecQueryFieldEnum) Values() []VslmVsoVStorageObjectQuerySpecQueryFieldEnum {
   138  	return []VslmVsoVStorageObjectQuerySpecQueryFieldEnum{
   139  		VslmVsoVStorageObjectQuerySpecQueryFieldEnumId,
   140  		VslmVsoVStorageObjectQuerySpecQueryFieldEnumName,
   141  		VslmVsoVStorageObjectQuerySpecQueryFieldEnumCapacity,
   142  		VslmVsoVStorageObjectQuerySpecQueryFieldEnumCreateTime,
   143  		VslmVsoVStorageObjectQuerySpecQueryFieldEnumBackingObjectId,
   144  		VslmVsoVStorageObjectQuerySpecQueryFieldEnumDatastoreMoId,
   145  		VslmVsoVStorageObjectQuerySpecQueryFieldEnumMetadataKey,
   146  		VslmVsoVStorageObjectQuerySpecQueryFieldEnumMetadataValue,
   147  	}
   148  }
   149  
   150  func (e VslmVsoVStorageObjectQuerySpecQueryFieldEnum) Strings() []string {
   151  	return types.EnumValuesAsStrings(e.Values())
   152  }
   153  
   154  func init() {
   155  	types.Add("vslm:VslmVsoVStorageObjectQuerySpecQueryFieldEnum", reflect.TypeOf((*VslmVsoVStorageObjectQuerySpecQueryFieldEnum)(nil)).Elem())
   156  }
   157  
   158  // The `VslmVsoVStorageObjectQuerySpecQueryOperatorEnum_enum` enumerated
   159  // type defines the operators to use for constructing the query criteria.
   160  type VslmVsoVStorageObjectQuerySpecQueryOperatorEnum string
   161  
   162  const (
   163  	VslmVsoVStorageObjectQuerySpecQueryOperatorEnumEquals             = VslmVsoVStorageObjectQuerySpecQueryOperatorEnum("equals")
   164  	VslmVsoVStorageObjectQuerySpecQueryOperatorEnumNotEquals          = VslmVsoVStorageObjectQuerySpecQueryOperatorEnum("notEquals")
   165  	VslmVsoVStorageObjectQuerySpecQueryOperatorEnumLessThan           = VslmVsoVStorageObjectQuerySpecQueryOperatorEnum("lessThan")
   166  	VslmVsoVStorageObjectQuerySpecQueryOperatorEnumGreaterThan        = VslmVsoVStorageObjectQuerySpecQueryOperatorEnum("greaterThan")
   167  	VslmVsoVStorageObjectQuerySpecQueryOperatorEnumLessThanOrEqual    = VslmVsoVStorageObjectQuerySpecQueryOperatorEnum("lessThanOrEqual")
   168  	VslmVsoVStorageObjectQuerySpecQueryOperatorEnumGreaterThanOrEqual = VslmVsoVStorageObjectQuerySpecQueryOperatorEnum("greaterThanOrEqual")
   169  	VslmVsoVStorageObjectQuerySpecQueryOperatorEnumContains           = VslmVsoVStorageObjectQuerySpecQueryOperatorEnum("contains")
   170  	VslmVsoVStorageObjectQuerySpecQueryOperatorEnumStartsWith         = VslmVsoVStorageObjectQuerySpecQueryOperatorEnum("startsWith")
   171  	VslmVsoVStorageObjectQuerySpecQueryOperatorEnumEndsWith           = VslmVsoVStorageObjectQuerySpecQueryOperatorEnum("endsWith")
   172  )
   173  
   174  func (e VslmVsoVStorageObjectQuerySpecQueryOperatorEnum) Values() []VslmVsoVStorageObjectQuerySpecQueryOperatorEnum {
   175  	return []VslmVsoVStorageObjectQuerySpecQueryOperatorEnum{
   176  		VslmVsoVStorageObjectQuerySpecQueryOperatorEnumEquals,
   177  		VslmVsoVStorageObjectQuerySpecQueryOperatorEnumNotEquals,
   178  		VslmVsoVStorageObjectQuerySpecQueryOperatorEnumLessThan,
   179  		VslmVsoVStorageObjectQuerySpecQueryOperatorEnumGreaterThan,
   180  		VslmVsoVStorageObjectQuerySpecQueryOperatorEnumLessThanOrEqual,
   181  		VslmVsoVStorageObjectQuerySpecQueryOperatorEnumGreaterThanOrEqual,
   182  		VslmVsoVStorageObjectQuerySpecQueryOperatorEnumContains,
   183  		VslmVsoVStorageObjectQuerySpecQueryOperatorEnumStartsWith,
   184  		VslmVsoVStorageObjectQuerySpecQueryOperatorEnumEndsWith,
   185  	}
   186  }
   187  
   188  func (e VslmVsoVStorageObjectQuerySpecQueryOperatorEnum) Strings() []string {
   189  	return types.EnumValuesAsStrings(e.Values())
   190  }
   191  
   192  func init() {
   193  	types.Add("vslm:VslmVsoVStorageObjectQuerySpecQueryOperatorEnum", reflect.TypeOf((*VslmVsoVStorageObjectQuerySpecQueryOperatorEnum)(nil)).Elem())
   194  }