Skip to content

Commit

Permalink
Support editing/patching model files (#140)
Browse files Browse the repository at this point in the history
* Support editing/patching model files

Signed-off-by: Nate Koenig <[email protected]>

* Added documentation

Signed-off-by: Nate Koenig <[email protected]>

* Set keep alive on

Signed-off-by: Nate Koenig <[email protected]>

* Documentation and tests

Signed-off-by: Nate Koenig <[email protected]>

* One more test and exit catch missing -u

Signed-off-by: Nate Koenig <[email protected]>

Co-authored-by: Nate Koenig <[email protected]>
  • Loading branch information
nkoenig and Nate Koenig authored Dec 9, 2020
1 parent bdf5303 commit 21e8b0f
Show file tree
Hide file tree
Showing 6 changed files with 294 additions and 136 deletions.
18 changes: 18 additions & 0 deletions include/ignition/fuel_tools/FuelClient.hh
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,24 @@ namespace ignition
const ignition::fuel_tools::ModelIdentifier &_model,
const std::vector<std::string> &_headers);

/// \brief Update a model using a PATCH request.
///
/// Model fields that are patched by this function:
/// * private
/// * Model files contained in _pathToModelDir.
/// * Description, tags, license, and other attributes found in the
/// metadata.pbtxt or model.config file.
///
/// \param[in] _model The model to patch. The contents of this model
/// will be sent in the PATCH request.
/// \param[in] _headers Headers to set on the HTTP request.
/// \param[in] _pathToModelDir a path to a directory containing a model.
/// \return Result of the patch operation.
public: Result PatchModel(
const ignition::fuel_tools::ModelIdentifier &_model,
const std::vector<std::string> &_headers,
const std::string &_pathToModelDir);

/// \brief Parse Collection identifer from URL.
/// \param[in] _url The unique URL of a collection. It may also be a
/// unique name, which is a URL without the server version.
Expand Down
Loading

0 comments on commit 21e8b0f

Please sign in to comment.