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 
35 #include "slave/flags.hpp"
36 
37 namespace mesos {
38 namespace internal {
39 namespace slave {
40 namespace docker {
41 
42 class Puller
43 {
44 public:
46  const Flags& flags,
47  const process::Shared<uri::Fetcher>& fetcher,
48  SecretResolver* secretResolver = nullptr);
49 
50  virtual ~Puller() {}
51 
62  const ::docker::spec::ImageReference& reference,
63  const std::string& directory,
64  const std::string& backend,
65  const Option<Secret>& config = None()) = 0;
66 };
67 
68 } // namespace docker {
69 } // namespace slave {
70 } // namespace internal {
71 } // namespace mesos {
72 
73 
74 #endif // __PROVISIONER_DOCKER_PULLER_HPP__
Definition: option.hpp:28
static Try< process::Owned< Puller > > create(const Flags &flags, const process::Shared< uri::Fetcher > &fetcher, SecretResolver *secretResolver=nullptr)
Definition: try.hpp:34
virtual process::Future< std::vector< std::string > > 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...
virtual ~Puller()
Definition: puller.hpp:50
Definition: flags.hpp:39
Definition: owned.hpp:25
#define flags
Definition: decoder.hpp:18
Definition: none.hpp:27
Definition: resolver.hpp:34
Definition: future.hpp:57