Struct google_ml1_beta1::ProjectMethods
[−]
[src]
pub struct ProjectMethods<'a, C, A> where
C: 'a,
A: 'a, { /* fields omitted */ }
A builder providing access to all methods supported on project resources.
It is not used directly, but through the CloudMachineLearning
hub.
Example
Instantiate a resource builder
extern crate hyper; extern crate yup_oauth2 as oauth2; extern crate google_ml1_beta1 as ml1_beta1; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; use ml1_beta1::CloudMachineLearning; let secret: ApplicationSecret = Default::default(); let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::new(), <MemoryStorage as Default>::default(), None); let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* // like `get_config(...)`, `jobs_cancel(...)`, `jobs_create(...)`, `jobs_get(...)`, `jobs_list(...)`, `models_create(...)`, `models_delete(...)`, `models_get(...)`, `models_list(...)`, `models_versions_create(...)`, `models_versions_delete(...)`, `models_versions_get(...)`, `models_versions_list(...)`, `models_versions_set_default(...)`, `operations_cancel(...)`, `operations_delete(...)`, `operations_get(...)`, `operations_list(...)` and `predict(...)` // to build up your call. let rb = hub.projects();
Methods
impl<'a, C, A> ProjectMethods<'a, C, A>
[src]
fn operations_list(&self, name: &str) -> ProjectOperationListCall<'a, C, A>
Create a builder to help you perform the following task:
Lists operations that match the specified filter in the request. If the
server doesn't support this method, it returns UNIMPLEMENTED
.
NOTE: the name
binding below allows API services to override the binding
to use different resource name schemes, such as users/*/operations
.
Arguments
name
- The name of the operation collection.
fn operations_delete(&self, name: &str) -> ProjectOperationDeleteCall<'a, C, A>
Create a builder to help you perform the following task:
Deletes a long-running operation. This method indicates that the client is
no longer interested in the operation result. It does not cancel the
operation. If the server doesn't support this method, it returns
google.rpc.Code.UNIMPLEMENTED
.
Arguments
name
- The name of the operation resource to be deleted.
fn models_versions_create(
&self,
request: GoogleCloudMlV1beta1__Version,
parent: &str
) -> ProjectModelVersionCreateCall<'a, C, A>
&self,
request: GoogleCloudMlV1beta1__Version,
parent: &str
) -> ProjectModelVersionCreateCall<'a, C, A>
Create a builder to help you perform the following task:
Creates a new version of a model from a trained TensorFlow model.
If the version created in the cloud by this call is the first deployed version of the specified model, it will be made the default version of the model. When you add a version to a model that already has one or more versions, the default version does not automatically change. If you want a new version to be the default, you must call projects.models.versions.setDefault.
Arguments
request
- No description provided.parent
- Required. The name of the model. Authorization: requiresEditor
role on the parent project.
fn models_versions_list(
&self,
parent: &str
) -> ProjectModelVersionListCall<'a, C, A>
&self,
parent: &str
) -> ProjectModelVersionListCall<'a, C, A>
Create a builder to help you perform the following task:
Gets basic information about all the versions of a model.
If you expect that a model has a lot of versions, or if you need to handle only a limited number of results at a time, you can request that the list be retrieved in batches (called pages):
Arguments
parent
- Required. The name of the model for which to list the version. Authorization: requiresViewer
role on the parent project.
fn operations_get(&self, name: &str) -> ProjectOperationGetCall<'a, C, A>
Create a builder to help you perform the following task:
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
Arguments
name
- The name of the operation resource.
fn models_versions_delete(
&self,
name: &str
) -> ProjectModelVersionDeleteCall<'a, C, A>
&self,
name: &str
) -> ProjectModelVersionDeleteCall<'a, C, A>
Create a builder to help you perform the following task:
Deletes a model version.
Each model can have multiple versions deployed and in use at any given time. Use this method to remove a single version.
Note: You cannot delete the version that is set as the default version of the model unless it is the only remaining version.
Arguments
name
- Required. The name of the version. You can get the names of all the versions of a model by calling projects.models.versions.list. Authorization: requiresEditor
role on the parent project.
fn jobs_create(
&self,
request: GoogleCloudMlV1beta1__Job,
parent: &str
) -> ProjectJobCreateCall<'a, C, A>
&self,
request: GoogleCloudMlV1beta1__Job,
parent: &str
) -> ProjectJobCreateCall<'a, C, A>
Create a builder to help you perform the following task:
Creates a training or a batch prediction job.
Arguments
request
- No description provided.parent
- Required. The project name. Authorization: requiresEditor
role on the specified project.
fn models_versions_set_default(
&self,
request: GoogleCloudMlV1beta1__SetDefaultVersionRequest,
name: &str
) -> ProjectModelVersionSetDefaultCall<'a, C, A>
&self,
request: GoogleCloudMlV1beta1__SetDefaultVersionRequest,
name: &str
) -> ProjectModelVersionSetDefaultCall<'a, C, A>
Create a builder to help you perform the following task:
Designates a version to be the default for the model.
The default version is used for prediction requests made against the model that don't specify a version.
The first version to be created for a model is automatically set as the default. You must make any subsequent changes to the default version setting manually using this method.
Arguments
request
- No description provided.name
- Required. The name of the version to make the default for the model. You can get the names of all the versions of a model by calling projects.models.versions.list. Authorization: requiresEditor
role on the parent project.
fn predict(
&self,
request: GoogleCloudMlV1beta1__PredictRequest,
name: &str
) -> ProjectPredictCall<'a, C, A>
&self,
request: GoogleCloudMlV1beta1__PredictRequest,
name: &str
) -> ProjectPredictCall<'a, C, A>
Create a builder to help you perform the following task:
Performs prediction on the data in the request.
Responses are very similar to requests. There are two top-level fields, each of which are JSON lists:
- predictions
- The list of predictions, one per instance in the request.
- error
- An error message returned instead of a prediction list if any instance produced an error.
If the call is successful, the response body will contain one prediction entry per instance in the request body. If prediction fails for any instance, the response body will contain no predictions and will contian a single error entry instead.
Even though there is one prediction per instance, the format of a prediction is not directly related to the format of an instance. Predictions take whatever format is specified in the outputs collection defined in the model. The collection of predictions is returned in a JSON list. Each member of the list can be a simple value, a list, or a JSON object of any complexity. If your model has more than one output tensor, each prediction will be a JSON object containing a name/value pair for each output. The names identify the output aliases in the graph.
The following examples show some possible responses:
A simple set of predictions for three input instances, where each prediction is an integer value:
{"predictions": [5, 4, 3]}A more complex set of predictions, each containing two named values that correspond to output tensors, named label and scores respectively. The value of label is the predicted category ("car" or "beach") and scores contains a list of probabilities for that instance across the possible categories.
{"predictions": [{"label": "beach", "scores": [0.1, 0.9]}, {"label": "car", "scores": [0.75, 0.25]}]}A response when there is an error processing an input instance:
{"error": "Divide by zero"}
Arguments
request
- No description provided.name
- Required. The resource name of a model or a version. Authorization: requiresViewer
role on the parent project.
fn models_delete(&self, name: &str) -> ProjectModelDeleteCall<'a, C, A>
Create a builder to help you perform the following task:
Deletes a model.
You can only delete a model if there are no versions in it. You can delete versions by calling projects.models.versions.delete.
Arguments
name
- Required. The name of the model. Authorization: requiresEditor
role on the parent project.
fn get_config(&self, name: &str) -> ProjectGetConfigCall<'a, C, A>
Create a builder to help you perform the following task:
Get the service account information associated with your project. You need this information in order to grant the service account persmissions for the Google Cloud Storage location where you put your model training code for training the model with Google Cloud Machine Learning.
Arguments
name
- Required. The project name. Authorization: requiresViewer
role on the specified project.
fn jobs_get(&self, name: &str) -> ProjectJobGetCall<'a, C, A>
Create a builder to help you perform the following task:
Describes a job.
Arguments
name
- Required. The name of the job to get the description of. Authorization: requiresViewer
role on the parent project.
fn operations_cancel(&self, name: &str) -> ProjectOperationCancelCall<'a, C, A>
Create a builder to help you perform the following task:
Starts asynchronous cancellation on a long-running operation. The server
makes a best effort to cancel the operation, but success is not
guaranteed. If the server doesn't support this method, it returns
google.rpc.Code.UNIMPLEMENTED
. Clients can use
Operations.GetOperation or
other methods to check whether the cancellation succeeded or whether the
operation completed despite cancellation. On successful cancellation,
the operation is not deleted; instead, it becomes an operation with
an Operation.error value with a google.rpc.Status.code of 1,
corresponding to Code.CANCELLED
.
Arguments
name
- The name of the operation resource to be cancelled.
fn models_create(
&self,
request: GoogleCloudMlV1beta1__Model,
parent: &str
) -> ProjectModelCreateCall<'a, C, A>
&self,
request: GoogleCloudMlV1beta1__Model,
parent: &str
) -> ProjectModelCreateCall<'a, C, A>
Create a builder to help you perform the following task:
Creates a model which will later contain one or more versions.
You must add at least one version before you can request predictions from the model. Add versions by calling projects.models.versions.create.
Arguments
request
- No description provided.parent
- Required. The project name. Authorization: requiresEditor
role on the specified project.
fn models_versions_get(
&self,
name: &str
) -> ProjectModelVersionGetCall<'a, C, A>
&self,
name: &str
) -> ProjectModelVersionGetCall<'a, C, A>
Create a builder to help you perform the following task:
Gets information about a model version.
Models can have multiple versions. You can call projects.models.versions.list to get the same information that this method returns for all of the versions of a model.
Arguments
name
- Required. The name of the version. Authorization: requiresViewer
role on the parent project.
fn jobs_list(&self, parent: &str) -> ProjectJobListCall<'a, C, A>
Create a builder to help you perform the following task:
Lists the jobs in the project.
Arguments
parent
- Required. The name of the project for which to list jobs. Authorization: requiresViewer
role on the specified project.
fn jobs_cancel(
&self,
request: GoogleCloudMlV1beta1__CancelJobRequest,
name: &str
) -> ProjectJobCancelCall<'a, C, A>
&self,
request: GoogleCloudMlV1beta1__CancelJobRequest,
name: &str
) -> ProjectJobCancelCall<'a, C, A>
Create a builder to help you perform the following task:
Cancels a running job.
Arguments
request
- No description provided.name
- Required. The name of the job to cancel. Authorization: requiresEditor
role on the parent project.
fn models_get(&self, name: &str) -> ProjectModelGetCall<'a, C, A>
Create a builder to help you perform the following task:
Gets information about a model, including its name, the description (if set), and the default version (if at least one version of the model has been deployed).
Arguments
name
- Required. The name of the model. Authorization: requiresViewer
role on the parent project.
fn models_list(&self, parent: &str) -> ProjectModelListCall<'a, C, A>
Create a builder to help you perform the following task:
Lists the models in a project.
Each project can contain multiple models, and each model can have multiple versions.
Arguments
parent
- Required. The name of the project whose models are to be listed. Authorization: requiresViewer
role on the specified project.