All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.googlenative.ml.v1.kotlin.outputs.GetVersionResult.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.ml.v1.kotlin.outputs

import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map

/**
 *
 * @property acceleratorConfig Optional. Accelerator config for using GPUs for online prediction (beta). Only specify this field if you have specified a Compute Engine (N1) machine type in the `machineType` field. Learn more about [using GPUs for online prediction](/ml-engine/docs/machine-types-online-prediction#gpus).
 * @property autoScaling Automatically scale the number of nodes used to serve the model in response to increases and decreases in traffic. Care should be taken to ramp up traffic according to the model's ability to scale or you will start seeing increases in latency and 429 response codes.
 * @property container Optional. Specifies a custom container to use for serving predictions. If you specify this field, then `machineType` is required. If you specify this field, then `deploymentUri` is optional. If you specify this field, then you must not specify `runtimeVersion`, `packageUris`, `framework`, `pythonVersion`, or `predictionClass`.
 * @property createTime The time the version was created.
 * @property deploymentUri The Cloud Storage URI of a directory containing trained model artifacts to be used to create the model version. See the [guide to deploying models](/ai-platform/prediction/docs/deploying-models) for more information. The total number of files under this directory must not exceed 1000. During projects.models.versions.create, AI Platform Prediction copies all files from the specified directory to a location managed by the service. From then on, AI Platform Prediction uses these copies of the model artifacts to serve predictions, not the original files in Cloud Storage, so this location is useful only as a historical record. If you specify container, then this field is optional. Otherwise, it is required. Learn [how to use this field with a custom container](/ai-platform/prediction/docs/custom-container-requirements#artifacts).
 * @property description Optional. The description specified for the version when it was created.
 * @property errorMessage The details of a failure or a cancellation.
 * @property etag `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a model from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform model updates in order to avoid race conditions: An `etag` is returned in the response to `GetVersion`, and systems are expected to put that etag in the request to `UpdateVersion` to ensure that their change will be applied to the model as intended.
 * @property explanationConfig Optional. Configures explainability features on the model's version. Some explanation features require additional metadata to be loaded as part of the model payload.
 * @property framework Optional. The machine learning framework AI Platform uses to train this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`, `XGBOOST`. If you do not specify a framework, AI Platform will analyze files in the deployment_uri to determine a framework. If you choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime version of the model to 1.4 or greater. Do **not** specify a framework if you're deploying a [custom prediction routine](/ai-platform/prediction/docs/custom-prediction-routines) or if you're using a [custom container](/ai-platform/prediction/docs/use-custom-container).
 * @property isDefault If true, this version will be used to handle prediction requests that do not specify a version. You can change the default version by calling projects.methods.versions.setDefault.
 * @property labels Optional. One or more labels that you can add, to organize your model versions. Each label is a key-value pair, where both the key and the value are arbitrary strings that you supply. For more information, see the documentation on using labels. Note that this field is not updatable for mls1* models.
 * @property lastMigrationModelId The [AI Platform (Unified) `Model`](https://cloud.google.com/ai-platform-unified/docs/reference/rest/v1beta1/projects.locations.models) ID for the last [model migration](https://cloud.google.com/ai-platform-unified/docs/start/migrating-to-ai-platform-unified).
 * @property lastMigrationTime The last time this version was successfully [migrated to AI Platform (Unified)](https://cloud.google.com/ai-platform-unified/docs/start/migrating-to-ai-platform-unified).
 * @property lastUseTime The time the version was last used for prediction.
 * @property machineType Optional. The type of machine on which to serve the model. Currently only applies to online prediction service. To learn about valid values for this field, read [Choosing a machine type for online prediction](/ai-platform/prediction/docs/machine-types-online-prediction). If this field is not specified and you are using a [regional endpoint](/ai-platform/prediction/docs/regional-endpoints), then the machine type defaults to `n1-standard-2`. If this field is not specified and you are using the global endpoint (`ml.googleapis.com`), then the machine type defaults to `mls1-c1-m2`.
 * @property manualScaling Manually select the number of nodes to use for serving the model. You should generally use `auto_scaling` with an appropriate `min_nodes` instead, but this option is available if you want more predictable billing. Beware that latency and error rates will increase if the traffic exceeds that capability of the system to serve it based on the selected number of nodes.
 * @property name The name specified for the version when it was created. The version name must be unique within the model it is created in.
 * @property packageUris Optional. Cloud Storage paths (`gs://…`) of packages for [custom prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines) or [scikit-learn pipelines with custom code](/ml-engine/docs/scikit/exporting-for-prediction#custom-pipeline-code). For a custom prediction routine, one of these packages must contain your Predictor class (see [`predictionClass`](#Version.FIELDS.prediction_class)). Additionally, include any dependencies used by your Predictor or scikit-learn pipeline uses that are not already included in your selected [runtime version](/ml-engine/docs/tensorflow/runtime-version-list). If you specify this field, you must also set [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater.
 * @property predictionClass Optional. The fully qualified name (module_name.class_name) of a class that implements the Predictor interface described in this reference field. The module containing this class should be included in a package provided to the [`packageUris` field](#Version.FIELDS.package_uris). Specify this field if and only if you are deploying a [custom prediction routine (beta)](/ml-engine/docs/tensorflow/custom-prediction-routines). If you specify this field, you must set [`runtimeVersion`](#Version.FIELDS.runtime_version) to 1.4 or greater and you must set `machineType` to a [legacy (MLS1) machine type](/ml-engine/docs/machine-types-online-prediction). The following code sample provides the Predictor interface: class Predictor(object): """Interface for constructing custom predictors.""" def predict(self, instances, **kwargs): """Performs custom prediction. Instances are the decoded values from the request. They have already been deserialized from JSON. Args: instances: A list of prediction input instances. **kwargs: A dictionary of keyword args provided as additional fields on the predict request body. Returns: A list of outputs containing the prediction results. This list must be JSON serializable. """ raise NotImplementedError() @classmethod def from_path(cls, model_dir): """Creates an instance of Predictor using the given path. Loading of the predictor should be done in this method. Args: model_dir: The local directory that contains the exported model file along with any additional files uploaded when creating the version resource. Returns: An instance implementing this Predictor class. """ raise NotImplementedError() Learn more about [the Predictor interface and custom prediction routines](/ml-engine/docs/tensorflow/custom-prediction-routines).
 * @property pythonVersion The version of Python used in prediction. The following Python versions are available: * Python '3.7' is available when `runtime_version` is set to '1.15' or later. * Python '3.5' is available when `runtime_version` is set to a version from '1.4' to '1.14'. * Python '2.7' is available when `runtime_version` is set to '1.15' or earlier. Read more about the Python versions available for [each runtime version](/ml-engine/docs/runtime-version-list).
 * @property requestLoggingConfig Optional. *Only* specify this field in a projects.models.versions.patch request. Specifying it in a projects.models.versions.create request has no effect. Configures the request-response pair logging on predictions from this Version.
 * @property routes Optional. Specifies paths on a custom container's HTTP server where AI Platform Prediction sends certain requests. If you specify this field, then you must also specify the `container` field. If you specify the `container` field and do not specify this field, it defaults to the following: ```json { "predict": "/v1/models/MODEL/versions/VERSION:predict", "health": "/v1/models/MODEL/versions/VERSION" } ``` See RouteMap for more details about these default values.
 * @property runtimeVersion The AI Platform runtime version to use for this deployment. For more information, see the [runtime version list](/ml-engine/docs/runtime-version-list) and [how to manage runtime versions](/ml-engine/docs/versioning).
 * @property serviceAccount Optional. Specifies the service account for resource access control. If you specify this field, then you must also specify either the `containerSpec` or the `predictionClass` field. Learn more about [using a custom service account](/ai-platform/prediction/docs/custom-service-account).
 * @property state The state of a version.
 */
