-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ScheduleService (schedule_service.proto) creates and manages Sc…
…hedule resources to launch scheduled pipelines runs feat: Schedule (schedule.proto) periodically schedules runs to make API calls PiperOrigin-RevId: 550058610 Source-Link: googleapis/googleapis@5b24e63 Source-Link: googleapis/googleapis-gen@4c5f6f9 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQUlQbGF0Zm9ybS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiNGM1ZjZmOWM0MjkyYzE0Mjg3MjE3YjU2ZjJkY2IwNGNkNzcyNzgzMiJ9
- Loading branch information
1 parent
510e913
commit dc5bfd6
Showing
55 changed files
with
11,932 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
...oud.AIPlatform.V1.GeneratedSnippets/ScheduleServiceClient.CreateScheduleAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1_generated_ScheduleService_CreateSchedule_async_flattened] | ||
using Google.Cloud.AIPlatform.V1; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedScheduleServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateScheduleAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task CreateScheduleAsync() | ||
{ | ||
// Create client | ||
ScheduleServiceClient scheduleServiceClient = await ScheduleServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]/locations/[LOCATION]"; | ||
Schedule schedule = new Schedule(); | ||
// Make the request | ||
Schedule response = await scheduleServiceClient.CreateScheduleAsync(parent, schedule); | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ScheduleService_CreateSchedule_async_flattened] | ||
} |
49 changes: 49 additions & 0 deletions
49
...m.V1.GeneratedSnippets/ScheduleServiceClient.CreateScheduleRequestObjectAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1_generated_ScheduleService_CreateSchedule_async] | ||
using Google.Api.Gax.ResourceNames; | ||
using Google.Cloud.AIPlatform.V1; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedScheduleServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateScheduleAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task CreateScheduleRequestObjectAsync() | ||
{ | ||
// Create client | ||
ScheduleServiceClient scheduleServiceClient = await ScheduleServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
CreateScheduleRequest request = new CreateScheduleRequest | ||
{ | ||
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), | ||
Schedule = new Schedule(), | ||
}; | ||
// Make the request | ||
Schedule response = await scheduleServiceClient.CreateScheduleAsync(request); | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ScheduleService_CreateSchedule_async] | ||
} |
48 changes: 48 additions & 0 deletions
48
...atform.V1.GeneratedSnippets/ScheduleServiceClient.CreateScheduleRequestObjectSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1_generated_ScheduleService_CreateSchedule_sync] | ||
using Google.Api.Gax.ResourceNames; | ||
using Google.Cloud.AIPlatform.V1; | ||
|
||
public sealed partial class GeneratedScheduleServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateSchedule</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void CreateScheduleRequestObject() | ||
{ | ||
// Create client | ||
ScheduleServiceClient scheduleServiceClient = ScheduleServiceClient.Create(); | ||
// Initialize request argument(s) | ||
CreateScheduleRequest request = new CreateScheduleRequest | ||
{ | ||
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), | ||
Schedule = new Schedule(), | ||
}; | ||
// Make the request | ||
Schedule response = scheduleServiceClient.CreateSchedule(request); | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ScheduleService_CreateSchedule_sync] | ||
} |
46 changes: 46 additions & 0 deletions
46
...m.V1.GeneratedSnippets/ScheduleServiceClient.CreateScheduleResourceNamesAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1_generated_ScheduleService_CreateSchedule_async_flattened_resourceNames] | ||
using Google.Api.Gax.ResourceNames; | ||
using Google.Cloud.AIPlatform.V1; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedScheduleServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateScheduleAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task CreateScheduleResourceNamesAsync() | ||
{ | ||
// Create client | ||
ScheduleServiceClient scheduleServiceClient = await ScheduleServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); | ||
Schedule schedule = new Schedule(); | ||
// Make the request | ||
Schedule response = await scheduleServiceClient.CreateScheduleAsync(parent, schedule); | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ScheduleService_CreateSchedule_async_flattened_resourceNames] | ||
} |
45 changes: 45 additions & 0 deletions
45
...atform.V1.GeneratedSnippets/ScheduleServiceClient.CreateScheduleResourceNamesSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1_generated_ScheduleService_CreateSchedule_sync_flattened_resourceNames] | ||
using Google.Api.Gax.ResourceNames; | ||
using Google.Cloud.AIPlatform.V1; | ||
|
||
public sealed partial class GeneratedScheduleServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateSchedule</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void CreateScheduleResourceNames() | ||
{ | ||
// Create client | ||
ScheduleServiceClient scheduleServiceClient = ScheduleServiceClient.Create(); | ||
// Initialize request argument(s) | ||
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); | ||
Schedule schedule = new Schedule(); | ||
// Make the request | ||
Schedule response = scheduleServiceClient.CreateSchedule(parent, schedule); | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ScheduleService_CreateSchedule_sync_flattened_resourceNames] | ||
} |
44 changes: 44 additions & 0 deletions
44
...le.Cloud.AIPlatform.V1.GeneratedSnippets/ScheduleServiceClient.CreateScheduleSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1_generated_ScheduleService_CreateSchedule_sync_flattened] | ||
using Google.Cloud.AIPlatform.V1; | ||
|
||
public sealed partial class GeneratedScheduleServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for CreateSchedule</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void CreateSchedule() | ||
{ | ||
// Create client | ||
ScheduleServiceClient scheduleServiceClient = ScheduleServiceClient.Create(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]/locations/[LOCATION]"; | ||
Schedule schedule = new Schedule(); | ||
// Make the request | ||
Schedule response = scheduleServiceClient.CreateSchedule(parent, schedule); | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ScheduleService_CreateSchedule_sync_flattened] | ||
} |
62 changes: 62 additions & 0 deletions
62
...oud.AIPlatform.V1.GeneratedSnippets/ScheduleServiceClient.DeleteScheduleAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START aiplatform_v1_generated_ScheduleService_DeleteSchedule_async_flattened] | ||
using Google.Cloud.AIPlatform.V1; | ||
using Google.LongRunning; | ||
using Google.Protobuf.WellKnownTypes; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedScheduleServiceClientSnippets | ||
{ | ||
/// <summary>Snippet for DeleteScheduleAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task DeleteScheduleAsync() | ||
{ | ||
// Create client | ||
ScheduleServiceClient scheduleServiceClient = await ScheduleServiceClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string name = "projects/[PROJECT]/locations/[LOCATION]/schedules/[SCHEDULE]"; | ||
// Make the request | ||
Operation<Empty, DeleteOperationMetadata> response = await scheduleServiceClient.DeleteScheduleAsync(name); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Empty, DeleteOperationMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Empty result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<Empty, DeleteOperationMetadata> retrievedResponse = await scheduleServiceClient.PollOnceDeleteScheduleAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Empty retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END aiplatform_v1_generated_ScheduleService_DeleteSchedule_async_flattened] | ||
} |
Oops, something went wrong.