MCPcopy Create free account
hub / github.com/apache/mesos / fromString

Method fromString

src/v1/resources.cpp:848–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846
847
848Try<vector<Resource>> Resources::fromString(
849 const string& text,
850 const string& defaultRole)
851{
852 // Try to parse as a JSON Array. Otherwise, parse as a text string.
853 Try<JSON::Array> json = JSON::parse<JSON::Array>(text);
854
855 return json.isSome() ?
856 Resources::fromJSON(json.get(), defaultRole) :
857 Resources::fromSimpleString(text, defaultRole);
858}
859
860
861Option<Error> Resources::validate(const Resource& resource)

Callers

nothing calls this directly

Calls 2

isSomeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected