קבלת היסטוריית הנכסים

אתם יכולים לאחזר עד 35 ימים של היסטוריית יצירה, עדכון ומחיקה של הנכסים שלכם בפרויקטים או בארגונים ב- Cloud de Confiance by S3NS . נכסים שלא השתנו ב-35 הימים האחרונים מדווחים על הסטטוס האחרון שלהם.

לפני שמתחילים

  1. מפעילים את Cloud Asset Inventory API בפרויקט שממנו מריצים את הפקודות של מאגר משאבי ענן.

    הפעלת Cloud Asset Inventory API

  2. מוודאים שלחשבון שלכם יש את התפקיד המתאים כדי להפעיל את Cloud Asset Inventory API. בקטע הרשאות מפורטות ההרשאות הספציפיות לכל סוג קריאה.

מגבלות

אפשר לאחזר את היסטוריית הנכסים רק ברמת הארגון וברמת הפרויקט. אי אפשר להעלות תיקיות.

איך מקבלים את היסטוריית הנכסים

המסוף

כדי לקבל את ההיסטוריה של הנכסים שמאוחסנים ב- Cloud de Confiance by S3NS, פועלים לפי השלבים הבאים:

  1. נכנסים לדף Asset Inventory במסוף Cloud de Confiance .

    מעבר למלאי הנכסים

  2. עוברים לפרויקט, לתיקייה או לארגון שרוצים לחפש בהם.
  3. לוחצים על הכרטיסייה משאב.
  4. בחלונית Filter results, בוחרים סוג משאב או מיקום כדי לסנן את התוצאות.
  5. לוחצים על משאב בחלונית התוצאות.
  6. לוחצים על הכרטיסייה היסטוריית שינויים.
  7. בוחרים את שעת ההתחלה ואת שעת הסיום של הדוח.
  8. משתמשים בתיבות הרשימה Select a record to compare כדי להציג את ההבדלים בין הרשומות בתאריכים שנבחרו.

אחרי שמבצעים חיפוש, המשאבים שתואמים לשאילתה מופיעים בטבלה Results. לוחצים לחיצה כפולה על השאילתה כדי לערוך אותה, או משתמשים בחלונית Filter results כדי להגביל את תוצאות החיפוש לפי קריטריונים ספציפיים.

כדי לראות את השאילתה כפקודה של Google Cloud CLI, לוחצים על View query.

כדי לייצא את התוצאות, לוחצים על הורדת CSV.

gcloud

gcloud asset get-history \
    --SCOPE \
    --asset-names=ASSET_NAME_1,ASSET_NAME_2,... \
    --content-type=CONTENT_TYPE \
    --start-time="START_TIME" \
    --end-time="END_TIME"

מספקים את הערכים הבאים:

  • ‫SCOPE: משתמשים באחד מהערכים הבאים:

    • ‫project=PROJECT_ID, כאשר PROJECT_ID הוא מזהה הפרויקט שכולל את הנכס שרוצים לאחזר.
    • ‫organization=ORGANIZATION_ID, כאשר ORGANIZATION_ID הוא המזהה של הארגון שבו נמצא הנכס שרוצים לאחזר.

      איך מוצאים את המזהה של ארגון ב- Cloud de Confiance by S3NS

      מסוףCloud de Confiance

      כדי למצוא את המזהה של ארגון ב- Cloud de Confiance by S3NS :

      1. נכנסים למסוף Cloud de Confiance .

        כניסה למסוף Cloud de Confiance

      2. לוחצים על תיבת הרשימה switcher בסרגל התפריטים.
      3. בוחרים את הארגון שלכם בתיבת הרשימה.
      4. לוחצים על הכרטיסייה הכול. מזהה הארגון מופיע לצד שם הארגון.

      ‫CLI של gcloud

      כדי לאחזר את המזהה של ארגון ב- Cloud de Confiance by S3NS , משתמשים בפקודה הבאה:

      gcloud organizations describe ORGANIZATION_NAME --format="value(name.segment(1))"
  • ‫ASSET_NAME_#: רשימה מופרדת בפסיקים של השמות המלאים של הנכסים.
  • ‫CONTENT_TYPE: סוג התוכן של המטא-נתונים שרוצים לאחזר. אם לא מציינים את --content-type, מוחזר רק מידע בסיסי, כמו שמות הנכסים, הפעם האחרונה שבה הנכסים עודכנו, והפרויקטים, התיקיות והארגונים שאליהם הם שייכים.
  • ‫START_TIME: ההתחלה של טווח התאריכים, בפורמט datetime של נושא gcloud. הערך צריך להיות עד 35 ימים בעבר.
  • ‫END_TIME: אופציונלי. נקודת הסיום של טווח תאריכים, בפורמט datetime של נושא gcloud. הערך צריך להיות עד 35 ימים בעבר. אם לא מציינים את --end-time, המערכת מגדירה אותו לשעה הנוכחית.

