diff --git a/resource/reapi/bindings/c/reapi_cli.cpp b/resource/reapi/bindings/c/reapi_cli.cpp index fcf9fa41e..683a79318 100644 --- a/resource/reapi/bindings/c/reapi_cli.cpp +++ b/resource/reapi/bindings/c/reapi_cli.cpp @@ -195,6 +195,15 @@ extern "C" int reapi_cli_grow (reapi_cli_ctx_t *ctx, const char *R_subgraph) return reapi_cli_t::grow (ctx->rqt, R_subgraph); } +extern "C" int reapi_cli_shrink (reapi_cli_ctx_t *ctx, const char *subgraph_path) +{ + if (!ctx || !ctx->rqt || !subgraph_path) { + errno = EINVAL; + return -1; + } + return reapi_cli_t::shrink (ctx->rqt, subgraph_path); +} + extern "C" int reapi_cli_cancel (reapi_cli_ctx_t *ctx, const uint64_t jobid, bool noent_ok) { if (!ctx || !ctx->rqt) { diff --git a/resource/reapi/bindings/c/reapi_cli.h b/resource/reapi/bindings/c/reapi_cli.h index f2efa30a9..39a257182 100644 --- a/resource/reapi/bindings/c/reapi_cli.h +++ b/resource/reapi/bindings/c/reapi_cli.h @@ -151,6 +151,19 @@ int reapi_cli_update_allocate (reapi_cli_ctx_t *ctx, */ int reapi_cli_grow (reapi_cli_ctx_t *ctx, const char *R_subgraph); +/*! Shrink the resource graph with a path. + * + * \param h Opaque handle. How it is used is an implementation + * detail. However, when it is used within a Flux's + * service module, it is expected to be a pointer + * to a flux_t object. + * \param subgraph_path String representing the path from the cluster root + * to the root of the subgraph to be removed from + * the resource graph + * \return 0 on success; -1 on error. + */ +int reapi_cli_shrink (reapi_cli_ctx_t *ctx, const char *subgraph_path); + /*! Cancel the allocation or reservation corresponding to jobid. * * \param ctx reapi_cli_ctx_t context object