diff --git a/VERSION b/VERSION index 15c6f3e..827886a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.6.3 +10.6.4 diff --git a/src/Clarifai/Api/AuditOperationType.php b/src/Clarifai/Api/AuditOperationType.php new file mode 100644 index 0000000..116de6f --- /dev/null +++ b/src/Clarifai/Api/AuditOperationType.php @@ -0,0 +1,50 @@ +clarifai.api.AuditOperationType + */ +class AuditOperationType +{ + /** + * Generated from protobuf enum AUDIT_OPERATION_TYPE_NOT_SET = 0; + */ + const AUDIT_OPERATION_TYPE_NOT_SET = 0; + /** + * APPLICATION event types : 100 - 199 + * + * Generated from protobuf enum APPLICATION_CREATE = 100; + */ + const APPLICATION_CREATE = 100; + + private static $valueToName = [ + self::AUDIT_OPERATION_TYPE_NOT_SET => 'AUDIT_OPERATION_TYPE_NOT_SET', + self::APPLICATION_CREATE => 'APPLICATION_CREATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/src/Clarifai/Api/ComputeInfo.php b/src/Clarifai/Api/ComputeInfo.php index ca0044c..cc8b433 100644 --- a/src/Clarifai/Api/ComputeInfo.php +++ b/src/Clarifai/Api/ComputeInfo.php @@ -19,19 +19,22 @@ class ComputeInfo extends \Google\Protobuf\Internal\Message { /** - * Number of CPUs. + * Amount of CPUs to use. This follows kubernetes notation like: "1", "100m", "4.5", etc. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * - * Generated from protobuf field uint32 num_cpus = 1; + * Generated from protobuf field string cpu_limit = 6; */ - protected $num_cpus = 0; + protected $cpu_limit = ''; /** - * Amount of CPU memory to use as a minimum. + * Amount of CPU memory to use as a minimum. This follows kubernetes notation like: + * 1Ki, 1500Mi, 3Gi, 4Ti, etc. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * * Generated from protobuf field string cpu_memory = 2; */ protected $cpu_memory = ''; /** - * Number of accelerators (typically GPUs, TPUs, etc. not CPUs) for this resource. + * Amount of GPU/TPUs to use. * * Generated from protobuf field uint32 num_accelerators = 3; */ @@ -40,6 +43,7 @@ class ComputeInfo extends \Google\Protobuf\Internal\Message * Amount of accelerator/GPU memory to use as a minimum. * This is defined per accelerator. * This follows the format used by kubernetes like 1Ki, 2Mi, 3Gi, 4Ti. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * * Generated from protobuf field string accelerator_memory = 4; */ @@ -58,16 +62,20 @@ class ComputeInfo extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type int $num_cpus - * Number of CPUs. + * @type string $cpu_limit + * Amount of CPUs to use. This follows kubernetes notation like: "1", "100m", "4.5", etc. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * @type string $cpu_memory - * Amount of CPU memory to use as a minimum. + * Amount of CPU memory to use as a minimum. This follows kubernetes notation like: + * 1Ki, 1500Mi, 3Gi, 4Ti, etc. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * @type int $num_accelerators - * Number of accelerators (typically GPUs, TPUs, etc. not CPUs) for this resource. + * Amount of GPU/TPUs to use. * @type string $accelerator_memory * Amount of accelerator/GPU memory to use as a minimum. * This is defined per accelerator. * This follows the format used by kubernetes like 1Ki, 2Mi, 3Gi, 4Ti. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * @type array|\Google\Protobuf\Internal\RepeatedField $accelerator_type * Or should it be removed completely and use the nodepool accelerator type itself. * These are the supported accelerators that the model can run on. @@ -79,33 +87,37 @@ public function __construct($data = NULL) { } /** - * Number of CPUs. + * Amount of CPUs to use. This follows kubernetes notation like: "1", "100m", "4.5", etc. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * - * Generated from protobuf field uint32 num_cpus = 1; - * @return int + * Generated from protobuf field string cpu_limit = 6; + * @return string */ - public function getNumCpus() + public function getCpuLimit() { - return $this->num_cpus; + return $this->cpu_limit; } /** - * Number of CPUs. + * Amount of CPUs to use. This follows kubernetes notation like: "1", "100m", "4.5", etc. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * - * Generated from protobuf field uint32 num_cpus = 1; - * @param int $var + * Generated from protobuf field string cpu_limit = 6; + * @param string $var * @return $this */ - public function setNumCpus($var) + public function setCpuLimit($var) { - GPBUtil::checkUint32($var); - $this->num_cpus = $var; + GPBUtil::checkString($var, True); + $this->cpu_limit = $var; return $this; } /** - * Amount of CPU memory to use as a minimum. + * Amount of CPU memory to use as a minimum. This follows kubernetes notation like: + * 1Ki, 1500Mi, 3Gi, 4Ti, etc. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * * Generated from protobuf field string cpu_memory = 2; * @return string @@ -116,7 +128,9 @@ public function getCpuMemory() } /** - * Amount of CPU memory to use as a minimum. + * Amount of CPU memory to use as a minimum. This follows kubernetes notation like: + * 1Ki, 1500Mi, 3Gi, 4Ti, etc. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * * Generated from protobuf field string cpu_memory = 2; * @param string $var @@ -131,7 +145,7 @@ public function setCpuMemory($var) } /** - * Number of accelerators (typically GPUs, TPUs, etc. not CPUs) for this resource. + * Amount of GPU/TPUs to use. * * Generated from protobuf field uint32 num_accelerators = 3; * @return int @@ -142,7 +156,7 @@ public function getNumAccelerators() } /** - * Number of accelerators (typically GPUs, TPUs, etc. not CPUs) for this resource. + * Amount of GPU/TPUs to use. * * Generated from protobuf field uint32 num_accelerators = 3; * @param int $var @@ -160,6 +174,7 @@ public function setNumAccelerators($var) * Amount of accelerator/GPU memory to use as a minimum. * This is defined per accelerator. * This follows the format used by kubernetes like 1Ki, 2Mi, 3Gi, 4Ti. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * * Generated from protobuf field string accelerator_memory = 4; * @return string @@ -173,6 +188,7 @@ public function getAcceleratorMemory() * Amount of accelerator/GPU memory to use as a minimum. * This is defined per accelerator. * This follows the format used by kubernetes like 1Ki, 2Mi, 3Gi, 4Ti. + * See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/ * * Generated from protobuf field string accelerator_memory = 4; * @param string $var diff --git a/src/Clarifai/Api/Image.php b/src/Clarifai/Api/Image.php index f9df9c6..25616a9 100644 --- a/src/Clarifai/Api/Image.php +++ b/src/Clarifai/Api/Image.php @@ -44,11 +44,18 @@ class Image extends \Google\Protobuf\Internal\Message */ protected $hosted = null; /** - * image info + * image info for original size. for image info for other sizes, use hosted_image_info * * Generated from protobuf field .clarifai.api.ImageInfo image_info = 6; */ protected $image_info = null; + /** + * The map of hosted image info of different sizes (see hosted.sizes), excluding the original image. + * Note: keys(hosted_image_info) = hosted.sizes - "orig" + * + * Generated from protobuf field map hosted_image_info = 7; + */ + private $hosted_image_info; /** * Constructor. @@ -70,7 +77,10 @@ class Image extends \Google\Protobuf\Internal\Message * @type \Clarifai\Api\HostedURL $hosted * The hosted field lists images in different sizes hosted in Clarifai storage. * @type \Clarifai\Api\ImageInfo $image_info - * image info + * image info for original size. for image info for other sizes, use hosted_image_info + * @type array|\Google\Protobuf\Internal\MapField $hosted_image_info + * The map of hosted image info of different sizes (see hosted.sizes), excluding the original image. + * Note: keys(hosted_image_info) = hosted.sizes - "orig" * } */ public function __construct($data = NULL) { @@ -201,7 +211,7 @@ public function setHosted($var) } /** - * image info + * image info for original size. for image info for other sizes, use hosted_image_info * * Generated from protobuf field .clarifai.api.ImageInfo image_info = 6; * @return \Clarifai\Api\ImageInfo|null @@ -222,7 +232,7 @@ public function clearImageInfo() } /** - * image info + * image info for original size. for image info for other sizes, use hosted_image_info * * Generated from protobuf field .clarifai.api.ImageInfo image_info = 6; * @param \Clarifai\Api\ImageInfo $var @@ -236,5 +246,33 @@ public function setImageInfo($var) return $this; } + /** + * The map of hosted image info of different sizes (see hosted.sizes), excluding the original image. + * Note: keys(hosted_image_info) = hosted.sizes - "orig" + * + * Generated from protobuf field map hosted_image_info = 7; + * @return \Google\Protobuf\Internal\MapField + */ + public function getHostedImageInfo() + { + return $this->hosted_image_info; + } + + /** + * The map of hosted image info of different sizes (see hosted.sizes), excluding the original image. + * Note: keys(hosted_image_info) = hosted.sizes - "orig" + * + * Generated from protobuf field map hosted_image_info = 7; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setHostedImageInfo($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\ImageInfo::class); + $this->hosted_image_info = $arr; + + return $this; + } + } diff --git a/src/Clarifai/Api/ListInstanceTypesRequest.php b/src/Clarifai/Api/ListInstanceTypesRequest.php new file mode 100644 index 0000000..4cd122b --- /dev/null +++ b/src/Clarifai/Api/ListInstanceTypesRequest.php @@ -0,0 +1,115 @@ +clarifai.api.ListInstanceTypesRequest + */ +class ListInstanceTypesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The cloud provider to list compute clusters for. + * + * Generated from protobuf field .clarifai.api.CloudProvider cloud_provider = 1; + */ + protected $cloud_provider = null; + /** + * The region to list for so when there are multiple regions we get only the clusters + * that are supposed to be up in that region. + * + * Generated from protobuf field string region = 2; + */ + protected $region = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Clarifai\Api\CloudProvider $cloud_provider + * The cloud provider to list compute clusters for. + * @type string $region + * The region to list for so when there are multiple regions we get only the clusters + * that are supposed to be up in that region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Service::initOnce(); + parent::__construct($data); + } + + /** + * The cloud provider to list compute clusters for. + * + * Generated from protobuf field .clarifai.api.CloudProvider cloud_provider = 1; + * @return \Clarifai\Api\CloudProvider|null + */ + public function getCloudProvider() + { + return $this->cloud_provider; + } + + public function hasCloudProvider() + { + return isset($this->cloud_provider); + } + + public function clearCloudProvider() + { + unset($this->cloud_provider); + } + + /** + * The cloud provider to list compute clusters for. + * + * Generated from protobuf field .clarifai.api.CloudProvider cloud_provider = 1; + * @param \Clarifai\Api\CloudProvider $var + * @return $this + */ + public function setCloudProvider($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\CloudProvider::class); + $this->cloud_provider = $var; + + return $this; + } + + /** + * The region to list for so when there are multiple regions we get only the clusters + * that are supposed to be up in that region. + * + * Generated from protobuf field string region = 2; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * The region to list for so when there are multiple regions we get only the clusters + * that are supposed to be up in that region. + * + * Generated from protobuf field string region = 2; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/MultiInstanceTypeResponse.php b/src/Clarifai/Api/MultiInstanceTypeResponse.php new file mode 100644 index 0000000..47f1abe --- /dev/null +++ b/src/Clarifai/Api/MultiInstanceTypeResponse.php @@ -0,0 +1,95 @@ +clarifai.api.MultiInstanceTypeResponse + */ +class MultiInstanceTypeResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field .clarifai.api.status.Status status = 1; + */ + protected $status = null; + /** + * Generated from protobuf field repeated .clarifai.api.InstanceType instance_types = 2 [(.clarifai.api.utils.cl_show_if_empty) = true]; + */ + private $instance_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Clarifai\Api\Status\Status $status + * @type array<\Clarifai\Api\InstanceType>|\Google\Protobuf\Internal\RepeatedField $instance_types + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Proto\Clarifai\Api\Service::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field .clarifai.api.status.Status status = 1; + * @return \Clarifai\Api\Status\Status|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Generated from protobuf field .clarifai.api.status.Status status = 1; + * @param \Clarifai\Api\Status\Status $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Clarifai\Api\Status\Status::class); + $this->status = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .clarifai.api.InstanceType instance_types = 2 [(.clarifai.api.utils.cl_show_if_empty) = true]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstanceTypes() + { + return $this->instance_types; + } + + /** + * Generated from protobuf field repeated .clarifai.api.InstanceType instance_types = 2 [(.clarifai.api.utils.cl_show_if_empty) = true]; + * @param array<\Clarifai\Api\InstanceType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstanceTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Clarifai\Api\InstanceType::class); + $this->instance_types = $arr; + + return $this; + } + +} + diff --git a/src/Clarifai/Api/Status/StatusCode.php b/src/Clarifai/Api/Status/StatusCode.php index e18b70e..fac9e6f 100644 --- a/src/Clarifai/Api/Status/StatusCode.php +++ b/src/Clarifai/Api/Status/StatusCode.php @@ -778,6 +778,20 @@ class StatusCode * Generated from protobuf enum DEPLOYMENT_INVALID_REQUEST = 25902; */ const DEPLOYMENT_INVALID_REQUEST = 25902; + /** + * InstanceType related codes 260xx + * + * Generated from protobuf enum INSTANCE_TYPE_DOES_NOT_EXIST = 26000; + */ + const INSTANCE_TYPE_DOES_NOT_EXIST = 26000; + /** + * Generated from protobuf enum INSTANCE_TYPE_INVALID_ARGUMENT = 26001; + */ + const INSTANCE_TYPE_INVALID_ARGUMENT = 26001; + /** + * Generated from protobuf enum INSTANCE_TYPE_INVALID_REQUEST = 26002; + */ + const INSTANCE_TYPE_INVALID_REQUEST = 26002; /** * Input:Image related 30xxx * @@ -1932,6 +1946,9 @@ class StatusCode self::DEPLOYMENT_DOES_NOT_EXIST => 'DEPLOYMENT_DOES_NOT_EXIST', self::DEPLOYMENT_INVALID_ARGUMENT => 'DEPLOYMENT_INVALID_ARGUMENT', self::DEPLOYMENT_INVALID_REQUEST => 'DEPLOYMENT_INVALID_REQUEST', + self::INSTANCE_TYPE_DOES_NOT_EXIST => 'INSTANCE_TYPE_DOES_NOT_EXIST', + self::INSTANCE_TYPE_INVALID_ARGUMENT => 'INSTANCE_TYPE_INVALID_ARGUMENT', + self::INSTANCE_TYPE_INVALID_REQUEST => 'INSTANCE_TYPE_INVALID_REQUEST', self::INPUT_DOWNLOAD_SUCCESS => 'INPUT_DOWNLOAD_SUCCESS', self::INPUT_DOWNLOAD_PENDING => 'INPUT_DOWNLOAD_PENDING', self::INPUT_DOWNLOAD_FAILED => 'INPUT_DOWNLOAD_FAILED', diff --git a/src/Clarifai/Api/V2Client.php b/src/Clarifai/Api/V2Client.php index 75b954c..d06fdc5 100644 --- a/src/Clarifai/Api/V2Client.php +++ b/src/Clarifai/Api/V2Client.php @@ -3486,6 +3486,21 @@ public function PostModelVersionsTrainingTimeEstimate(\Clarifai\Api\PostModelVer $metadata, $options); } + /** + * Get InstanceTypes given Cloud Provider and Region + * @param \Clarifai\Api\ListInstanceTypesRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListInstanceTypes(\Clarifai\Api\ListInstanceTypesRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/clarifai.api.V2/ListInstanceTypes', + $argument, + ['\Clarifai\Api\MultiInstanceTypeResponse', 'decode'], + $metadata, $options); + } + /** * ComputeCluster CRUD * @param \Clarifai\Api\GetComputeClusterRequest $argument input argument diff --git a/src/Clarifai/Auth/Scope/S.php b/src/Clarifai/Auth/Scope/S.php index de66493..d69ae90 100644 --- a/src/Clarifai/Auth/Scope/S.php +++ b/src/Clarifai/Auth/Scope/S.php @@ -593,6 +593,10 @@ class S * Generated from protobuf enum Deployments_Delete = 146 [(.clarifai.auth.scope.clarfai_exposed) = true, (.clarifai.auth.scope.clarifai_depending_scopes) = Deployments_Get, (.clarifai.auth.scope.clarifai_depending_scopes) = Deployments_Add]; */ const Deployments_Delete = 146; + /** + * Generated from protobuf enum InstanceTypes_Get = 148 [(.clarifai.auth.scope.clarfai_exposed) = true]; + */ + const InstanceTypes_Get = 148; private static $valueToName = [ self::undef => 'undef', @@ -694,6 +698,7 @@ class S self::Deployments_Get => 'Deployments_Get', self::Deployments_Add => 'Deployments_Add', self::Deployments_Delete => 'Deployments_Delete', + self::InstanceTypes_Get => 'InstanceTypes_Get', ]; public static function name($value) diff --git a/src/GPBMetadata/Proto/Clarifai/Api/Resources.php b/src/GPBMetadata/Proto/Clarifai/Api/Resources.php index 467523f..cf0c25b 100644 Binary files a/src/GPBMetadata/Proto/Clarifai/Api/Resources.php and b/src/GPBMetadata/Proto/Clarifai/Api/Resources.php differ diff --git a/src/GPBMetadata/Proto/Clarifai/Api/Service.php b/src/GPBMetadata/Proto/Clarifai/Api/Service.php index 6d4d2e1..6cc35b0 100644 Binary files a/src/GPBMetadata/Proto/Clarifai/Api/Service.php and b/src/GPBMetadata/Proto/Clarifai/Api/Service.php differ diff --git a/src/GPBMetadata/Proto/Clarifai/Api/Status/StatusCode.php b/src/GPBMetadata/Proto/Clarifai/Api/Status/StatusCode.php index f814243..1323e3d 100644 Binary files a/src/GPBMetadata/Proto/Clarifai/Api/Status/StatusCode.php and b/src/GPBMetadata/Proto/Clarifai/Api/Status/StatusCode.php differ diff --git a/src/GPBMetadata/Proto/Clarifai/Auth/Scope/Scope.php b/src/GPBMetadata/Proto/Clarifai/Auth/Scope/Scope.php index 9aef77f..c57233a 100644 Binary files a/src/GPBMetadata/Proto/Clarifai/Auth/Scope/Scope.php and b/src/GPBMetadata/Proto/Clarifai/Auth/Scope/Scope.php differ