github.com/google/cloudprober@v0.11.3/rds/proto/rds.proto (about) 1 syntax = "proto2"; 2 3 package cloudprober.rds; 4 5 option go_package = "github.com/google/cloudprober/rds/proto"; 6 7 service ResourceDiscovery { 8 // ListResources returns the list of resources matching the URI provided in 9 // the request. 10 rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse) {} 11 } 12 13 message ListResourcesRequest { 14 // Resources to list and the associated IP address that we are interested in. 15 // Example: 16 // { 17 // provider: "gcp" 18 // resource_path: "gce_instances/project-1" 19 // filter { 20 // key: "name" 21 // value: "ig-us-central1-.*" 22 // } 23 // ip_config { 24 // ip_type: PUBLIC 25 // } 26 // } 27 28 // Provider is the resource list provider, for example: "gcp", "aws", etc. 29 required string provider = 1; 30 31 // Provider specific resource path. For example: for GCP, it could be 32 // "gce_instances/<project>", "regional_forwarding_rules/<project>", etc. 33 optional string resource_path = 2; 34 35 // Filters for the resources list. Filters are ANDed: all filters should 36 // succeed for an item to included in the result list. 37 repeated Filter filter = 3; 38 39 // Optional. If resource has an IP (and a NIC) address, following 40 // fields determine which IP address will be included in the results. 41 optional IPConfig ip_config = 4; 42 43 // If specified, and if provider supports it, server will send resources in 44 // the response only if they have changed since the given timestamp. Since 45 // there may be no resources in the response for non-caching reasons as well, 46 // clients should use the "last_modified" field in the response to determine 47 // if they need to update the local cache or not. 48 optional int64 if_modified_since = 5; 49 } 50 51 message Filter { 52 required string key = 1; 53 required string value = 2; 54 } 55 56 message IPConfig { 57 // NIC index 58 optional int32 nic_index = 1 [default = 0]; 59 60 enum IPType { 61 // Default IP of the resource. 62 // - Private IP for instance resource 63 // - Forwarding rule IP for forwarding rule. 64 DEFAULT = 0; 65 66 // Instance's external IP. 67 PUBLIC = 1; 68 69 // First IP address from the first Alias IP range. For example, for 70 // alias IP range "192.168.12.0/24", 192.168.12.0 will be returned. 71 // Supported only on GCE. 72 ALIAS = 2; 73 } 74 optional IPType ip_type = 3; 75 76 enum IPVersion { 77 IP_VERSION_UNSPECIFIED = 0; 78 IPV4 = 1; 79 IPV6 = 2; 80 } 81 optional IPVersion ip_version = 2; 82 } 83 84 message Resource { 85 // Resource name. 86 required string name = 1; 87 88 // Resource's IP address, selected based on the request's ip_config. 89 optional string ip = 2; 90 91 // Resource's port, if any. 92 optional int32 port = 5; 93 94 // Resource's labels, if any. 95 map<string, string> labels = 6; 96 97 // Last updated (in unix epoch). 98 optional int64 last_updated = 7; 99 100 // Id associated with the resource, if any. 101 optional string id = 3; 102 103 // Optional info associated with the resource. Some resource type may make use 104 // of it. 105 optional bytes info = 4; 106 } 107 108 message ListResourcesResponse { 109 // There may not be any resources in the response if request contains the 110 // "if_modified_since" field and provider "knows" that nothing has changed since 111 // the if_modified_since timestamp. 112 repeated Resource resources = 1; 113 114 // When were resources last modified. This field will always be set if 115 // provider has a way of figuring out last_modified timestamp for its 116 // resources. 117 optional int64 last_modified = 2; 118 }