כל האפשרויות מפורטות במדריך העזר ל-CLI של gcloud.

דוגמה

מריצים את הפקודה הבאה כדי לקבל את המטא-נתונים של ההיסטוריה של resource במכונה my-instance של Compute Engine בפרויקט my-project בין 30 בינואר 2024 ל-5 בפברואר 2024. למכונה יש את המאפיינים הבאים:

  • שם המכונה: my-instance
  • פרויקט: my-project
  • מיקום: us-central1-a
gcloud asset get-history \
    --project=my-project \
    --asset-names=//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance \
    --content-type=resource \
    --start-time="2024-01-30" \
    --end-time="2024-02-05"

דוגמה לתשובה

---
asset:
  ancestors:
  - projects/000000000000
  - folders/000000000000
  - organizations/000000000000
  assetType: compute.googleapis.com/Instance
  name: //compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance
  resource:
    data:
      LATEST_ASSET_METADATA
    discoveryDocumentUri: https://compute.s3nsapis.fr/$discovery/rest?version=v1
    discoveryName: Instance
    location: us-central1-a
    parent: //cloudresourcemanager.googleapis.com/projects/000000000000
    version: v1
  updateTime: '2024-02-05T16:00:25.259186Z'
window:
  endTime: '2024-02-05T16:00:25.259186Z'
  startTime: '2024-02-03T16:00:28.854779Z'
---
asset:
  ancestors:
  - projects/000000000000
  - folders/000000000000
  - organizations/000000000000
  assetType: compute.googleapis.com/Instance
  name: //compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance
  resource:
    data:
      EARLIEST_ASSET_METADATA
    discoveryDocumentUri: https://compute.s3nsapis.fr/$discovery/rest?version=v1
    discoveryName: Instance
    location: us-central1-a
    parent: //cloudresourcemanager.googleapis.com/projects/000000000000
    version: v1
  updateTime: '2024-02-03T16:00:28.854779Z'
window:
  endTime: '2024-02-03T16:00:28.854779Z'
  startTime: '2024-01-30T08:00:22.930462Z'

REST

ה-method של ה-HTTP וכתובת ה-URL:

POST https://cloudasset.googleapis.com/v1/SCOPE_PATH:batchGetAssetsHistory

תוכן בקשת JSON:

{
  "assetNames": [
    "ASSET_NAME_1",
    "ASSET_NAME_2",
    "..."
  ],
  "contentType": "CONTENT_TYPE",
  "readTimeWindow": {
    "startTime": "START_TIME",
    "endTime": "END_TIME"
  }
}

