Package networksecurity is an auto-generated package for the Network Security API.
NOTE : This package is in beta . It is not stable , and may be subject to changes .
Use of Context
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go .
Functions
func DefaultAuthScopes
func
DefaultAuthScopes
()
[]
string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
AuthorizationPolicyIterator
type
AuthorizationPolicyIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
networksecuritypb
.
AuthorizationPolicy
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
AuthorizationPolicyIterator manages a stream of *networksecuritypb.AuthorizationPolicy.
func (*AuthorizationPolicyIterator) Next
func
(
it
*
AuthorizationPolicyIterator
)
Next
()
(
*
networksecuritypb
.
AuthorizationPolicy
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AuthorizationPolicyIterator) PageInfo
func
(
it
*
AuthorizationPolicyIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
CallOptions
type
CallOptions
struct
{
ListAuthorizationPolicies
[]
gax
.
CallOption
GetAuthorizationPolicy
[]
gax
.
CallOption
CreateAuthorizationPolicy
[]
gax
.
CallOption
UpdateAuthorizationPolicy
[]
gax
.
CallOption
DeleteAuthorizationPolicy
[]
gax
.
CallOption
ListServerTlsPolicies
[]
gax
.
CallOption
GetServerTlsPolicy
[]
gax
.
CallOption
CreateServerTlsPolicy
[]
gax
.
CallOption
UpdateServerTlsPolicy
[]
gax
.
CallOption
DeleteServerTlsPolicy
[]
gax
.
CallOption
ListClientTlsPolicies
[]
gax
.
CallOption
GetClientTlsPolicy
[]
gax
.
CallOption
CreateClientTlsPolicy
[]
gax
.
CallOption
UpdateClientTlsPolicy
[]
gax
.
CallOption
DeleteClientTlsPolicy
[]
gax
.
CallOption
}
CallOptions contains the retry settings for each method of Client.
Client
type
Client
struct
{
// The call options for this service.
CallOptions
*
CallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient
*
lroauto
.
OperationsClient
// contains filtered or unexported fields
}
Client is a client for interacting with Network Security API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
func NewClient
NewClient creates a new network security client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func (*Client) Close
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection
func
(
c
*
Client
)
Connection
()
*
grpc
.
ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*Client) CreateAuthorizationPolicy
func
(
c
*
Client
)
CreateAuthorizationPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
CreateAuthorizationPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
CreateAuthorizationPolicyOperation
,
error
)
CreateAuthorizationPolicy creates a new AuthorizationPolicy in a given project and location.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
CreateAuthorizationPolicyRequest
{
// TODO: Fill request struct fields.
}
op
,
err
:=
c
.
CreateAuthorizationPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) CreateAuthorizationPolicyOperation
func
(
c
*
Client
)
CreateAuthorizationPolicyOperation
(
name
string
)
*
CreateAuthorizationPolicyOperation
CreateAuthorizationPolicyOperation returns a new CreateAuthorizationPolicyOperation from a given name. The name must be that of a previously created CreateAuthorizationPolicyOperation, possibly from a different process.
func (*Client) CreateClientTlsPolicy
func
(
c
*
Client
)
CreateClientTlsPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
CreateClientTlsPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
CreateClientTlsPolicyOperation
,
error
)
CreateClientTlsPolicy creates a new ClientTlsPolicy in a given project and location.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
CreateClientTlsPolicyRequest
{
// TODO: Fill request struct fields.
}
op
,
err
:=
c
.
CreateClientTlsPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) CreateClientTlsPolicyOperation
func
(
c
*
Client
)
CreateClientTlsPolicyOperation
(
name
string
)
*
CreateClientTlsPolicyOperation
CreateClientTlsPolicyOperation returns a new CreateClientTlsPolicyOperation from a given name. The name must be that of a previously created CreateClientTlsPolicyOperation, possibly from a different process.
func (*Client) CreateServerTlsPolicy
func
(
c
*
Client
)
CreateServerTlsPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
CreateServerTlsPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
CreateServerTlsPolicyOperation
,
error
)
CreateServerTlsPolicy creates a new ServerTlsPolicy in a given project and location.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
CreateServerTlsPolicyRequest
{
// TODO: Fill request struct fields.
}
op
,
err
:=
c
.
CreateServerTlsPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) CreateServerTlsPolicyOperation
func
(
c
*
Client
)
CreateServerTlsPolicyOperation
(
name
string
)
*
CreateServerTlsPolicyOperation
CreateServerTlsPolicyOperation returns a new CreateServerTlsPolicyOperation from a given name. The name must be that of a previously created CreateServerTlsPolicyOperation, possibly from a different process.
func (*Client) DeleteAuthorizationPolicy
func
(
c
*
Client
)
DeleteAuthorizationPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
DeleteAuthorizationPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
DeleteAuthorizationPolicyOperation
,
error
)
DeleteAuthorizationPolicy deletes a single AuthorizationPolicy.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
DeleteAuthorizationPolicyRequest
{
// TODO: Fill request struct fields.
}
op
,
err
:=
c
.
DeleteAuthorizationPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
err
=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*Client) DeleteAuthorizationPolicyOperation
func
(
c
*
Client
)
DeleteAuthorizationPolicyOperation
(
name
string
)
*
DeleteAuthorizationPolicyOperation
DeleteAuthorizationPolicyOperation returns a new DeleteAuthorizationPolicyOperation from a given name. The name must be that of a previously created DeleteAuthorizationPolicyOperation, possibly from a different process.
func (*Client) DeleteClientTlsPolicy
func
(
c
*
Client
)
DeleteClientTlsPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
DeleteClientTlsPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
DeleteClientTlsPolicyOperation
,
error
)
DeleteClientTlsPolicy deletes a single ClientTlsPolicy.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
DeleteClientTlsPolicyRequest
{
// TODO: Fill request struct fields.
}
op
,
err
:=
c
.
DeleteClientTlsPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
err
=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*Client) DeleteClientTlsPolicyOperation
func
(
c
*
Client
)
DeleteClientTlsPolicyOperation
(
name
string
)
*
DeleteClientTlsPolicyOperation
DeleteClientTlsPolicyOperation returns a new DeleteClientTlsPolicyOperation from a given name. The name must be that of a previously created DeleteClientTlsPolicyOperation, possibly from a different process.
func (*Client) DeleteServerTlsPolicy
func
(
c
*
Client
)
DeleteServerTlsPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
DeleteServerTlsPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
DeleteServerTlsPolicyOperation
,
error
)
DeleteServerTlsPolicy deletes a single ServerTlsPolicy.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
DeleteServerTlsPolicyRequest
{
// TODO: Fill request struct fields.
}
op
,
err
:=
c
.
DeleteServerTlsPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
err
=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*Client) DeleteServerTlsPolicyOperation
func
(
c
*
Client
)
DeleteServerTlsPolicyOperation
(
name
string
)
*
DeleteServerTlsPolicyOperation
DeleteServerTlsPolicyOperation returns a new DeleteServerTlsPolicyOperation from a given name. The name must be that of a previously created DeleteServerTlsPolicyOperation, possibly from a different process.
func (*Client) GetAuthorizationPolicy
func
(
c
*
Client
)
GetAuthorizationPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
GetAuthorizationPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
AuthorizationPolicy
,
error
)
GetAuthorizationPolicy gets details of a single AuthorizationPolicy.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
GetAuthorizationPolicyRequest
{
// TODO: Fill request struct fields.
}
resp
,
err
:=
c
.
GetAuthorizationPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) GetClientTlsPolicy
func
(
c
*
Client
)
GetClientTlsPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
GetClientTlsPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
ClientTlsPolicy
,
error
)
GetClientTlsPolicy gets details of a single ClientTlsPolicy.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
GetClientTlsPolicyRequest
{
// TODO: Fill request struct fields.
}
resp
,
err
:=
c
.
GetClientTlsPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) GetServerTlsPolicy
func
(
c
*
Client
)
GetServerTlsPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
GetServerTlsPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
ServerTlsPolicy
,
error
)
GetServerTlsPolicy gets details of a single ServerTlsPolicy.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
GetServerTlsPolicyRequest
{
// TODO: Fill request struct fields.
}
resp
,
err
:=
c
.
GetServerTlsPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) ListAuthorizationPolicies
func
(
c
*
Client
)
ListAuthorizationPolicies
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
ListAuthorizationPoliciesRequest
,
opts
...
gax
.
CallOption
)
*
AuthorizationPolicyIterator
ListAuthorizationPolicies lists AuthorizationPolicies in a given project and location.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
"google.golang.org/api/iterator"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
ListAuthorizationPoliciesRequest
{
// TODO: Fill request struct fields.
}
it
:=
c
.
ListAuthorizationPolicies
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*Client) ListClientTlsPolicies
func
(
c
*
Client
)
ListClientTlsPolicies
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
ListClientTlsPoliciesRequest
,
opts
...
gax
.
CallOption
)
*
ClientTlsPolicyIterator
ListClientTlsPolicies lists ClientTlsPolicies in a given project and location.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
"google.golang.org/api/iterator"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
ListClientTlsPoliciesRequest
{
// TODO: Fill request struct fields.
}
it
:=
c
.
ListClientTlsPolicies
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*Client) ListServerTlsPolicies
func
(
c
*
Client
)
ListServerTlsPolicies
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
ListServerTlsPoliciesRequest
,
opts
...
gax
.
CallOption
)
*
ServerTlsPolicyIterator
ListServerTlsPolicies lists ServerTlsPolicies in a given project and location.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
"google.golang.org/api/iterator"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
ListServerTlsPoliciesRequest
{
// TODO: Fill request struct fields.
}
it
:=
c
.
ListServerTlsPolicies
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*Client) UpdateAuthorizationPolicy
func
(
c
*
Client
)
UpdateAuthorizationPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
UpdateAuthorizationPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
UpdateAuthorizationPolicyOperation
,
error
)
UpdateAuthorizationPolicy updates the parameters of a single AuthorizationPolicy.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
UpdateAuthorizationPolicyRequest
{
// TODO: Fill request struct fields.
}
op
,
err
:=
c
.
UpdateAuthorizationPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) UpdateAuthorizationPolicyOperation
func
(
c
*
Client
)
UpdateAuthorizationPolicyOperation
(
name
string
)
*
UpdateAuthorizationPolicyOperation
UpdateAuthorizationPolicyOperation returns a new UpdateAuthorizationPolicyOperation from a given name. The name must be that of a previously created UpdateAuthorizationPolicyOperation, possibly from a different process.
func (*Client) UpdateClientTlsPolicy
func
(
c
*
Client
)
UpdateClientTlsPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
UpdateClientTlsPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
UpdateClientTlsPolicyOperation
,
error
)
UpdateClientTlsPolicy updates the parameters of a single ClientTlsPolicy.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
UpdateClientTlsPolicyRequest
{
// TODO: Fill request struct fields.
}
op
,
err
:=
c
.
UpdateClientTlsPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) UpdateClientTlsPolicyOperation
func
(
c
*
Client
)
UpdateClientTlsPolicyOperation
(
name
string
)
*
UpdateClientTlsPolicyOperation
UpdateClientTlsPolicyOperation returns a new UpdateClientTlsPolicyOperation from a given name. The name must be that of a previously created UpdateClientTlsPolicyOperation, possibly from a different process.
func (*Client) UpdateServerTlsPolicy
func
(
c
*
Client
)
UpdateServerTlsPolicy
(
ctx
context
.
Context
,
req
*
networksecuritypb
.
UpdateServerTlsPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
UpdateServerTlsPolicyOperation
,
error
)
UpdateServerTlsPolicy updates the parameters of a single ServerTlsPolicy.
Example
package
main
import
(
"context"
networksecurity
"cloud.google.com/go/networksecurity/apiv1beta1"
networksecuritypb
"google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1"
)
func
main
()
{
ctx
:=
context
.
Background
()
c
,
err
:=
networksecurity
.
NewClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& networksecuritypb
.
UpdateServerTlsPolicyRequest
{
// TODO: Fill request struct fields.
}
op
,
err
:=
c
.
UpdateServerTlsPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*Client) UpdateServerTlsPolicyOperation
func
(
c
*
Client
)
UpdateServerTlsPolicyOperation
(
name
string
)
*
UpdateServerTlsPolicyOperation
UpdateServerTlsPolicyOperation returns a new UpdateServerTlsPolicyOperation from a given name. The name must be that of a previously created UpdateServerTlsPolicyOperation, possibly from a different process.
ClientTlsPolicyIterator
type
ClientTlsPolicyIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
networksecuritypb
.
ClientTlsPolicy
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
ClientTlsPolicyIterator manages a stream of *networksecuritypb.ClientTlsPolicy.
func (*ClientTlsPolicyIterator) Next
func
(
it
*
ClientTlsPolicyIterator
)
Next
()
(
*
networksecuritypb
.
ClientTlsPolicy
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ClientTlsPolicyIterator) PageInfo
func
(
it
*
ClientTlsPolicyIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
CreateAuthorizationPolicyOperation
type
CreateAuthorizationPolicyOperation
struct
{
// contains filtered or unexported fields
}
CreateAuthorizationPolicyOperation manages a long-running operation from CreateAuthorizationPolicy.
func (*CreateAuthorizationPolicyOperation) Done
func
(
op
*
CreateAuthorizationPolicyOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*CreateAuthorizationPolicyOperation) Metadata
func
(
op
*
CreateAuthorizationPolicyOperation
)
Metadata
()
(
*
networksecuritypb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateAuthorizationPolicyOperation) Name
func
(
op
*
CreateAuthorizationPolicyOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateAuthorizationPolicyOperation) Poll
func
(
op
*
CreateAuthorizationPolicyOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
AuthorizationPolicy
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateAuthorizationPolicyOperation) Wait
func
(
op
*
CreateAuthorizationPolicyOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
AuthorizationPolicy
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateClientTlsPolicyOperation
type
CreateClientTlsPolicyOperation
struct
{
// contains filtered or unexported fields
}
CreateClientTlsPolicyOperation manages a long-running operation from CreateClientTlsPolicy.
func (*CreateClientTlsPolicyOperation) Done
func
(
op
*
CreateClientTlsPolicyOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*CreateClientTlsPolicyOperation) Metadata
func
(
op
*
CreateClientTlsPolicyOperation
)
Metadata
()
(
*
networksecuritypb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateClientTlsPolicyOperation) Name
func
(
op
*
CreateClientTlsPolicyOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateClientTlsPolicyOperation) Poll
func
(
op
*
CreateClientTlsPolicyOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
ClientTlsPolicy
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateClientTlsPolicyOperation) Wait
func
(
op
*
CreateClientTlsPolicyOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
ClientTlsPolicy
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateServerTlsPolicyOperation
type
CreateServerTlsPolicyOperation
struct
{
// contains filtered or unexported fields
}
CreateServerTlsPolicyOperation manages a long-running operation from CreateServerTlsPolicy.
func (*CreateServerTlsPolicyOperation) Done
func
(
op
*
CreateServerTlsPolicyOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*CreateServerTlsPolicyOperation) Metadata
func
(
op
*
CreateServerTlsPolicyOperation
)
Metadata
()
(
*
networksecuritypb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateServerTlsPolicyOperation) Name
func
(
op
*
CreateServerTlsPolicyOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateServerTlsPolicyOperation) Poll
func
(
op
*
CreateServerTlsPolicyOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
ServerTlsPolicy
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateServerTlsPolicyOperation) Wait
func
(
op
*
CreateServerTlsPolicyOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
ServerTlsPolicy
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteAuthorizationPolicyOperation
type
DeleteAuthorizationPolicyOperation
struct
{
// contains filtered or unexported fields
}
DeleteAuthorizationPolicyOperation manages a long-running operation from DeleteAuthorizationPolicy.
func (*DeleteAuthorizationPolicyOperation) Done
func
(
op
*
DeleteAuthorizationPolicyOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*DeleteAuthorizationPolicyOperation) Metadata
func
(
op
*
DeleteAuthorizationPolicyOperation
)
Metadata
()
(
*
networksecuritypb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteAuthorizationPolicyOperation) Name
func
(
op
*
DeleteAuthorizationPolicyOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteAuthorizationPolicyOperation) Poll
func
(
op
*
DeleteAuthorizationPolicyOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteAuthorizationPolicyOperation) Wait
func
(
op
*
DeleteAuthorizationPolicyOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteClientTlsPolicyOperation
type
DeleteClientTlsPolicyOperation
struct
{
// contains filtered or unexported fields
}
DeleteClientTlsPolicyOperation manages a long-running operation from DeleteClientTlsPolicy.
func (*DeleteClientTlsPolicyOperation) Done
func
(
op
*
DeleteClientTlsPolicyOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*DeleteClientTlsPolicyOperation) Metadata
func
(
op
*
DeleteClientTlsPolicyOperation
)
Metadata
()
(
*
networksecuritypb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteClientTlsPolicyOperation) Name
func
(
op
*
DeleteClientTlsPolicyOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteClientTlsPolicyOperation) Poll
func
(
op
*
DeleteClientTlsPolicyOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteClientTlsPolicyOperation) Wait
func
(
op
*
DeleteClientTlsPolicyOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteServerTlsPolicyOperation
type
DeleteServerTlsPolicyOperation
struct
{
// contains filtered or unexported fields
}
DeleteServerTlsPolicyOperation manages a long-running operation from DeleteServerTlsPolicy.
func (*DeleteServerTlsPolicyOperation) Done
func
(
op
*
DeleteServerTlsPolicyOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*DeleteServerTlsPolicyOperation) Metadata
func
(
op
*
DeleteServerTlsPolicyOperation
)
Metadata
()
(
*
networksecuritypb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteServerTlsPolicyOperation) Name
func
(
op
*
DeleteServerTlsPolicyOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteServerTlsPolicyOperation) Poll
func
(
op
*
DeleteServerTlsPolicyOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteServerTlsPolicyOperation) Wait
func
(
op
*
DeleteServerTlsPolicyOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
ServerTlsPolicyIterator
type
ServerTlsPolicyIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
networksecuritypb
.
ServerTlsPolicy
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
ServerTlsPolicyIterator manages a stream of *networksecuritypb.ServerTlsPolicy.
func (*ServerTlsPolicyIterator) Next
func
(
it
*
ServerTlsPolicyIterator
)
Next
()
(
*
networksecuritypb
.
ServerTlsPolicy
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ServerTlsPolicyIterator) PageInfo
func
(
it
*
ServerTlsPolicyIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
UpdateAuthorizationPolicyOperation
type
UpdateAuthorizationPolicyOperation
struct
{
// contains filtered or unexported fields
}
UpdateAuthorizationPolicyOperation manages a long-running operation from UpdateAuthorizationPolicy.
func (*UpdateAuthorizationPolicyOperation) Done
func
(
op
*
UpdateAuthorizationPolicyOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UpdateAuthorizationPolicyOperation) Metadata
func
(
op
*
UpdateAuthorizationPolicyOperation
)
Metadata
()
(
*
networksecuritypb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateAuthorizationPolicyOperation) Name
func
(
op
*
UpdateAuthorizationPolicyOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateAuthorizationPolicyOperation) Poll
func
(
op
*
UpdateAuthorizationPolicyOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
AuthorizationPolicy
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateAuthorizationPolicyOperation) Wait
func
(
op
*
UpdateAuthorizationPolicyOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
AuthorizationPolicy
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateClientTlsPolicyOperation
type
UpdateClientTlsPolicyOperation
struct
{
// contains filtered or unexported fields
}
UpdateClientTlsPolicyOperation manages a long-running operation from UpdateClientTlsPolicy.
func (*UpdateClientTlsPolicyOperation) Done
func
(
op
*
UpdateClientTlsPolicyOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UpdateClientTlsPolicyOperation) Metadata
func
(
op
*
UpdateClientTlsPolicyOperation
)
Metadata
()
(
*
networksecuritypb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateClientTlsPolicyOperation) Name
func
(
op
*
UpdateClientTlsPolicyOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateClientTlsPolicyOperation) Poll
func
(
op
*
UpdateClientTlsPolicyOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
ClientTlsPolicy
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateClientTlsPolicyOperation) Wait
func
(
op
*
UpdateClientTlsPolicyOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
ClientTlsPolicy
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateServerTlsPolicyOperation
type
UpdateServerTlsPolicyOperation
struct
{
// contains filtered or unexported fields
}
UpdateServerTlsPolicyOperation manages a long-running operation from UpdateServerTlsPolicy.
func (*UpdateServerTlsPolicyOperation) Done
func
(
op
*
UpdateServerTlsPolicyOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UpdateServerTlsPolicyOperation) Metadata
func
(
op
*
UpdateServerTlsPolicyOperation
)
Metadata
()
(
*
networksecuritypb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateServerTlsPolicyOperation) Name
func
(
op
*
UpdateServerTlsPolicyOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateServerTlsPolicyOperation) Poll
func
(
op
*
UpdateServerTlsPolicyOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
ServerTlsPolicy
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateServerTlsPolicyOperation) Wait
func
(
op
*
UpdateServerTlsPolicyOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
networksecuritypb
.
ServerTlsPolicy
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.