123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package machinelearning_test
- import (
- "bytes"
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/session"
- "github.com/aws/aws-sdk-go/service/machinelearning"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleMachineLearning_AddTags() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.AddTagsInput{
- ResourceId: aws.String("EntityId"), // Required
- ResourceType: aws.String("TaggableResourceType"), // Required
- Tags: []*machinelearning.Tag{ // Required
- { // Required
- Key: aws.String("TagKey"),
- Value: aws.String("TagValue"),
- },
- // More values...
- },
- }
- resp, err := svc.AddTags(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_CreateBatchPrediction() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.CreateBatchPredictionInput{
- BatchPredictionDataSourceId: aws.String("EntityId"), // Required
- BatchPredictionId: aws.String("EntityId"), // Required
- MLModelId: aws.String("EntityId"), // Required
- OutputUri: aws.String("S3Url"), // Required
- BatchPredictionName: aws.String("EntityName"),
- }
- resp, err := svc.CreateBatchPrediction(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_CreateDataSourceFromRDS() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.CreateDataSourceFromRDSInput{
- DataSourceId: aws.String("EntityId"), // Required
- RDSData: &machinelearning.RDSDataSpec{ // Required
- DatabaseCredentials: &machinelearning.RDSDatabaseCredentials{ // Required
- Password: aws.String("RDSDatabasePassword"), // Required
- Username: aws.String("RDSDatabaseUsername"), // Required
- },
- DatabaseInformation: &machinelearning.RDSDatabase{ // Required
- DatabaseName: aws.String("RDSDatabaseName"), // Required
- InstanceIdentifier: aws.String("RDSInstanceIdentifier"), // Required
- },
- ResourceRole: aws.String("EDPResourceRole"), // Required
- S3StagingLocation: aws.String("S3Url"), // Required
- SecurityGroupIds: []*string{ // Required
- aws.String("EDPSecurityGroupId"), // Required
- // More values...
- },
- SelectSqlQuery: aws.String("RDSSelectSqlQuery"), // Required
- ServiceRole: aws.String("EDPServiceRole"), // Required
- SubnetId: aws.String("EDPSubnetId"), // Required
- DataRearrangement: aws.String("DataRearrangement"),
- DataSchema: aws.String("DataSchema"),
- DataSchemaUri: aws.String("S3Url"),
- },
- RoleARN: aws.String("RoleARN"), // Required
- ComputeStatistics: aws.Bool(true),
- DataSourceName: aws.String("EntityName"),
- }
- resp, err := svc.CreateDataSourceFromRDS(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_CreateDataSourceFromRedshift() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.CreateDataSourceFromRedshiftInput{
- DataSourceId: aws.String("EntityId"), // Required
- DataSpec: &machinelearning.RedshiftDataSpec{ // Required
- DatabaseCredentials: &machinelearning.RedshiftDatabaseCredentials{ // Required
- Password: aws.String("RedshiftDatabasePassword"), // Required
- Username: aws.String("RedshiftDatabaseUsername"), // Required
- },
- DatabaseInformation: &machinelearning.RedshiftDatabase{ // Required
- ClusterIdentifier: aws.String("RedshiftClusterIdentifier"), // Required
- DatabaseName: aws.String("RedshiftDatabaseName"), // Required
- },
- S3StagingLocation: aws.String("S3Url"), // Required
- SelectSqlQuery: aws.String("RedshiftSelectSqlQuery"), // Required
- DataRearrangement: aws.String("DataRearrangement"),
- DataSchema: aws.String("DataSchema"),
- DataSchemaUri: aws.String("S3Url"),
- },
- RoleARN: aws.String("RoleARN"), // Required
- ComputeStatistics: aws.Bool(true),
- DataSourceName: aws.String("EntityName"),
- }
- resp, err := svc.CreateDataSourceFromRedshift(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_CreateDataSourceFromS3() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.CreateDataSourceFromS3Input{
- DataSourceId: aws.String("EntityId"), // Required
- DataSpec: &machinelearning.S3DataSpec{ // Required
- DataLocationS3: aws.String("S3Url"), // Required
- DataRearrangement: aws.String("DataRearrangement"),
- DataSchema: aws.String("DataSchema"),
- DataSchemaLocationS3: aws.String("S3Url"),
- },
- ComputeStatistics: aws.Bool(true),
- DataSourceName: aws.String("EntityName"),
- }
- resp, err := svc.CreateDataSourceFromS3(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_CreateEvaluation() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.CreateEvaluationInput{
- EvaluationDataSourceId: aws.String("EntityId"), // Required
- EvaluationId: aws.String("EntityId"), // Required
- MLModelId: aws.String("EntityId"), // Required
- EvaluationName: aws.String("EntityName"),
- }
- resp, err := svc.CreateEvaluation(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_CreateMLModel() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.CreateMLModelInput{
- MLModelId: aws.String("EntityId"), // Required
- MLModelType: aws.String("MLModelType"), // Required
- TrainingDataSourceId: aws.String("EntityId"), // Required
- MLModelName: aws.String("EntityName"),
- Parameters: map[string]*string{
- "Key": aws.String("StringType"), // Required
- // More values...
- },
- Recipe: aws.String("Recipe"),
- RecipeUri: aws.String("S3Url"),
- }
- resp, err := svc.CreateMLModel(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_CreateRealtimeEndpoint() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.CreateRealtimeEndpointInput{
- MLModelId: aws.String("EntityId"), // Required
- }
- resp, err := svc.CreateRealtimeEndpoint(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DeleteBatchPrediction() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DeleteBatchPredictionInput{
- BatchPredictionId: aws.String("EntityId"), // Required
- }
- resp, err := svc.DeleteBatchPrediction(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DeleteDataSource() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DeleteDataSourceInput{
- DataSourceId: aws.String("EntityId"), // Required
- }
- resp, err := svc.DeleteDataSource(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DeleteEvaluation() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DeleteEvaluationInput{
- EvaluationId: aws.String("EntityId"), // Required
- }
- resp, err := svc.DeleteEvaluation(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DeleteMLModel() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DeleteMLModelInput{
- MLModelId: aws.String("EntityId"), // Required
- }
- resp, err := svc.DeleteMLModel(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DeleteRealtimeEndpoint() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DeleteRealtimeEndpointInput{
- MLModelId: aws.String("EntityId"), // Required
- }
- resp, err := svc.DeleteRealtimeEndpoint(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DeleteTags() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DeleteTagsInput{
- ResourceId: aws.String("EntityId"), // Required
- ResourceType: aws.String("TaggableResourceType"), // Required
- TagKeys: []*string{ // Required
- aws.String("TagKey"), // Required
- // More values...
- },
- }
- resp, err := svc.DeleteTags(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DescribeBatchPredictions() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DescribeBatchPredictionsInput{
- EQ: aws.String("ComparatorValue"),
- FilterVariable: aws.String("BatchPredictionFilterVariable"),
- GE: aws.String("ComparatorValue"),
- GT: aws.String("ComparatorValue"),
- LE: aws.String("ComparatorValue"),
- LT: aws.String("ComparatorValue"),
- Limit: aws.Int64(1),
- NE: aws.String("ComparatorValue"),
- NextToken: aws.String("StringType"),
- Prefix: aws.String("ComparatorValue"),
- SortOrder: aws.String("SortOrder"),
- }
- resp, err := svc.DescribeBatchPredictions(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DescribeDataSources() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DescribeDataSourcesInput{
- EQ: aws.String("ComparatorValue"),
- FilterVariable: aws.String("DataSourceFilterVariable"),
- GE: aws.String("ComparatorValue"),
- GT: aws.String("ComparatorValue"),
- LE: aws.String("ComparatorValue"),
- LT: aws.String("ComparatorValue"),
- Limit: aws.Int64(1),
- NE: aws.String("ComparatorValue"),
- NextToken: aws.String("StringType"),
- Prefix: aws.String("ComparatorValue"),
- SortOrder: aws.String("SortOrder"),
- }
- resp, err := svc.DescribeDataSources(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DescribeEvaluations() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DescribeEvaluationsInput{
- EQ: aws.String("ComparatorValue"),
- FilterVariable: aws.String("EvaluationFilterVariable"),
- GE: aws.String("ComparatorValue"),
- GT: aws.String("ComparatorValue"),
- LE: aws.String("ComparatorValue"),
- LT: aws.String("ComparatorValue"),
- Limit: aws.Int64(1),
- NE: aws.String("ComparatorValue"),
- NextToken: aws.String("StringType"),
- Prefix: aws.String("ComparatorValue"),
- SortOrder: aws.String("SortOrder"),
- }
- resp, err := svc.DescribeEvaluations(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DescribeMLModels() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DescribeMLModelsInput{
- EQ: aws.String("ComparatorValue"),
- FilterVariable: aws.String("MLModelFilterVariable"),
- GE: aws.String("ComparatorValue"),
- GT: aws.String("ComparatorValue"),
- LE: aws.String("ComparatorValue"),
- LT: aws.String("ComparatorValue"),
- Limit: aws.Int64(1),
- NE: aws.String("ComparatorValue"),
- NextToken: aws.String("StringType"),
- Prefix: aws.String("ComparatorValue"),
- SortOrder: aws.String("SortOrder"),
- }
- resp, err := svc.DescribeMLModels(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_DescribeTags() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.DescribeTagsInput{
- ResourceId: aws.String("EntityId"), // Required
- ResourceType: aws.String("TaggableResourceType"), // Required
- }
- resp, err := svc.DescribeTags(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_GetBatchPrediction() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.GetBatchPredictionInput{
- BatchPredictionId: aws.String("EntityId"), // Required
- }
- resp, err := svc.GetBatchPrediction(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_GetDataSource() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.GetDataSourceInput{
- DataSourceId: aws.String("EntityId"), // Required
- Verbose: aws.Bool(true),
- }
- resp, err := svc.GetDataSource(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_GetEvaluation() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.GetEvaluationInput{
- EvaluationId: aws.String("EntityId"), // Required
- }
- resp, err := svc.GetEvaluation(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_GetMLModel() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.GetMLModelInput{
- MLModelId: aws.String("EntityId"), // Required
- Verbose: aws.Bool(true),
- }
- resp, err := svc.GetMLModel(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_Predict() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.PredictInput{
- MLModelId: aws.String("EntityId"), // Required
- PredictEndpoint: aws.String("VipURL"), // Required
- Record: map[string]*string{ // Required
- "Key": aws.String("VariableValue"), // Required
- // More values...
- },
- }
- resp, err := svc.Predict(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_UpdateBatchPrediction() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.UpdateBatchPredictionInput{
- BatchPredictionId: aws.String("EntityId"), // Required
- BatchPredictionName: aws.String("EntityName"), // Required
- }
- resp, err := svc.UpdateBatchPrediction(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_UpdateDataSource() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.UpdateDataSourceInput{
- DataSourceId: aws.String("EntityId"), // Required
- DataSourceName: aws.String("EntityName"), // Required
- }
- resp, err := svc.UpdateDataSource(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_UpdateEvaluation() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.UpdateEvaluationInput{
- EvaluationId: aws.String("EntityId"), // Required
- EvaluationName: aws.String("EntityName"), // Required
- }
- resp, err := svc.UpdateEvaluation(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleMachineLearning_UpdateMLModel() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := machinelearning.New(sess)
- params := &machinelearning.UpdateMLModelInput{
- MLModelId: aws.String("EntityId"), // Required
- MLModelName: aws.String("EntityName"),
- ScoreThreshold: aws.Float64(1.0),
- }
- resp, err := svc.UpdateMLModel(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
|