Package com.google.cloud.networksecurity.v1


@Generated("by gapic-generator-java") package com.google.cloud.networksecurity.v1
A client to Network Security API

The interfaces provided are listed below, along with usage samples.

======================= AddressGroupServiceClient =======================

Service Description: AddressGroup is a resource that manages a collection of IP or Domain Names, it can be used in Firewall Policy to represent allow or deny traffic from all the IP or Domain Names from the Address Group.

Sample for AddressGroupServiceClient:


 // 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/java/docs/setup#configure_endpoints_for_the_client_library
 try (AddressGroupServiceClient addressGroupServiceClient = AddressGroupServiceClient.create()) {
   AddressGroupName name =
       AddressGroupName.ofProjectLocationAddressGroupName(
           "[PROJECT]", "[LOCATION]", "[ADDRESS_GROUP]");
   AddressGroup response = addressGroupServiceClient.getAddressGroup(name);
 }
 

======================= OrganizationAddressGroupServiceClient =======================

Service Description: Organization AddressGroup is created under organization. Requests against Organization AddressGroup will use project from request credential for activation/quota/visibility check.

Sample for OrganizationAddressGroupServiceClient:


 // 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/java/docs/setup#configure_endpoints_for_the_client_library
 try (OrganizationAddressGroupServiceClient organizationAddressGroupServiceClient =
     OrganizationAddressGroupServiceClient.create()) {
   AddressGroupName name =
       AddressGroupName.ofOrganizationLocationAddressGroupName(
           "[ORGANIZATION]", "[LOCATION]", "[ADDRESS_GROUP]");
   AddressGroup response = organizationAddressGroupServiceClient.getAddressGroup(name);
 }
 

======================= DnsThreatDetectorServiceClient =======================

Service Description: The Network Security API for DNS Threat Detectors.

Sample for DnsThreatDetectorServiceClient:


 // 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/java/docs/setup#configure_endpoints_for_the_client_library
 try (DnsThreatDetectorServiceClient dnsThreatDetectorServiceClient =
     DnsThreatDetectorServiceClient.create()) {
   DnsThreatDetectorName name =
       DnsThreatDetectorName.of("[PROJECT]", "[LOCATION]", "[DNS_THREAT_DETECTOR]");
   DnsThreatDetector response = dnsThreatDetectorServiceClient.getDnsThreatDetector(name);
 }
 

======================= FirewallActivationClient =======================

Service Description: Service for managing Firewall Endpoints and Associations.

Sample for FirewallActivationClient:


 // 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/java/docs/setup#configure_endpoints_for_the_client_library
 try (FirewallActivationClient firewallActivationClient = FirewallActivationClient.create()) {
   FirewallEndpointName name =
       FirewallEndpointName.ofOrganizationLocationFirewallEndpointName(
           "[ORGANIZATION]", "[LOCATION]", "[FIREWALL_ENDPOINT]");
   FirewallEndpoint response = firewallActivationClient.getFirewallEndpoint(name);
 }
 

======================= InterceptClient =======================

Service Description: Service for Third-Party Packet Intercept (TPPI). TPPI is the "in-band" flavor of the Network Security Integrations product.

Sample for InterceptClient:


 // 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/java/docs/setup#configure_endpoints_for_the_client_library
 try (InterceptClient interceptClient = InterceptClient.create()) {
   InterceptEndpointGroupName name =
       InterceptEndpointGroupName.of("[PROJECT]", "[LOCATION]", "[INTERCEPT_ENDPOINT_GROUP]");
   InterceptEndpointGroup response = interceptClient.getInterceptEndpointGroup(name);
 }
 

======================= MirroringClient =======================

Service Description: PM2 is the "out-of-band" flavor of the Network Security Integrations product.

Sample for MirroringClient:


 // 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/java/docs/setup#configure_endpoints_for_the_client_library
 try (MirroringClient mirroringClient = MirroringClient.create()) {
   MirroringEndpointGroupName name =
       MirroringEndpointGroupName.of("[PROJECT]", "[LOCATION]", "[MIRRORING_ENDPOINT_GROUP]");
   MirroringEndpointGroup response = mirroringClient.getMirroringEndpointGroup(name);
 }
 

======================= NetworkSecurityClient =======================

Service Description: Network Security API provides resources to configure authentication and authorization policies. Refer to per API resource documentation for more information.

Sample for NetworkSecurityClient:


 // 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/java/docs/setup#configure_endpoints_for_the_client_library
 try (NetworkSecurityClient networkSecurityClient = NetworkSecurityClient.create()) {
   AuthorizationPolicyName name =
       AuthorizationPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTHORIZATION_POLICY]");
   AuthorizationPolicy response = networkSecurityClient.getAuthorizationPolicy(name);
 }
 

======================= OrganizationSecurityProfileGroupServiceClient =======================

Service Description: Organization SecurityProfileGroup is created under organization.

Sample for OrganizationSecurityProfileGroupServiceClient:


 // 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/java/docs/setup#configure_endpoints_for_the_client_library
 try (OrganizationSecurityProfileGroupServiceClient
     organizationSecurityProfileGroupServiceClient =
         OrganizationSecurityProfileGroupServiceClient.create()) {
   SecurityProfileGroupName name =
       SecurityProfileGroupName.ofOrganizationLocationSecurityProfileGroupName(
           "[ORGANIZATION]", "[LOCATION]", "[SECURITY_PROFILE_GROUP]");
   SecurityProfileGroup response =
       organizationSecurityProfileGroupServiceClient.getSecurityProfileGroup(name);
 }