Skip to content

Commit

Permalink
feat: [cloudfunctions] ListFunctions now include metadata which indic…
Browse files Browse the repository at this point in the history
…ates whether a function is a `GEN_1` or `GEN_2` function (#9462)

* feat: ListFunctions now include metadata which indicates whether a function is a `GEN_1` or `GEN_2` function
feat: KMS crypto keys can now be specified when uploading function source code, enabling source code to be encrypted at rest with a user-managed encryption key
feat: You can now specify concurrency and cpu of a gen 2 function through the Function API, without needing to modify the underlying Cloud Run service

PiperOrigin-RevId: 534929457

Source-Link: googleapis/googleapis@1c8b678

Source-Link: https://github.com/googleapis/googleapis-gen/commit/c1050ce97535113557a0c132a62910794bc66227
Copy-Tag: eyJwIjoiamF2YS1mdW5jdGlvbnMvLk93bEJvdC55YW1sIiwiaCI6ImMxMDUwY2U5NzUzNTExMzU1N2EwYzEzMmE2MjkxMDc5NGJjNjYyMjcifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: ListFunctions now include metadata which indicates whether a function is a `GEN_1` or `GEN_2` function

PiperOrigin-RevId: 535193873

Source-Link: googleapis/googleapis@d6b7eb5

Source-Link: https://github.com/googleapis/googleapis-gen/commit/822ccd09cc1e9f8a4ab0125cc93effe26ab882c1
Copy-Tag: eyJwIjoiamF2YS1mdW5jdGlvbnMvLk93bEJvdC55YW1sIiwiaCI6IjgyMmNjZDA5Y2MxZTlmOGE0YWIwMTI1Y2M5M2VmZmUyNmFiODgyYzEifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored May 26, 2023
1 parent 14fea71 commit d945618
Show file tree
Hide file tree
Showing 155 changed files with 7,137 additions and 6,230 deletions.
4 changes: 2 additions & 2 deletions java-functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.14.0</version>
<version>26.15.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-functions.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-functions/2.18.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-functions/2.19.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,9 @@ public final UnaryCallable<DeleteFunctionRequest, Operation> deleteFunctionCalla
* GenerateUploadUrlRequest request =
* GenerateUploadUrlRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setKmsKeyName(
* CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
* .toString())
* .build();
* GenerateUploadUrlResponse response = functionServiceClient.generateUploadUrl(request);
* }
Expand Down Expand Up @@ -1041,6 +1044,9 @@ public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlReques
* GenerateUploadUrlRequest request =
* GenerateUploadUrlRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setKmsKeyName(
* CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
* .toString())
* .build();
* ApiFuture<GenerateUploadUrlResponse> future =
* functionServiceClient.generateUploadUrlCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ public void getFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -157,18 +157,18 @@ public void getFunctionTest2() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
mockService.addResponse(expectedResponse);

Expand Down Expand Up @@ -313,18 +313,18 @@ public void createFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -378,18 +378,18 @@ public void createFunctionTest2() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -443,18 +443,18 @@ public void updateFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand All @@ -467,18 +467,18 @@ public void updateFunctionTest() throws Exception {
Function function =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
FieldMask updateMask = FieldMask.newBuilder().build();

Expand Down Expand Up @@ -511,18 +511,18 @@ public void updateFunctionExceptionTest() throws Exception {
Function function =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
FieldMask updateMask = FieldMask.newBuilder().build();
client.updateFunctionAsync(function, updateMask).get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,18 @@ public void getFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
mockFunctionService.addResponse(expectedResponse);

Expand Down Expand Up @@ -160,18 +160,18 @@ public void getFunctionTest2() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
mockFunctionService.addResponse(expectedResponse);

Expand Down Expand Up @@ -298,18 +298,18 @@ public void createFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -362,18 +362,18 @@ public void createFunctionTest2() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -426,18 +426,18 @@ public void updateFunctionTest() throws Exception {
Function expectedResponse =
Function.newBuilder()
.setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
.setEnvironment(Environment.forNumber(0))
.setDescription("description-1724546052")
.setBuildConfig(BuildConfig.newBuilder().build())
.setServiceConfig(ServiceConfig.newBuilder().build())
.setEventTrigger(EventTrigger.newBuilder().build())
.setUpdateTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap<String, String>())
.addAllStateMessages(new ArrayList<StateMessage>())
.setEnvironment(Environment.forNumber(0))
.setUrl("url116079")
.setKmsKeyName(
CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
.toString())
.setUrl("url116079")
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down
Loading

0 comments on commit d945618

Please sign in to comment.