Class EngineModel


  • public class EngineModel
    extends com.pulumi.resources.CustomResource
    Represents a machine learning solution. A model can have multiple versions, each of which is a deployed, trained model ready to receive prediction requests. The model itself is just a container. To get more information about Model, see: * [API documentation](https://cloud.google.com/ai-platform/prediction/docs/reference/rest/v1/projects.models) * How-to Guides * [Official Documentation](https://cloud.google.com/ai-platform/prediction/docs/deploying-models) ## Example Usage ### Ml Model Basic ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.ml.EngineModel; import com.pulumi.gcp.ml.EngineModelArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var default_ = new EngineModel("default", EngineModelArgs.builder() .description("My model") .regions("us-central1") .build()); } } ``` ### Ml Model Full ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.ml.EngineModel; import com.pulumi.gcp.ml.EngineModelArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var default_ = new EngineModel("default", EngineModelArgs.builder() .description("My model") .labels(Map.of("my_model", "foo")) .onlinePredictionConsoleLogging(true) .onlinePredictionLogging(true) .regions("us-central1") .build()); } } ``` ## Import Model can be imported using any of these accepted formats* `projects/{{project}}/models/{{name}}` * `{{project}}/{{name}}` * `{{name}}` In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Model using one of the formats above. For exampletf import { id = "projects/{{project}}/models/{{name}}" to = google_ml_engine_model.default } ```sh $ pulumi import gcp:ml/engineModel:EngineModel When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Model can be imported using one of the formats above. For example ``` ```sh $ pulumi import gcp:ml/engineModel:EngineModel default projects/{{project}}/models/{{name}} ``` ```sh $ pulumi import gcp:ml/engineModel:EngineModel default {{project}}/{{name}} ``` ```sh $ pulumi import gcp:ml/engineModel:EngineModel default {{name}} ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.Optional<EngineModelDefaultVersion>> defaultVersion()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> effectiveLabels()  
      static EngineModel get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, EngineModelState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> onlinePredictionConsoleLogging()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> onlinePredictionLogging()  
      com.pulumi.core.Output<java.lang.String> project()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> pulumiLabels()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> regions()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EngineModel

        public EngineModel​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • EngineModel

        public EngineModel​(java.lang.String name,
                           @Nullable
                           EngineModelArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • EngineModel

        public EngineModel​(java.lang.String name,
                           @Nullable
                           EngineModelArgs args,
                           @Nullable
                           com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • defaultVersion

        public com.pulumi.core.Output<java.util.Optional<EngineModelDefaultVersion>> defaultVersion()
        Returns:
        The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        The description specified for the model when it was created.
      • effectiveLabels

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> effectiveLabels()
        Returns:
        All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
      • labels

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()
        Returns:
        One or more labels that you can add, to organize your models. **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field `effective_labels` for all of the labels present on the resource.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name specified for the model. ***
      • onlinePredictionConsoleLogging

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> onlinePredictionConsoleLogging()
        Returns:
        If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging
      • onlinePredictionLogging

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> onlinePredictionLogging()
        Returns:
        If true, online prediction access logs are sent to StackDriver Logging.
      • project

        public com.pulumi.core.Output<java.lang.String> project()
        Returns:
        The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
      • pulumiLabels

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> pulumiLabels()
        Returns:
        The combination of labels configured directly on the resource and default labels configured on the provider.
      • regions

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> regions()
        Returns:
        The list of regions where the model is going to be deployed. Currently only one region per model is supported
      • get

        public static EngineModel get​(java.lang.String name,
                                      com.pulumi.core.Output<java.lang.String> id,
                                      @Nullable
                                      EngineModelState state,
                                      @Nullable
                                      com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.