syntax = "proto3";

package yandex.cloud.loadbalancer.v1;

import "google/protobuf/timestamp.proto";
import "yandex/cloud/validation.proto";

option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/loadbalancer/v1;loadbalancer";
option java_package = "yandex.cloud.api.loadbalancer.v1";

// A TargetGroup resource. For more information, see [Target groups and resources](/docs/network-load-balancer/target-resources).
message TargetGroup {
  // Output only. ID of the target group.
  string id = 1;

  // ID of the folder that the target group belongs to.
  string folder_id = 2;

  // Output only. Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  google.protobuf.Timestamp created_at = 3;

  // Name of the target group. 
  // The name is unique within the folder. 3-63 characters long.
  string name = 4;

  // Description of the target group. 0-256 characters long.
  string description = 5;

  // Resource labels as `` key:value `` pairs. Maximum of 64 per resource.
  map<string, string> labels = 6;

  // ID of the region where the target group resides.
  string region_id = 7;

  // A list of targets in the target group.
  repeated Target targets = 9;
}

// A Target resource. For more information, see [Target groups and resources](/docs/network-load-balancer/concepts/target-resources).
message Target {
  // ID of the subnet that targets are connected to. 
  // All targets in the target group must be connected to the same subnet within a single availability zone.
  string subnet_id = 1 [(length) = "<=50"];

  // IP address of the target.
  string address = 2;
}
