Apache Mesos
puller.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 __PROVISIONER_DOCKER_PULLER_HPP__
18 #define __PROVISIONER_DOCKER_PULLER_HPP__
19 
20 #include <string>
21 #include <vector>
22 
23 #include <stout/try.hpp>
24 
25 #include <process/future.hpp>
26 #include <process/owned.hpp>
27 #include <process/shared.hpp>
28 
29 #include <mesos/docker/spec.hpp>
30 
31 #include <mesos/uri/fetcher.hpp>
32 
34 
36 
37 #include "slave/flags.hpp"
38 
39 namespace mesos {
40 namespace internal {
41 namespace slave {
42 namespace docker {
43 
44 class Puller
45 {
46 public:
48  const Flags& flags,
49  const process::Shared<uri::Fetcher>& fetcher,
50  SecretResolver* secretResolver = nullptr);
51 
52  virtual ~Puller() {}
53 
64  const ::docker::spec::ImageReference& reference,
65  const std::string& directory,
66  const std::string& backend,
67  const Option<Secret>& config = None()) = 0;
68 };
69 
70 } // namespace docker {
71 } // namespace slave {
72 } // namespace internal {
73 } // namespace mesos {
74 
75 
76 #endif // __PROVISIONER_DOCKER_PULLER_HPP__
Definition: option.hpp:29
static Try< process::Owned< Puller > > create(const Flags &flags, const process::Shared< uri::Fetcher > &fetcher, SecretResolver *secretResolver=nullptr)
Definition: check.hpp:33
virtual ~Puller()
Definition: puller.hpp:52
Definition: flags.hpp:39
virtual process::Future< Image > pull(const ::docker::spec::ImageReference &reference, const std::string &directory, const std::string &backend, const Option< Secret > &config=None())=0
Pull a Docker image layers into the specified directory, and return the list of layer ids in that ima...
Definition: owned.hpp:26
Definition: agent.hpp:25
Definition: none.hpp:27
Definition: attributes.hpp:24
Definition: resolver.hpp:34
Definition: spec.hpp:35
Definition: parse.hpp:33
Definition: future.hpp:58