Skip to content

Commit

Permalink
make docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Oct 16, 2023
1 parent eacfc4e commit 010e2c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func resourceCloudflareObservatoryScheduledTestCreate(ctx context.Context, d *sc
return diag.FromErr(fmt.Errorf("error creating observatory scheduled test %q: %w", d.Id(), err))
}

d.SetId(fmt.Sprintf("%s:%s", test.Schedule.URL, test.Schedule.Region))
d.SetId(stringChecksum(fmt.Sprintf("%s:%s", test.Schedule.URL, test.Schedule.Region)))

return resourceCloudflareObservatoryScheduledTestRead(ctx, d, meta)
}
Expand All @@ -70,7 +70,7 @@ func resourceCloudflareObservatoryScheduledTestRead(ctx context.Context, d *sche
}
return diag.FromErr(fmt.Errorf("error getting observatory scheduled test %q: %w", d.Id(), err))
}
d.SetId(fmt.Sprintf("%s:%s", schedule.URL, schedule.Region))
d.SetId(stringChecksum(fmt.Sprintf("%s:%s", schedule.URL, schedule.Region)))
d.Set("url", schedule.URL)
d.Set("region", schedule.Region)
d.Set("frequency", schedule.Frequency)
Expand Down Expand Up @@ -115,7 +115,7 @@ func resourceCloudflareObservatoryScheduledTestImport(ctx context.Context, d *sc
return nil, fmt.Errorf("failed to fetch web analytics site: %s", url)
}

d.SetId(fmt.Sprintf("%s:%s", schedule.URL, schedule.Region))
d.SetId(stringChecksum(fmt.Sprintf("%s:%s", schedule.URL, schedule.Region)))
d.Set(consts.ZoneIDSchemaKey, zoneID)
d.Set("url", schedule.URL)
d.Set("region", schedule.Region)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestAccCloudflareObservatoryScheduledTest_Create(t *testing.T) {
Config: testAccCloudflareObservatoryScheduledTest(rnd, zoneID, domain),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(name, consts.ZoneIDSchemaKey, zoneID),
resource.TestCheckResourceAttr(name, "url", domain),
resource.TestCheckResourceAttr(name, "url", domain+"/"),
resource.TestCheckResourceAttr(name, "region", "us-central1"),
resource.TestCheckResourceAttr(name, "frequency", "DAILY"),
),
Expand All @@ -45,7 +45,7 @@ func testAccCheckCloudflareObservatoryScheduledTestDestroy(s *terraform.State) e
continue
}

_, err := client.ObservatoryScheduledPageTest(context.Background(), cloudflare.ZoneIdentifier(rs.Primary.Attributes[consts.ZoneIDSchemaKey]), cloudflare.ObservatoryScheduledPageTestParams{
_, err := client.GetObservatoryScheduledPageTest(context.Background(), cloudflare.ZoneIdentifier(rs.Primary.Attributes[consts.ZoneIDSchemaKey]), cloudflare.GetObservatoryScheduledPageTestParams{
URL: rs.Primary.Attributes["url"],
Region: rs.Primary.Attributes["region"],
})
Expand Down

0 comments on commit 010e2c7

Please sign in to comment.