מספקים את הערכים הבאים:

  • ‫SCOPE_PATH: משתמשים באחד מהערכים הבאים:

    • ‫projects/PROJECT_ID, כאשר PROJECT_ID הוא מזהה הפרויקט שכולל את הנכס שרוצים לאחזר.
    • ‫projects/PROJECT_NUMBER, כאשר PROJECT_NUMBER הוא מספר הפרויקט שבו נמצא הנכס שרוצים לאחזר.

      איך מוצאים את Cloud de Confiance by S3NS מספר הפרויקט

      מסוףCloud de Confiance

      כדי למצוא את מספר הפרויקט ב- Cloud de Confiance by S3NS :

      1. נכנסים לדף Welcome במסוף Cloud de Confiance .

        לדף Welcome

      2. לוחצים על תיבת הרשימה switcher בסרגל התפריטים.
      3. בוחרים את הארגון מתיבת הרשימה ומחפשים את שם הפרויקט. שם הפרויקט, מספר הפרויקט ומזהה הפרויקט מופיעים ליד הכותרת Welcome.

        מוצגים עד 4,000 משאבים. אם הפרויקט שחיפשתם לא מופיע, נכנסים לדף Manage resources ומסננים את הרשימה לפי שם הפרויקט.

      ‫CLI של gcloud

      כדי לאחזר את מספר הפרויקט, משתמשים בפקודה הבאה: Cloud de Confiance by S3NS

      gcloud projects describe PROJECT_ID --format="value(projectNumber)"
    • ‫organizations/ORGANIZATION_ID, כאשר ORGANIZATION_ID הוא המזהה של הארגון שבו נמצא הנכס שרוצים לאחזר.

      איך מוצאים את המזהה של ארגון ב- Cloud de Confiance by S3NS

      מסוףCloud de Confiance

      כדי למצוא את המזהה של ארגון ב- Cloud de Confiance by S3NS :

      1. נכנסים למסוף Cloud de Confiance .

        כניסה למסוף Cloud de Confiance

      2. לוחצים על תיבת הרשימה switcher בסרגל התפריטים.
      3. בוחרים את הארגון שלכם בתיבת הרשימה.
      4. לוחצים על הכרטיסייה הכול. מזהה הארגון מופיע לצד שם הארגון.

      ‫CLI של gcloud

      כדי לאחזר את המזהה של ארגון ב- Cloud de Confiance by S3NS , משתמשים בפקודה הבאה:

      gcloud organizations describe ORGANIZATION_NAME --format="value(name.segment(1))"
  • ‫ASSET_NAME_#: מערך של שמות הנכסים המלאים.
  • ‫CONTENT_TYPE: סוג התוכן של המטא-נתונים שרוצים לאחזר. אם לא מציינים את contentType, מוחזר רק מידע בסיסי, כמו שמות הנכסים, הפעם האחרונה שבה הנכסים עודכנו, והפרויקטים, התיקיות והארגונים שאליהם הם שייכים.
  • ‫START_TIME: ההתחלה של טווח התאריכים, בפורמט RFC 3339. הערך צריך להיות עד 35 ימים בעבר.
  • ‫END_TIME: אופציונלי. נקודת הסיום של טווח תאריכים, בפורמט RFC 3339. הערך צריך להיות עד 35 ימים בעבר. אם לא מציינים את endTime, הוא מוגדר לשעה הנוכחית.

כל האפשרויות מפורטות במאמר העזרה בנושא REST.

דוגמאות לפקודות

מריצים אחת מהפקודות הבאות כדי לקבל את ההיסטוריה של resource במכונה my-instance של Compute Engine בפרויקט my-project, בין 30 בינואר 2024 ל-5 בפברואר 2024. למכונה יש את המאפיינים הבאים:

  • שם המכונה: my-instance
  • פרויקט: my-project
  • מיקום: us-central1-a

‏Curl (Linux,‏ macOS או Cloud Shell)

curl -X POST \
     -H "X-HTTP-Method-Override: GET" \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d '{
            "assetNames": ["//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance"],
            "contentType": "RESOURCE",
            "readTimeWindow": {
              "startTime": "2024-01-30T00:00:00Z",
              "endTime": "2024-02-05T00:00:00Z"
            }
          }' \
     https://cloudasset.googleapis.com/v1/projects/my-project:batchGetAssetsHistory

‎PowerShell (Windows)

$cred = gcloud auth print-access-token

$headers = @{ 
  "X-HTTP-Method-Override" = "GET";
  "Authorization" = "Bearer $cred"
}


$body = @"
{
  "assetNames": ["//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance"],
  "contentType": "RESOURCE",
  "readTimeWindow": {
    "startTime": "2024-01-30T00:00:00Z",
    "endTime": "2024-02-05T00:00:00Z"
  }
}
"@

