10#include <shared_mutex>
17#include "nlohmann/json_fwd.hpp"
54 nlohmann::json
GET(
const std::shared_ptr<std::string> endPoint,
55 const std::shared_ptr<httplib::Headers> headers,
56 uint8_t sucsessStatus);
66 nlohmann::json
SPOST(
const std::shared_ptr<std::string> endPoint,
67 const std::shared_ptr<httplib::Headers> headers,
68 nlohmann::json jsonPayload,
69 const std::shared_ptr<uint8_t> sucsessStatus);
78 nlohmann::json
CPOST(
const std::shared_ptr<std::string> endPoint,
79 const std::shared_ptr<httplib::Headers> headers,
80 nlohmann::json jsonPayload,
81 const std::shared_ptr<uint8_t> sucsessStatus);
89 std::pair<std::string, std::string>
resolvePath(
const std::string &uriPath);
95 std::unordered_map<std::string, std::string>
batchResolvePath(std::vector<std::string> &uriPaths);
103 std::pair<std::string, std::string>
getAssetIdent(
const nlohmann::json &uriResolverRespone);
122 std::unordered_map<std::string, std::string>*
131 std::string
rootReplace(
const std::string &rootLessPath);
143 httplib::Headers headers,
144 std::string &Payload,
145 const int &sucsessStatus);
155 httplib::Headers headers,
156 std::string &Payload,
157 const int &sucsessStatus);
196 std::shared_ptr<AyonLogger>
Log;
std::string getAppDataDir()
Definition: appDataFoulder.h:25
Central Ayon api class Class for exposing Ayon server functions to C++ users.
Definition: AyonCppApi.h:25
bool batchResolveOptimizeVector
decides if the cpp api removes duplicates from batch request vector default is true
Definition: AyonCppApi.h:213
std::string getUrl()
returns the stored AYON server url.
Definition: AyonCppApi.cpp:462
std::string uriResolverEndpoint
Definition: AyonCppApi.h:197
std::string serialCorePost(const std::string &endPoint, httplib::Headers headers, std::string &Payload, const int &sucsessStatus)
calls the server in an serial way by sharing the AyonServer pointer
Definition: AyonCppApi.cpp:470
std::string rootReplace(const std::string &rootLessPath)
replaces {root[var]} for ayon:// paths
Definition: AyonCppApi.cpp:138
bool loadEnvVars()
this function loads all needed varible into the class this will allso be called by the constructor
Definition: AyonCppApi.cpp:64
std::string uriResolverEndpointPathOnlyVar
Definition: AyonCppApi.h:198
std::string siteId
Definition: AyonCppApi.h:179
nlohmann::json CPOST(const std::shared_ptr< std::string > endPoint, const std::shared_ptr< httplib::Headers > headers, nlohmann::json jsonPayload, const std::shared_ptr< uint8_t > sucsessStatus)
http post request utilizing the creation of a new httplib client ( Generative Async )
Definition: AyonCppApi.cpp:252
u_int16_t maxGroupSizeForAsyncRequests
Definition: AyonCppApi.h:187
u_int8_t maxCallRetrys
Definition: AyonCppApi.h:189
std::string GenerativeCorePost(const std::string &endPoint, httplib::Headers headers, std::string &Payload, const int &sucsessStatus)
calls the server while creating a new client instance to stay async
Definition: AyonCppApi.cpp:514
std::mutex ConcurentRequestAfterffoMutex
Definition: AyonCppApi.h:201
AyonApi()
constructor
Definition: AyonCppApi.cpp:39
const char * authKey
Definition: AyonCppApi.h:172
std::unordered_map< std::string, std::string > * getSiteRoots()
gets the site root overwrites for the current project.
Definition: AyonCppApi.cpp:119
std::pair< std::string, std::string > resolvePath(const std::string &uriPath)
uses the uri resolve endpoint on the AYON server in order to resolve an uri path towards the local pa...
Definition: AyonCppApi.cpp:284
bool serverBusy
this bool will be set to true if a 503 is encountered
Definition: AyonCppApi.h:222
bool pathOnlyReselution
Definition: AyonCppApi.h:199
u_int16_t retryWaight
Definition: AyonCppApi.h:190
uint16_t ServerBusyCode
Definition: AyonCppApi.h:215
std::unique_ptr< httplib::Client > AyonServer
Definition: AyonCppApi.h:168
const char * serverUrl
Definition: AyonCppApi.h:173
std::unordered_map< std::string, std::string > siteRoots
Definition: AyonCppApi.h:170
u_int16_t connectionTimeOutMax
Definition: AyonCppApi.h:206
nlohmann::json GET(const std::shared_ptr< std::string > endPoint, const std::shared_ptr< httplib::Headers > headers, uint8_t sucsessStatus)
runns a get command and returns the response body as std::string
Definition: AyonCppApi.cpp:172
u_int8_t minGrpSizeForAsyncRequests
Definition: AyonCppApi.h:185
std::string convertUriVecToString(const std::vector< std::string > &uriVec)
converts a vector off uris into an string to serve into CorePost funcs
Definition: AyonCppApi.cpp:606
std::string ayonAppData
Definition: AyonCppApi.h:176
std::unordered_map< std::string, std::string > batchResolvePath(std::vector< std::string > &uriPaths)
resolves a vector off paths against the AYON server in an async way uses auto generated batch request...
Definition: AyonCppApi.cpp:306
nlohmann::json SPOST(const std::shared_ptr< std::string > endPoint, const std::shared_ptr< httplib::Headers > headers, nlohmann::json jsonPayload, const std::shared_ptr< uint8_t > sucsessStatus)
post Request via a shared httplib client ( serial )
Definition: AyonCppApi.cpp:214
std::string userName
Definition: AyonCppApi.h:180
const int num_threads
maximum number off threads that the cpu can handle at the same time.
Definition: AyonCppApi.h:195
u_int16_t regroupSizeForAsyncRequests
Definition: AyonCppApi.h:186
std::mutex AyonServerMutex
needed for serial resolve operations.
Definition: AyonCppApi.h:227
std::pair< std::string, std::string > getAssetIdent(const nlohmann::json &uriResolverRespone)
this function takes a ayon path uri response(resolved ayon://path) and returns a pair of assetIdentif...
Definition: AyonCppApi.cpp:432
std::string getKey()
returns the stored apikey.
Definition: AyonCppApi.cpp:455
std::shared_ptr< AyonLogger > Log
Definition: AyonCppApi.h:196
~AyonApi()
destructor
Definition: AyonCppApi.cpp:59
u_int16_t minVecSizeForGroupSplitAsyncRequests
Definition: AyonCppApi.h:188
uint16_t RequestDelayWhenServerBusy
Definition: AyonCppApi.h:216
uint16_t GenerativeCorePostMaxLoopIterations
Definition: AyonCppApi.h:204
std::string ayonProjectName
Definition: AyonCppApi.h:174
uint8_t maxConcurentRequestAfterffo
Definition: AyonCppApi.h:202
u_int8_t readTimeOutMax
Definition: AyonCppApi.h:207
std::shared_ptr< AyonLogger > logPointer()
get function for shared AyonLogger pointer used by this class instance
Definition: AyonCppApi.cpp:623