Apache Mesos
checks_runtime.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __CHECKS_RUNTIME_HPP__
18 #define __CHECKS_RUNTIME_HPP__
19 
20 #include <string>
21 #include <vector>
22 
23 #include <mesos/mesos.hpp>
24 
25 #include <process/http.hpp>
26 
27 #include <stout/option.hpp>
28 
29 namespace mesos {
30 namespace internal {
31 namespace checks {
32 namespace runtime {
33 
34 // `Plain` contains the runtime information for the regular Mesos
35 // containerizer.
36 struct Plain
37 {
38  // The namespaces to enter prior to performing the health check.
39  std::vector<std::string> namespaces;
40 
41  // The target task's pid used to enter the specified namespaces.
43 };
44 
45 // `Docker` contains the runtime information for the Docker containerizer.
46 struct Docker
47 {
48  // The namespaces to enter prior to performing the health check.
49  std::vector<std::string> namespaces;
50 
51  // The target task's pid used to enter the specified namespaces.
53 
54  std::string dockerPath; // Path to `docker` executable.
55  std::string socketName; // Path to the socket `dockerd` is listening on.
56  std::string containerName; // Container where the check is performed.
57 };
58 
59 // `Nested` contains the runtime information for nested containers created by
60 // the Mesos containerizer. In these cases, the command health check is sent to
61 // and performed by the agent. The HTTP and TCP health checks are still
62 // performed directly by the executor.
63 struct Nested
64 {
65  ContainerID taskContainerId; // The ContainerID of the target task.
66  process::http::URL agentURL; // The URL of the agent.
67 
68  // The authorization header the health checker should use to authenticate
69  // with the agent operator API.
71 };
72 
73 } // namespace runtime {
74 } // namespace checks {
75 } // namespace internal {
76 } // namespace mesos {
77 
78 #endif // __CHECKS_RUNTIME_HPP__
Option< std::string > authorizationHeader
Definition: checks_runtime.hpp:70
ContainerID taskContainerId
Definition: checks_runtime.hpp:65
std::vector< std::string > namespaces
Definition: checks_runtime.hpp:39
Option< pid_t > taskPid
Definition: checks_runtime.hpp:52
std::vector< std::string > namespaces
Definition: checks_runtime.hpp:49
Definition: checks_runtime.hpp:46
std::string socketName
Definition: checks_runtime.hpp:55
Definition: http.hpp:129
Definition: spec.hpp:26
process::http::URL agentURL
Definition: checks_runtime.hpp:66
Definition: attributes.hpp:24
std::string containerName
Definition: checks_runtime.hpp:56
Definition: checks_runtime.hpp:36
Option< pid_t > taskPid
Definition: checks_runtime.hpp:42
std::string dockerPath
Definition: checks_runtime.hpp:54
Definition: checks_runtime.hpp:63