publishAgent method
Implementation
Future<String> publishAgent(Map agentJson) async {
final response = await http.post(Uri.parse('$baseUrl/agent/deploy-agent'),
body: jsonEncode(agentJson),
headers: {
HttpHeaders.authorizationHeader:
'Bearer ${DashCliEnv.instance.env.authToken}',
"Content-Type": "application/json"
});
if (response.statusCode == 200) {
return jsonDecode(response.body)['status'];
} else {
throw (_handleErrorStatusCodes(response));
}
}