Skip to content

Commit

Permalink
feat: add is_internal option (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Oct 12, 2019
1 parent c8e8798 commit 205d6a8
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ message TypedValue {
//
// * For a `GAUGE` metric, the `startTime` value is technically optional; if
// no value is specified, the start time defaults to the value of the
// end time, and the interval represents a single point in time. Such an
// end time, and the interval represents a single point in time. If both
// start and end times are specified, they must be identical. Such an
// interval is valid only for `GAUGE` metrics, which are point-in-time
// measurements.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ option php_namespace = "Google\\Cloud\\Monitoring\\V3";
// A single data point in a time series.
message Point {
// The time interval to which the data point applies. For `GAUGE` metrics,
// only the end time of the interval is used. For `DELTA` metrics, the start
// and end time should specify a non-zero interval, with subsequent points
// specifying contiguous and non-overlapping intervals. For `CUMULATIVE`
// metrics, the start and end time should specify a non-zero interval, with
// subsequent points specifying the same start time and increasing end times,
// until an event resets the cumulative value to zero and sets a new start
// time for the following points.
// the start time is optional, but if it is supplied, it must equal the end
// time. For `DELTA` metrics, the start and end time should specify a
// non-zero interval, with subsequent points specifying contiguous and
// non-overlapping intervals. For `CUMULATIVE` metrics, the start and end
// time should specify a non-zero interval, with subsequent points specifying
// the same start time and increasing end times, until an event resets the
// cumulative value to zero and sets a new start time for the following
// points.
TimeInterval interval = 1;

// The value of the data point.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@ option java_outer_classname = "UptimeProto";
option java_package = "com.google.monitoring.v3";
option php_namespace = "Google\\Cloud\\Monitoring\\V3";

// The regions from which an Uptime check can be run.
enum UptimeCheckRegion {
// Default value if no region is specified. Will result in Uptime checks
// running from all regions.
REGION_UNSPECIFIED = 0;

// Allows checks to run from locations within the United States of America.
USA = 1;

// Allows checks to run from locations within the continent of Europe.
EUROPE = 2;

// Allows checks to run from locations within the continent of South
// America.
SOUTH_AMERICA = 3;

// Allows checks to run from locations within the Asia Pacific area (ex:
// Singapore).
ASIA_PACIFIC = 4;
}

// An internal checker allows Uptime checks to run on private/internal GCP
// resources.
message InternalChecker {
Expand Down Expand Up @@ -83,27 +104,6 @@ message InternalChecker {
State state = 7;
}

// The regions from which an Uptime check can be run.
enum UptimeCheckRegion {
// Default value if no region is specified. Will result in Uptime checks
// running from all regions.
REGION_UNSPECIFIED = 0;

// Allows checks to run from locations within the United States of America.
USA = 1;

// Allows checks to run from locations within the continent of Europe.
EUROPE = 2;

// Allows checks to run from locations within the continent of South
// America.
SOUTH_AMERICA = 3;

// Allows checks to run from locations within the Asia Pacific area (ex:
// Singapore).
ASIA_PACIFIC = 4;
}

// The supported resource types that can be used as values of
// `group_resource.resource_type`.
// `INSTANCE` includes `gce_instance` and `aws_ec2_instance` resource types.
Expand Down Expand Up @@ -304,6 +304,12 @@ message UptimeCheckConfig {
// checks running from all available regions.
repeated UptimeCheckRegion selected_regions = 10;

// If this is `true`, then checks are made only from the 'internal_checkers'.
// If it is `false`, then checks are made only from the 'selected_regions'.
// It is an error to provide 'selected_regions' when is_internal is `true`,
// or to provide 'internal_checkers' when is_internal is `false`.
bool is_internal = 15 [deprecated = true];

// The internal checkers that this check will egress from. If `is_internal` is
// `true` and this list is empty, the check will egress from all the
// InternalCheckers configured for the project that owns this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const TypedValue = {
*
* * For a `GAUGE` metric, the `startTime` value is technically optional; if
* no value is specified, the start time defaults to the value of the
* end time, and the interval represents a single point in time. Such an
* end time, and the interval represents a single point in time. If both
* start and end times are specified, they must be identical. Such an
* interval is valid only for `GAUGE` metrics, which are point-in-time
* measurements.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
*
* @property {Object} interval
* The time interval to which the data point applies. For `GAUGE` metrics,
* only the end time of the interval is used. For `DELTA` metrics, the start
* and end time should specify a non-zero interval, with subsequent points
* specifying contiguous and non-overlapping intervals. For `CUMULATIVE`
* metrics, the start and end time should specify a non-zero interval, with
* subsequent points specifying the same start time and increasing end times,
* until an event resets the cumulative value to zero and sets a new start
* time for the following points.
* the start time is optional, but if it is supplied, it must equal the end
* time. For `DELTA` metrics, the start and end time should specify a
* non-zero interval, with subsequent points specifying contiguous and
* non-overlapping intervals. For `CUMULATIVE` metrics, the start and end
* time should specify a non-zero interval, with subsequent points specifying
* the same start time and increasing end times, until an event resets the
* cumulative value to zero and sets a new start time for the following
* points.
*
* This object should have the same structure as [TimeInterval]{@link google.monitoring.v3.TimeInterval}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ const InternalChecker = {
*
* The number should be among the values of [UptimeCheckRegion]{@link google.monitoring.v3.UptimeCheckRegion}
*
* @property {boolean} isInternal
* If this is `true`, then checks are made only from the 'internal_checkers'.
* If it is `false`, then checks are made only from the 'selected_regions'.
* It is an error to provide 'selected_regions' when is_internal is `true`,
* or to provide 'internal_checkers' when is_internal is `false`.
*
* @property {Object[]} internalCheckers
* The internal checkers that this check will egress from. If `is_internal` is
* `true` and this list is empty, the check will egress from all the
Expand Down
6 changes: 3 additions & 3 deletions packages/google-cloud-monitoring/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"updateTime": "2019-10-11T11:22:49.209576Z",
"updateTime": "2019-10-12T11:23:31.960704Z",
"sources": [
{
"generator": {
Expand All @@ -12,8 +12,8 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "192d3d8221175f7cc0aa8eeac1d820f47c53da7f",
"internalRef": "274071638"
"sha": "af8dd2c1750558b538eaa6bdaa3bc899079533ee",
"internalRef": "274260771"
}
},
{
Expand Down
6 changes: 6 additions & 0 deletions packages/google-cloud-monitoring/test/gapic-v3.js
Original file line number Diff line number Diff line change
Expand Up @@ -2183,9 +2183,11 @@ describe('UptimeCheckServiceClient', () => {
// Mock response
const name2 = 'name2-1052831874';
const displayName = 'displayName1615086568';
const isInternal = true;
const expectedResponse = {
name: name2,
displayName: displayName,
isInternal: isInternal,
};

// Mock Grpc layer
Expand Down Expand Up @@ -2250,9 +2252,11 @@ describe('UptimeCheckServiceClient', () => {
// Mock response
const name = 'name3373707';
const displayName = 'displayName1615086568';
const isInternal = true;
const expectedResponse = {
name: name,
displayName: displayName,
isInternal: isInternal,
};

// Mock Grpc layer
Expand Down Expand Up @@ -2314,9 +2318,11 @@ describe('UptimeCheckServiceClient', () => {
// Mock response
const name = 'name3373707';
const displayName = 'displayName1615086568';
const isInternal = true;
const expectedResponse = {
name: name,
displayName: displayName,
isInternal: isInternal,
};

// Mock Grpc layer
Expand Down

0 comments on commit 205d6a8

Please sign in to comment.