public data class GetVersionResult(
    public val acceleratorConfig: GoogleCloudMlV1__AcceleratorConfigResponse,
    public val autoScaling: GoogleCloudMlV1__AutoScalingResponse,
    public val container: GoogleCloudMlV1__ContainerSpecResponse,
    public val createTime: String,
    public val deploymentUri: String,
    public val description: String,
    public val errorMessage: String,
    public val etag: String,
    public val explanationConfig: GoogleCloudMlV1__ExplanationConfigResponse,
    public val framework: String,
    public val isDefault: Boolean,
    public val labels: Map,
    public val lastMigrationModelId: String,
    public val lastMigrationTime: String,
    public val lastUseTime: String,
    public val machineType: String,
    public val manualScaling: GoogleCloudMlV1__ManualScalingResponse,
    public val name: String,
    public val packageUris: List,
    public val predictionClass: String,
    public val pythonVersion: String,
    public val requestLoggingConfig: GoogleCloudMlV1__RequestLoggingConfigResponse,
    public val routes: GoogleCloudMlV1__RouteMapResponse,
    public val runtimeVersion: String,
    public val serviceAccount: String,
    public val state: String,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.googlenative.ml.v1.outputs.GetVersionResult): GetVersionResult = GetVersionResult(
            acceleratorConfig = javaType.acceleratorConfig().let({ args0 ->
                com.pulumi.googlenative.ml.v1.kotlin.outputs.GoogleCloudMlV1__AcceleratorConfigResponse.Companion.toKotlin(args0)
            }),
            autoScaling = javaType.autoScaling().let({ args0 ->
                com.pulumi.googlenative.ml.v1.kotlin.outputs.GoogleCloudMlV1__AutoScalingResponse.Companion.toKotlin(args0)
            }),
            container = javaType.container().let({ args0 ->
                com.pulumi.googlenative.ml.v1.kotlin.outputs.GoogleCloudMlV1__ContainerSpecResponse.Companion.toKotlin(args0)
            }),
            createTime = javaType.createTime(),
            deploymentUri = javaType.deploymentUri(),
            description = javaType.description(),
            errorMessage = javaType.errorMessage(),
            etag = javaType.etag(),
            explanationConfig = javaType.explanationConfig().let({ args0 ->
                com.pulumi.googlenative.ml.v1.kotlin.outputs.GoogleCloudMlV1__ExplanationConfigResponse.Companion.toKotlin(args0)
            }),
            framework = javaType.framework(),
            isDefault = javaType.isDefault(),
            labels = javaType.labels().map({ args0 -> args0.key.to(args0.value) }).toMap(),
            lastMigrationModelId = javaType.lastMigrationModelId(),
            lastMigrationTime = javaType.lastMigrationTime(),
            lastUseTime = javaType.lastUseTime(),
            machineType = javaType.machineType(),
            manualScaling = javaType.manualScaling().let({ args0 ->
                com.pulumi.googlenative.ml.v1.kotlin.outputs.GoogleCloudMlV1__ManualScalingResponse.Companion.toKotlin(args0)
            }),
            name = javaType.name(),
            packageUris = javaType.packageUris().map({ args0 -> args0 }),
            predictionClass = javaType.predictionClass(),
            pythonVersion = javaType.pythonVersion(),
            requestLoggingConfig = javaType.requestLoggingConfig().let({ args0 ->
                com.pulumi.googlenative.ml.v1.kotlin.outputs.GoogleCloudMlV1__RequestLoggingConfigResponse.Companion.toKotlin(args0)
            }),
            routes = javaType.routes().let({ args0 ->
                com.pulumi.googlenative.ml.v1.kotlin.outputs.GoogleCloudMlV1__RouteMapResponse.Companion.toKotlin(args0)
            }),
            runtimeVersion = javaType.runtimeVersion(),
            serviceAccount = javaType.serviceAccount(),
            state = javaType.state(),
        )
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy