Skip to content

Commit 19e6987

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: Allow setting ingress_control_config when creating a SandboxEnvironmentTemplate via the SDK (Python, Java, JS).
PiperOrigin-RevId: 972355621
1 parent 66f6826 commit 19e6987

2 files changed

Lines changed: 43 additions & 30 deletions

File tree

src/converters/_sandboxtemplates_converters.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ export function createSandboxEnvironmentTemplateConfigToVertex(
4848
);
4949
}
5050

51+
const fromIngressControlConfig = common.getValueByPath(fromObject, [
52+
'ingressControlConfig',
53+
]);
54+
if (parentObject !== undefined && fromIngressControlConfig != null) {
55+
common.setValueByPath(
56+
parentObject,
57+
['ingressControlConfig'],
58+
fromIngressControlConfig,
59+
);
60+
}
61+
5162
return toObject;
5263
}
5364

src/types/common.ts

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,36 +2639,6 @@ export declare interface SandboxEnvironmentTemplateEgressControlConfig {
26392639
networkAttachment?: string;
26402640
}
26412641

2642-
/** Config for creating a Sandbox Template. */
2643-
export declare interface CreateSandboxEnvironmentTemplateConfig {
2644-
/** Used to override HTTP request options. */
2645-
httpOptions?: genaiTypes.HttpOptions;
2646-
/** Abort signal which can be used to cancel the request.
2647-
2648-
NOTE: AbortSignal is a client-only operation. Using it to cancel an
2649-
operation will not cancel the request in the service. You will still
2650-
be charged usage for any applicable operations.
2651-
*/
2652-
abortSignal?: AbortSignal;
2653-
/** The custom container environment for the sandbox template. */
2654-
customContainerEnvironment?: SandboxEnvironmentTemplateCustomContainerEnvironment;
2655-
/** The default container environment for the sandbox template. */
2656-
defaultContainerEnvironment?: SandboxEnvironmentTemplateDefaultContainerEnvironment;
2657-
/** The egress control config for the sandbox template. */
2658-
egressControlConfig?: SandboxEnvironmentTemplateEgressControlConfig;
2659-
/** Waits for the operation to complete before returning. */
2660-
waitForCompletion?: boolean;
2661-
}
2662-
2663-
/** Parameters for creating Sandbox Environment Templates. */
2664-
export declare interface CreateSandboxEnvironmentTemplateRequestParameters {
2665-
/** Name of the agent engine to create the template under. */
2666-
name: string;
2667-
/** The display name of the sandbox template. */
2668-
displayName: string;
2669-
config?: CreateSandboxEnvironmentTemplateConfig;
2670-
}
2671-
26722642
/** PSC config that is used to automatically create PSC endpoints in the user projects. */
26732643
export declare interface PSCAutomationConfig {
26742644
/** Output only. Error message if the PSC service automation failed. */
@@ -2699,6 +2669,38 @@ export declare interface PrivateServiceConnectConfig {
26992669
serviceAttachment?: string;
27002670
}
27012671

2672+
/** Config for creating a Sandbox Template. */
2673+
export declare interface CreateSandboxEnvironmentTemplateConfig {
2674+
/** Used to override HTTP request options. */
2675+
httpOptions?: genaiTypes.HttpOptions;
2676+
/** Abort signal which can be used to cancel the request.
2677+
2678+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
2679+
operation will not cancel the request in the service. You will still
2680+
be charged usage for any applicable operations.
2681+
*/
2682+
abortSignal?: AbortSignal;
2683+
/** The custom container environment for the sandbox template. */
2684+
customContainerEnvironment?: SandboxEnvironmentTemplateCustomContainerEnvironment;
2685+
/** The default container environment for the sandbox template. */
2686+
defaultContainerEnvironment?: SandboxEnvironmentTemplateDefaultContainerEnvironment;
2687+
/** The egress control config for the sandbox template. */
2688+
egressControlConfig?: SandboxEnvironmentTemplateEgressControlConfig;
2689+
/** Waits for the operation to complete before returning. */
2690+
waitForCompletion?: boolean;
2691+
/** The ingress control config for the sandbox template. */
2692+
ingressControlConfig?: PrivateServiceConnectConfig;
2693+
}
2694+
2695+
/** Parameters for creating Sandbox Environment Templates. */
2696+
export declare interface CreateSandboxEnvironmentTemplateRequestParameters {
2697+
/** Name of the agent engine to create the template under. */
2698+
name: string;
2699+
/** The display name of the sandbox template. */
2700+
displayName: string;
2701+
config?: CreateSandboxEnvironmentTemplateConfig;
2702+
}
2703+
27022704
/** A sandbox environment template. */
27032705
export declare interface SandboxEnvironmentTemplate {
27042706
/** Output only. The timestamp when this SandboxEnvironmentTemplate was created. */

0 commit comments

Comments
 (0)