Fork me on GitHub Fork me on GitHub

server


<%
var carbon = require('carbon');

print(carbon.server.address('http'));
print('<br>');
print(carbon.server.tenantDomain());
print('<br>');
print(carbon.server.tenantId());
print('<br>');
print(carbon.server.tenantUser('admin'));
print('<br>');

%>

Overview

Server object allows to do operations on Carbon server using Jaggery.


Operations

Operation Returns Description
address(transport String)StringThis method is used to get address of the server based on host or ip. It accepts the following parameters:

  • transport (Object) : https or http
tenantDomain(options Object)StringThis method returns tenent domain name based on tenentID, username or url. It accepts the following parameters:

  • options (Object) : object with information such as tenentId, username and/or url.
tenantId(options Object)StringThis method returns tenent Id based on tenentID, username or url. It accepts the following parameters:

  • options (Object) : object with information such as tenentId, username and/or url.
tenantUser(username String)ObjectThis method returns tenent user object when user name is given. It accepts the following parameters:

  • username (String) :
This returns an object with tenant user information.
{'domain' : 'carbon.super', 'username' : 'admin', 'tenantId' : -1234}
sandbox(options Object, fn String)NoneThis method is used to run a function using a different tenant.