Invoke-WebRequest `
  -Method POST `
  -Headers $headers `
  -ContentType: "application/json; charset=utf-8" `
  -Body $body `
  -Uri "https://cloudasset.googleapis.com/v1/projects/my-project:batchGetAssetsHistory" | Select-Object -Expand Content

דוגמה לתשובה

{
  "assets": [
    {
      "window": {
        "startTime": "2024-02-03T16:00:28.854779Z",
        "endTime": "2024-02-05T16:00:25.259186Z"
      },
      "asset": {
        "name": "//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance",
        "assetType": "compute.googleapis.com/Instance",
        "resource": {
          "version": "v1",
          "discoveryDocumentUri": "https://compute.s3nsapis.fr/$discovery/rest?version=v1",
          "discoveryName": "Instance",
          "parent": "//cloudresourcemanager.googleapis.com/projects/000000000000",
          "data": {
            LATEST_ASSET_METADATA
          },
          "location": "us-central1-a"
        },
        "ancestors": [
          "projects/000000000000",
          "folders/000000000000",
          "organizations/000000000000"
        ],
        "updateTime": "2024-02-05T16:00:25.259186Z"
      }
    },
    {
      "window": {
        "startTime": "2024-01-30T08:00:22.930462Z",
        "endTime": "2024-02-03T16:00:28.854779Z"
      },
      "asset": {
        "name": "//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance",
        "assetType": "compute.googleapis.com/Instance",
        "resource": {
          "version": "v1",
          "discoveryDocumentUri": "https://compute.s3nsapis.fr/$discovery/rest?version=v1",
          "discoveryName": "Instance",
          "parent": "//cloudresourcemanager.googleapis.com/projects/000000000000",
          "data": {
            EARLIEST_ASSET_METADATA
          },
          "location": "us-central1-a"
        },
        "ancestors": [
          "projects/000000000000",
          "folders/000000000000",
          "organizations/000000000000"
        ],
        "updateTime": "2024-02-03T16:00:28.854779Z"
      }
    }
  ]
}

C#‎

מידע על התקנת ספריית הלקוח של מאגר משאבי ענן והשימוש בה מופיע במאמר ספריות הלקוח של מאגר משאבי ענן.

כדי לבצע אימות במאגר משאבי ענן, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.

לפני שמריצים דוגמאות קוד, צריך להגדיר את משתנה הסביבה GOOGLE_CLOUD_UNIVERSE_DOMAIN לערך s3nsapis.fr.


using Google.Api.Gax.ResourceNames;
using Google.Cloud.Asset.V1;
using Google.Protobuf.WellKnownTypes;
using System;

public class BatchGetAssetsHistorySample
{
    public BatchGetAssetsHistoryResponse BatchGetAssetsHistory(string[] assetNames, DateTimeOffset startTime, string projectId)
    {
        // Create the client.
        AssetServiceClient client = AssetServiceClient.Create();

        // Build the request.
        BatchGetAssetsHistoryRequest request = new BatchGetAssetsHistoryRequest
        {
            ParentAsResourceName = ProjectName.FromProject(projectId),
            ContentType = ContentType.Resource,
            ReadTimeWindow = new TimeWindow
            {
                StartTime = Timestamp.FromDateTimeOffset(startTime)
            }
        };
        request.AssetNames.AddRange(assetNames);

        // Call the API.
        BatchGetAssetsHistoryResponse response = client.BatchGetAssetsHistory(request);

        // Return the result.
        return response;
    }
}

המשך

מידע על התקנת ספריית הלקוח של מאגר משאבי ענן והשימוש בה מופיע במאמר ספריות הלקוח של מאגר משאבי ענן.

כדי לבצע אימות במאגר משאבי ענן, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.

לפני שמריצים דוגמאות קוד, צריך להגדיר את משתנה הסביבה GOOGLE_CLOUD_UNIVERSE_DOMAIN לערך s3nsapis.fr.


// Sample asset-quickstart batch-gets assets history.
package main

import (
	"context"
	"fmt"
	"log"
	"os"
	"time"

	asset "cloud.google.com/go/asset/apiv1"
	"cloud.google.com/go/asset/apiv1/assetpb"
	"github.com/golang/protobuf/ptypes/timestamp"
)

func main() {
	ctx := context.Background()
	client, err := asset.NewClient(ctx)
	if err != nil {
		log.Fatal(err)
	}
	defer client.Close()

	projectID := os.Getenv("GOOGLE_CLOUD_PROJECT")
	bucketResourceName := fmt.Sprintf("//storage.googleapis.com/%s-for-assets", projectID)
	req := &assetpb.BatchGetAssetsHistoryRequest{
		Parent:      fmt.Sprintf("projects/%s", projectID),
		AssetNames:  []string{bucketResourceName},
		ContentType: assetpb.ContentType_RESOURCE,
		ReadTimeWindow: &assetpb.TimeWindow{
			StartTime: &timestamp.Timestamp{
				Seconds: time.Now().Unix(),
			},
		},
	}
	response, err := client.BatchGetAssetsHistory(ctx, req)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Print(response)
}

Java

מידע על התקנת ספריית הלקוח של מאגר משאבי ענן והשימוש בה מופיע במאמר ספריות הלקוח של מאגר משאבי ענן.

כדי לבצע אימות במאגר משאבי ענן, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.

לפני שמריצים דוגמאות קוד, צריך להגדיר את משתנה הסביבה GOOGLE_CLOUD_UNIVERSE_DOMAIN לערך s3nsapis.fr.

// Imports the Google Cloud client library

import com.google.cloud.ServiceOptions;
import com.google.cloud.asset.v1.AssetServiceClient;
import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest;
import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse;
import com.google.cloud.asset.v1.ContentType;
import com.google.cloud.asset.v1.ProjectName;
import com.google.cloud.asset.v1.TimeWindow;
import java.util.Arrays;

public class BatchGetAssetsHistoryExample {

  // Use the default project Id.
  private static final String projectId = ServiceOptions.getDefaultProjectId();

  public static void main(String... args) throws Exception {
    // Asset names, e.g.: "//storage.googleapis.com/[BUCKET_NAME]"
    String[] assetNames = args[0].split(",");
    try (AssetServiceClient client = AssetServiceClient.create()) {
      ProjectName parent = ProjectName.of(projectId);
      ContentType contentType = ContentType.RESOURCE;
      TimeWindow readTimeWindow = TimeWindow.newBuilder().build();
      BatchGetAssetsHistoryRequest request =
          BatchGetAssetsHistoryRequest.newBuilder()
              .setParent(parent.toString())
              .addAllAssetNames(Arrays.asList(assetNames))
              .setContentType(contentType)
              .setReadTimeWindow(readTimeWindow)
              .build();
      BatchGetAssetsHistoryResponse response = client.batchGetAssetsHistory(request);
      System.out.println(response);
    }
  }
}

Node.js

מידע על התקנת ספריית הלקוח של מאגר משאבי ענן והשימוש בה מופיע במאמר ספריות הלקוח של מאגר משאבי ענן.

כדי לבצע אימות במאגר משאבי ענן, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.

לפני שמריצים דוגמאות קוד, צריך להגדיר את משתנה הסביבה GOOGLE_CLOUD_UNIVERSE_DOMAIN לערך s3nsapis.fr.

/**
 * TODO(developer): Uncomment these variables before running the sample.
 */
// const assetNames = '//storage.googleapis.com/<BUCKET_NAME1>,//storage.googleapis.com/<BUCKET_NAME2>';
// const contentType = 'RESOURCE';

const util = require('util');
const {AssetServiceClient} = require('@google-cloud/asset');

const client = new AssetServiceClient();

async function batchGetAssetsHistory() {
  const projectId = await client.getProjectId();
  const projectResource = `projects/${projectId}`;
  // TODO(developer): Choose asset names, such as //storage.googleapis.com/[YOUR_BUCKET_NAME].
  // const assetNames = ['ASSET_NAME1', 'ASSET_NAME2', ...];

  const request = {
    parent: projectResource,
    assetNames: assetNames.split(','),
    contentType: contentType,
    readTimeWindow: {
      startTime: {
        seconds: Math.floor(new Date().getTime() / 1000),
      },
    },
  };

  // Handle the operation using the promise pattern.
  const result = await client.batchGetAssetsHistory(request);
  // Do things with with the response.
  console.log(util.inspect(result, {depth: null}));

PHP

מידע על התקנת ספריית הלקוח של מאגר משאבי ענן והשימוש בה מופיע במאמר ספריות הלקוח של מאגר משאבי ענן.

כדי לבצע אימות במאגר משאבי ענן, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.

לפני שמריצים דוגמאות קוד, צריך להגדיר את משתנה הסביבה GOOGLE_CLOUD_UNIVERSE_DOMAIN לערך s3nsapis.fr.

use Google\Cloud\Asset\V1\BatchGetAssetsHistoryRequest;
use Google\Cloud\Asset\V1\Client\AssetServiceClient;
use Google\Cloud\Asset\V1\ContentType;
use Google\Cloud\Asset\V1\TimeWindow;
use Google\Protobuf\Timestamp;

/**
 * @param string   $projectId  Tthe project Id for list assets.
 * @param string[] $assetNames (Optional) Asset types to list for.
 */
function batch_get_assets_history(string $projectId, array $assetNames): void
{
    $client = new AssetServiceClient();
    $formattedParent = $client->projectName($projectId);
    $contentType = ContentType::RESOURCE;
    $readTimeWindow = new TimeWindow(['start_time' => new Timestamp(['seconds' => time()])]);
    $request = (new BatchGetAssetsHistoryRequest())
        ->setParent($formattedParent)
        ->setContentType($contentType)
        ->setReadTimeWindow($readTimeWindow)
        ->setAssetNames($assetNames);

    $resp = $client->batchGetAssetsHistory($request);

    # Do things with response.
    print($resp->serializeToString());
}

Python

מידע על התקנת ספריית הלקוח של מאגר משאבי ענן והשימוש בה מופיע במאמר ספריות הלקוח של מאגר משאבי ענן.

כדי לבצע אימות במאגר משאבי ענן, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.

לפני שמריצים דוגמאות קוד, צריך להגדיר את משתנה הסביבה GOOGLE_CLOUD_UNIVERSE_DOMAIN לערך s3nsapis.fr.

from google.cloud import asset_v1

# TODO project_id = 'Your Google Cloud Project ID'
# TODO asset_names = 'Your asset names list, e.g.:
# ["//storage.googleapis.com/[BUCKET_NAME]",]'

client = asset_v1.AssetServiceClient()
parent = f"projects/{project_id}"
content_type = asset_v1.ContentType.RESOURCE
read_time_window = asset_v1.TimeWindow()
response = client.batch_get_assets_history(
    request={
        "parent": parent,
        "asset_names": asset_names,
        "content_type": content_type,
        "read_time_window": read_time_window,
    }
)
print(f"assets: {response.assets}")

Ruby

מידע על התקנת ספריית הלקוח של מאגר משאבי ענן והשימוש בה מופיע במאמר ספריות הלקוח של מאגר משאבי ענן.

כדי לבצע אימות במאגר משאבי ענן, צריך להגדיר את Application Default Credentials. למידע נוסף, ראו הגדרת אימות לסביבת פיתוח מקומית.

לפני שמריצים דוגמאות קוד, צריך להגדיר את משתנה הסביבה GOOGLE_CLOUD_UNIVERSE_DOMAIN לערך s3nsapis.fr.

require "google/cloud/asset"

# project_id = 'YOUR_PROJECT_ID'
# asset names, e.g.: //storage.googleapis.com/[YOUR_BUCKET_NAME]
# asset_names = [ASSET_NAMES, COMMMA_DELIMTTED]
asset_service = Google::Cloud::Asset.asset_service

formatted_parent = asset_service.project_path project: project_id

content_type = :RESOURCE
read_time_window = {
  start_time: {
    seconds: Time.now.getutc.to_i
  }
}

response = asset_service.batch_get_assets_history(
  parent:           formatted_parent,
  content_type:     content_type,
  read_time_window: read_time_window,
  asset_names:      asset_names
)
# Do things with the response
puts response.assets