/*
Copyright AppsCode Inc. and Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


// This file was autogenerated by go-to-protobuf. Do not edit it manually!

syntax = "proto2";

package kmodules.xyz.prober.api.v1;

import "k8s.io/api/core/v1/generated.proto";
import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";

// Package-wide variables from generator "generated".
option go_package = "kmodules.xyz/prober/api/v1";

message FormEntry {
  optional string key = 1;

  repeated string values = 2;
}

// HTTPPostAction describes an action based on HTTP Post requests.
message HTTPPostAction {
  // Path to access on the HTTP server.
  // +optional
  optional string path = 1;

  // Name or number of the port to access on the container.
  // Number must be in the range 1 to 65535.
  // Name must be an IANA_SVC_NAME.
  optional k8s.io.apimachinery.pkg.util.intstr.IntOrString port = 2;

  // Host name to connect to, defaults to the pod IP. You probably want to set
  // "Host" in httpHeaders instead.
  // +optional
  optional string host = 3;

  // Scheme to use for connecting to the host.
  // Defaults to HTTP.
  // +optional
  optional string scheme = 4;

  // Custom headers to set in the request. HTTP allows repeated headers.
  // +optional
  repeated k8s.io.api.core.v1.HTTPHeader httpHeaders = 5;

  // Body to set in the request.
  // +optional
  optional string body = 6;

  // Form to set in the request body.
  // +optional
  repeated FormEntry form = 7;
}

// Handler defines a specific action that should be taken
// TODO: pass structured data to these actions, and document that data here.
message Handler {
  // One and only one of the following should be specified.
  // Exec specifies the action to take.
  // +optional
  optional k8s.io.api.core.v1.ExecAction exec = 1;

  // HTTPGet specifies the http Get request to perform.
  // +optional
  optional k8s.io.api.core.v1.HTTPGetAction httpGet = 2;

  // HTTPPost specifies the http Post request to perform.
  // +optional
  optional HTTPPostAction httpPost = 3;

  // TCPSocket specifies an action involving a TCP port.
  // TCP hooks not yet supported
  // TODO: implement a realistic TCP lifecycle hook
  // +optional
  optional k8s.io.api.core.v1.TCPSocketAction tcpSocket = 4;

  // ContainerName specifies the name of the container where to execute the commands for Exec probe
  // or where to find the port for HTTP or TCP probe
  // +optional
  optional string containerName = 5;
}

