How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/compute.googleapis.com
    // - Login into gcloud by running:
    //   `$ gcloud auth application-default login`
    // - Install the npm module by running:
    //   `$ npm install googleapis`
    
    const {google} = require('googleapis');
    const compute = google.compute('beta');
    
    async function main() {
      const auth = new google.auth.GoogleAuth({
        // Scopes can be specified either as an array or as a single, space-delimited string.
        scopes: [
          'https://www.googleapis.com/auth/cloud-platform',
          'https://www.googleapis.com/auth/compute',
          'https://www.googleapis.com/auth/compute.readonly',
        ],
      });
    
      // Acquire an auth client, and bind it to all future calls
      const authClient = await auth.getClient();
      google.options({auth: authClient});
    
      // Do the magic
      const res = await compute.regionHealthCheckServices.get({
        // Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035.
        healthCheckService: 'placeholder-value',
        // Project ID for this request.
        project:
          '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))',
        // Name of the region scoping this request.
        region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "creationTimestamp": "my_creationTimestamp",
      //   "description": "my_description",
      //   "fingerprint": "my_fingerprint",
      //   "healthChecks": [],
      //   "healthStatusAggregationPolicy": "my_healthStatusAggregationPolicy",
      //   "healthStatusAggregationStrategy": "my_healthStatusAggregationStrategy",
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "name": "my_name",
      //   "networkEndpointGroups": [],
      //   "notificationEndpoints": [],
      //   "region": "my_region",
      //   "selfLink": "my_selfLink"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/compute.googleapis.com
    // - Login into gcloud by running:
    //   `$ gcloud auth application-default login`
    // - Install the npm module by running:
    //   `$ npm install googleapis`
    
    const {google} = require('googleapis');
    const compute = google.compute('alpha');
    
    async function main() {
      const auth = new google.auth.GoogleAuth({
        // Scopes can be specified either as an array or as a single, space-delimited string.
        scopes: [
          'https://www.googleapis.com/auth/cloud-platform',
          'https://www.googleapis.com/auth/compute',
          'https://www.googleapis.com/auth/compute.readonly',
        ],
      });
    
      // Acquire an auth client, and bind it to all future calls
      const authClient = await auth.getClient();
      google.options({auth: authClient});
    
      // Do the magic
      const res = await compute.regionHealthCheckServices.get({
        // Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035.
        healthCheckService: 'placeholder-value',
        // Project ID for this request.
        project:
          '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))',
        // Name of the region scoping this request.
        region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "creationTimestamp": "my_creationTimestamp",
      //   "description": "my_description",
      //   "fingerprint": "my_fingerprint",
      //   "healthChecks": [],
      //   "healthStatusAggregationPolicy": "my_healthStatusAggregationPolicy",
      //   "healthStatusAggregationStrategy": "my_healthStatusAggregationStrategy",
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "name": "my_name",
      //   "networkEndpointGroups": [],
      //   "notificationEndpoints": [],
      //   "region": "my_region",
      //   "selfLink": "my_selfLink",
      //   "selfLinkWithId": "my_selfLinkWithId"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/compute.googleapis.com
    // - Login into gcloud by running:
    //   `$ gcloud auth application-default login`
    // - Install the npm module by running:
    //   `$ npm install googleapis`
    
    const {google} = require('googleapis');
    const compute = google.compute('v1');
    
    async function main() {
      const auth = new google.auth.GoogleAuth({
        // Scopes can be specified either as an array or as a single, space-delimited string.
        scopes: [
          'https://www.googleapis.com/auth/cloud-platform',
          'https://www.googleapis.com/auth/compute',
        ],
      });
    
      // Acquire an auth client, and bind it to all future calls
      const authClient = await auth.getClient();
      google.options({auth: authClient});
    
      // Do the magic
      const res = await compute.regionHealthChecks.patch({
        // Name of the HealthCheck resource to patch.
        healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}',
        // Project ID for this request.
        project:
          '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))',
        // Name of the region scoping this request.
        region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?',
        // 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 ( 00000000-0000-0000-0000-000000000000).
        requestId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "checkIntervalSec": 0,
          //   "creationTimestamp": "my_creationTimestamp",
          //   "description": "my_description",
          //   "grpcHealthCheck": {},
          //   "healthyThreshold": 0,
          //   "http2HealthCheck": {},
          //   "httpHealthCheck": {},
          //   "httpsHealthCheck": {},
          //   "id": "my_id",
          //   "kind": "my_kind",
          //   "logConfig": {},
          //   "name": "my_name",
          //   "region": "my_region",
          //   "selfLink": "my_selfLink",
          //   "sslHealthCheck": {},
          //   "tcpHealthCheck": {},
          //   "timeoutSec": 0,
          //   "type": "my_type",
          //   "unhealthyThreshold": 0
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "clientOperationId": "my_clientOperationId",
      //   "creationTimestamp": "my_creationTimestamp",
      //   "description": "my_description",
      //   "endTime": "my_endTime",
      //   "error": {},
      //   "httpErrorMessage": "my_httpErrorMessage",
      //   "httpErrorStatusCode": 0,
      //   "id": "my_id",
      //   "insertTime": "my_insertTime",
      //   "kind": "my_kind",
      //   "name": "my_name",
      //   "operationGroupId": "my_operationGroupId",
      //   "operationType": "my_operationType",
      //   "progress": 0,
      //   "region": "my_region",
      //   "selfLink": "my_selfLink",
      //   "startTime": "my_startTime",
      //   "status": "my_status",
      //   "statusMessage": "my_statusMessage",
      //   "targetId": "my_targetId",
      //   "targetLink": "my_targetLink",
      //   "user": "my_user",
      //   "warnings": [],
      //   "zone": "my_zone"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/compute.googleapis.com
    // - Login into gcloud by running:
    //   `$ gcloud auth application-default login`
    // - Install the npm module by running:
    //   `$ npm install googleapis`
    
    const {google} = require('googleapis');
    const compute = google.compute('v1');
    
    async function main() {
      const auth = new google.auth.GoogleAuth({
        // Scopes can be specified either as an array or as a single, space-delimited string.
        scopes: [
          'https://www.googleapis.com/auth/cloud-platform',
          'https://www.googleapis.com/auth/compute',
          'https://www.googleapis.com/auth/compute.readonly',
        ],
      });
    
      // Acquire an auth client, and bind it to all future calls
      const authClient = await auth.getClient();
      google.options({auth: authClient});
    
      // Do the magic
      const res = await compute.regionHealthCheckServices.get({
        // Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035.
        healthCheckService: 'placeholder-value',
        // Project ID for this request.
        project:
          '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))',
        // Name of the region scoping this request.
        region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "creationTimestamp": "my_creationTimestamp",
      //   "description": "my_description",
      //   "fingerprint": "my_fingerprint",
      //   "healthChecks": [],
      //   "healthStatusAggregationPolicy": "my_healthStatusAggregationPolicy",
      //   "id": "my_id",
      //   "kind": "my_kind",
      //   "name": "my_name",
      //   "networkEndpointGroups": [],
      //   "notificationEndpoints": [],
      //   "region": "my_region",
      //   "selfLink": "my_selfLink"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // Before running the sample:
    // - Enable the API at:
    //   https://console.developers.google.com/apis/api/compute.googleapis.com
    // - Login into gcloud by running:
    //   `$ gcloud auth application-default login`
    // - Install the npm module by running:
    //   `$ npm install googleapis`
    
    const {google} = require('googleapis');
    const compute = google.compute('alpha');
    
    async function main() {
      const auth = new google.auth.GoogleAuth({
        // Scopes can be specified either as an array or as a single, space-delimited string.
        scopes: [
          'https://www.googleapis.com/auth/cloud-platform',
          'https://www.googleapis.com/auth/compute',
        ],
      });
    
      // Acquire an auth client, and bind it to all future calls
      const authClient = await auth.getClient();
      google.options({auth: authClient});
    
      // Do the magic
      const res = await compute.regionHealthChecks.update({
        // Name of the HealthCheck resource to update.
        healthCheck: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}',
        // Project ID for this request.
        project:
          '(?:(?:[-a-z0-9]{1,63}.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))',
        // Name of the region scoping this request.
        region: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?',
        // 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 ( 00000000-0000-0000-0000-000000000000).
        requestId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "checkIntervalSec": 0,
          //   "creationTimestamp": "my_creationTimestamp",
          //   "description": "my_description",
          //   "grpcHealthCheck": {},
          //   "healthyThreshold": 0,
          //   "http2HealthCheck": {},
          //   "httpHealthCheck": {},
          //   "httpsHealthCheck": {},
          //   "id": "my_id",
          //   "kind": "my_kind",
          //   "logConfig": {},
          //   "name": "my_name",
          //   "region": "my_region",
          //   "selfLink": "my_selfLink",
          //   "selfLinkWithId": "my_selfLinkWithId",
          //   "sslHealthCheck": {},
          //   "tcpHealthCheck": {},
          //   "timeoutSec": 0,
          //   "type": "my_type",
          //   "udpHealthCheck": {},
          //   "unhealthyThreshold": 0
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "clientOperationId": "my_clientOperationId",
      //   "creationTimestamp": "my_creationTimestamp",
      //   "description": "my_description",
      //   "endTime": "my_endTime",
      //   "error": {},
      //   "httpErrorMessage": "my_httpErrorMessage",
      //   "httpErrorStatusCode": 0,
      //   "id": "my_id",
      //   "insertTime": "my_insertTime",
      //   "kind": "my_kind",
      //   "name": "my_name",
      //   "operationGroupId": "my_operationGroupId",
      //   "operationType": "my_operationType",
      //   "progress": 0,
      //   "region": "my_region",
      //   "selfLink": "my_selfLink",
      //   "selfLinkWithId": "my_selfLinkWithId",
      //   "startTime": "my_startTime",
      //   "status": "my_status",
      //   "statusMessage": "my_statusMessage",
      //   "targetId": "my_targetId",
      //   "targetLink": "my_targetLink",
      //   "user": "my_user",
      //   "warnings": [],
      //   "zone": "my_zone"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples