Apache Mesos
validation.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 __COMMON_VALIDATION_HPP__
18 #define __COMMON_VALIDATION_HPP__
19 
20 #include <string>
21 
22 #include <mesos/mesos.hpp>
23 
24 #include <stout/error.hpp>
25 #include <stout/option.hpp>
26 
27 namespace mesos {
28 
29 namespace executor {
30 
31 class Call;
32 
33 } // namespace executor {
34 
35 namespace internal {
36 namespace common {
37 namespace validation {
38 
39 // Validates if `id` meets the common requirements for IDs in Mesos.
40 // Note that some IDs in Mesos have additional/stricter requirements.
41 Option<Error> validateID(const std::string& id);
42 
43 Option<Error> validateTaskID(const TaskID& taskId);
44 
45 Option<Error> validateExecutorID(const ExecutorID& executorId);
46 
47 Option<Error> validateSlaveID(const SlaveID& slaveId);
48 
49 Option<Error> validateFrameworkID(const FrameworkID& frameworkId);
50 
51 Option<Error> validateSecret(const Secret& secret);
52 
54 
55 Option<Error> validateCommandInfo(const CommandInfo& command);
56 
57 Option<Error> validateVolume(const Volume& volume);
58 
59 Option<Error> validateContainerInfo(const ContainerInfo& containerInfo);
60 
62  const google::protobuf::RepeatedPtrField<Resource>& resources);
63 
64 Option<Error> validateHealthCheck(const HealthCheck& healthCheck);
65 
66 Option<Error> validateCheckInfo(const CheckInfo& checkInfo);
67 
68 Option<Error> validateCheckStatusInfo(const CheckStatusInfo& checkStatusInfo);
69 
71 
72 Option<Error> validateOfferFilters(const OfferFilters& offerFilters);
73 
75 
76 } // namespace validation {
77 } // namespace common {
78 } // namespace internal {
79 } // namespace mesos {
80 
81 #endif // __COMMON_VALIDATION_HPP__
Option< Error > validateFrameworkID(const FrameworkID &frameworkId)
Option< Error > validateID(const std::string &id)
Option< Error > validateExecutorID(const ExecutorInfo &executor)
Option< Error > validateInputScalarValue(double value)
Option< Error > validateSecret(const Secret &secret)
Option< Error > validateEnvironment(const Environment &environment)
mesos::v1::scheduler::Call Call
Definition: mesos.hpp:2851
Option< Error > validateCommandInfo(const CommandInfo &command)
Option< Error > validateGpus(const google::protobuf::RepeatedPtrField< Resource > &resources)
Option< Error > validateSlaveID(const SlaveID &slaveId)
Environment * environment
Option< Error > validateExecutorCall(const mesos::executor::Call &call)
Option< Error > validateVolume(const Volume &volume)
Definition: agent.hpp:25
Option< Error > validateCheckStatusInfo(const CheckStatusInfo &checkStatusInfo)
Definition: attributes.hpp:24
Option< Error > validateHealthCheck(const TaskInfo &task)
Option< Error > validateOfferFilters(const FrameworkInfo &frameworkInfo)
Option< Error > validateTaskID(const TaskID &taskId)
Option< Error > validateCheckInfo(const CheckInfo &checkInfo)
Option< Error > validateContainerInfo(const ContainerInfo &containerInfo)