- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization Scopes
- IAM Permissions
Creates a GlobalForwardingRule resource in the specified project using the data included in the request.
HTTP request
POST https://www.googleapis.com/compute/v1/projects/{project}/global/forwardingRules
The URL uses Google API HTTP annotation syntax.
Path parameters
Parameters | |
---|---|
project |
Project ID for this request. |
Query parameters
Parameters | |
---|---|
requestId |
An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( |
Request body
The request body contains data with the following structure:
JSON representation | |
---|---|
{ "resource": { "id": string, "creationTimestamp": string, "name": string, "description": string, "region": string, "IPAddress": string, "IPProtocol": enum, "portRange": string, "ports": string, "target": string, "selfLink": string, "loadBalancingScheme": enum, "subnetwork": string, "network": string, "backendService": string, "ipVersion": enum, "kind": string } } |
Fields | |
---|---|
resource |
|
resource.id |
[Output Only] The unique identifier for the resource. This identifier is defined by the server. |
resource.creationTimestamp |
[Output Only] Creation timestamp in RFC3339 text format. |
resource.name |
Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression |
resource.description |
An optional description of this resource. Provide this property when you create the resource. |
resource.region |
[Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. |
resource.IPAddress |
The IP address that this forwarding rule is serving on behalf of. Addresses are restricted based on the forwarding rule's load balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). When the load balancing scheme is EXTERNAL, for global forwarding rules, the address must be a global IP, and for regional forwarding rules, the address must live in the same region as the forwarding rule. If this field is empty, an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6. When the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnet configured for the forwarding rule. By default, if this field is empty, an ephemeral internal IP address will be automatically allocated from the IP range of the subnet or network configured for this forwarding rule. An address can be specified either by a literal IP address or a URL reference to an existing Address resource. The following examples are all valid:
Authorization requires the following Google IAM permission on the specified resource
|
resource.IPProtocol |
The IP protocol to which this rule applies. Valid options are When the load balancing scheme is |
resource.portRange |
This field is used along with the Applicable only when Some types of forwarding target have constraints on the acceptable ports:
@pattern: \d+(?:-\d+)? |
resource.ports[] |
This field is used along with the When the load balancing scheme is You may specify a maximum of up to 5 ports. @pattern: [\d+(, \d+)*] |
resource.target |
The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate to the target object. Authorization requires one or more of the following Google IAM permissions on the specified resource
|
resource.selfLink |
[Output Only] Server-defined URL for the resource. |
resource.loadBalancingScheme |
This signifies what the ForwardingRule will be used for and can only take the following values: |
resource.subnetwork |
This field is not used for external load balancing. For internal load balancing, this field identifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule. If the network specified is in auto subnet mode, this field is optional. However, if the network is in custom subnet mode, a subnetwork must be specified. Authorization requires the following Google IAM permission on the specified resource
|
resource.network |
This field is not used for external load balancing. For internal load balancing, this field identifies the network that the load balanced IP should belong to for this Forwarding Rule. If this field is not specified, the default network will be used. Authorization requires the following Google IAM permission on the specified resource
|
resource.backendService |
This field is not used for external load balancing. For internal load balancing, this field identifies the BackendService resource to receive the matched traffic. Authorization requires the following Google IAM permission on the specified resource
|
resource.ipVersion |
The IP Version that will be used by this forwarding rule. Valid options are |
resource.kind |
[Output Only] Type of the resource. Always |
Response body
If successful, the response body contains data with the following structure:
JSON representation | |
---|---|
{ "operation": { "id": string, "creationTimestamp": string, "name": string, "zone": string, "clientOperationId": string, "operationType": string, "targetLink": string, "targetId": string, "status": enum, "statusMessage": string, "user": string, "progress": number, "insertTime": string, "startTime": string, "endTime": string, "error": { "errors": [ { "code": string, "location": string, "message": string } ] }, "warnings": { "code": enum, "message": string, "data": [ { "key": string, "value": string } ] }, "httpErrorStatusCode": number, "httpErrorMessage": string, "selfLink": string, "region": string, "description": string, "kind": string } } |
Fields | |
---|---|
operation |
|
operation.id |
[Output Only] The unique identifier for the resource. This identifier is defined by the server. |
operation.creationTimestamp |
[Deprecated] This field is deprecated. |
operation.name |
[Output Only] Name of the resource. |
operation.zone |
[Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. |
operation.clientOperationId |
[Output Only] Reserved for future use. |
operation.operationType |
[Output Only] The type of operation, such as |
operation.targetLink |
[Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from. |
operation.targetId |
[Output Only] The unique target ID, which identifies a specific incarnation of the target resource. |
operation.status |
[Output Only] The status of the operation, which can be one of the following: |
operation.statusMessage |
[Output Only] An optional textual description of the current status of the operation. |
operation.user |
[Output Only] User who requested the operation, for example: |
operation.progress |
[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses. |
operation.insertTime |
[Output Only] The time that this operation was requested. This value is in RFC3339 text format. |
operation.startTime |
[Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. |
operation.endTime |
[Output Only] The time that this operation was completed. This value is in RFC3339 text format. |
operation.error |
[Output Only] If errors are generated during processing of the operation, this field will be populated. |
operation.error.errors[] |
[Output Only] The array of errors encountered while processing this operation. |
operation.error.errors[].code |
[Output Only] The error type identifier for this error. |
operation.error.errors[].location |
[Output Only] Indicates the field in the request that caused the error. This property is optional. |
operation.error.errors[].message |
[Output Only] An optional, human-readable error message. |
operation.warnings[] |
[Output Only] If warning messages are generated during processing of the operation, this field will be populated. |
operation.warnings[].code |
[Output Only] A warning code, if applicable. For example, Compute Engine returns |
operation.warnings[].message |
[Output Only] A human-readable description of the warning code. |
operation.warnings[].data[] |
[Output Only] Metadata about this warning in "data": [ { "key": "scope", "value": "zones/us-east1-d" } |
operation.warnings[].data[].key |
[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be |
operation.warnings[].data[].value |
[Output Only] A warning data value corresponding to the key. |
operation.httpErrorStatusCode |
[Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a |
operation.httpErrorMessage |
[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as |
operation.selfLink |
[Output Only] Server-defined URL for the resource. |
operation.region |
[Output Only] The URL of the region where the operation resides. Only available when performing regional operations. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. |
operation.description |
[Output Only] A textual description of the operation, which is set when the operation is created. |
operation.kind |
[Output Only] Type of the resource. Always |
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/cloud-platform
For more information, see the Auth Guide.
IAM Permissions
In addition to any permissions specified on the fields above, authorization requires one or more of the following Google IAM permissions:
compute.globalForwardingRules.create